startrails_rawdec — декодер RAW для StarTrailsX
===============================================

Что это. Динамическая библиотека, которая читает сырые файлы камер. Внутри
неё — rawler (https://github.com/dnglab/dnglab) под лицензией GNU LGPL 2.1;
всё остальное приложение с ней не связано и вызывает её через небольшой
интерфейс на C. Полный текст LGPL-2.1 — в THIRD-PARTY-NOTICES.md рядом с
приложением.

Зачем так. LGPL-2.1 §6 требует оставить получателю возможность заменить
библиотеку своей версией и продолжить пользоваться программой. Здесь это
сделано самым прямым способом: rawler лежит в отдельном файле
(startrails_rawdec.dll), исходники этого файла — в папке rawdec-source рядом
с приложением, и приложение примет любую вашу сборку, лишь бы совпал номер
интерфейса.

Как пересобрать.

  1. Поставьте Rust: https://rustup.rs
  2. В папке rawdec-source выполните:

         cargo build --release

  3. Возьмите target/release/startrails_rawdec.dll и положите рядом с
     StarTrailsX.exe вместо прежней.

Своя версия rawler. В Cargo.toml версия закреплена строкой rawler = "=0.7.2".
Поменяйте её на нужную (или на путь к своей копии:
rawler = { path = "../rawler" }) и соберите заново. Если ваша rawler
несовместима с вызовами в src/lib.rs, поправьте их — это и есть та самая
свобода, ради которой библиотека вынесена наружу.

Номер интерфейса. Приложение при запуске спрашивает у библиотеки rd_abi() и
размеры структур; они должны совпасть с теми, что оно ожидает. Не трогайте
RD_ABI и поля структур RdMeta/RdInfo, если не меняете обе стороны.

Без библиотеки. Если файла нет, приложение работает как обычно, только сырые
файлы не открываются: JPEG, TIFF, PNG и BMP не затронуты.

--------------------------------------------------------------------------

startrails_rawdec — the RAW decoder for StarTrailsX
===================================================

What this is. A shared library that reads camera raw files. Inside it is
rawler (https://github.com/dnglab/dnglab), licensed under the GNU LGPL 2.1;
the rest of the application is not linked with it and calls it through a
small C interface. The full text of the LGPL-2.1 is in
THIRD-PARTY-NOTICES.md next to the application.

Why. LGPL-2.1 §6 requires that you be able to replace the library with your
own version and keep using the program. Here that is done directly: rawler
lives in a separate file (startrails_rawdec.dll), the sources of that file
are in the rawdec-source folder next to the application, and the application
accepts any build of yours as long as the interface version matches.

How to rebuild.

  1. Install Rust: https://rustup.rs
  2. In the rawdec-source folder run:

         cargo build --release

  3. Take target/release/startrails_rawdec.dll and put it next to
     StarTrailsX.exe, replacing the old one.

Your own rawler. Cargo.toml pins rawler = "=0.7.2". Change it to the version
you want (or to your own copy: rawler = { path = "../rawler" }) and rebuild.
If your rawler is not compatible with the calls in src/lib.rs, adjust them —
that freedom is the reason this library is separate.

Interface version. At start-up the application asks the library for rd_abi()
and the sizes of its structures; they must match what it expects. Do not
change RD_ABI or the fields of RdMeta/RdInfo unless you change both sides.

Without the library. If the file is missing, the application works as usual
except that raw files cannot be opened: JPEG, TIFF, PNG and BMP are not
affected.
