From 4c9a87939c97247d182293ff696de1355ba06194 Mon Sep 17 00:00:00 2001 From: gennyble Date: Fri, 17 Nov 2023 05:15:33 -0600 Subject: add some docs --- LRI.md | 3 --- NOTES.md | 4 ++-- README.md | 49 ++++++++++++++++++++++++++++++++----------------- lri-rs/LICENSE | 15 +++++++++++++++ lri-study/LICENSE | 15 +++++++++++++++ prism/LICENSE | 15 +++++++++++++++ 6 files changed, 79 insertions(+), 22 deletions(-) create mode 100644 lri-rs/LICENSE create mode 100644 lri-study/LICENSE create mode 100644 prism/LICENSE diff --git a/LRI.md b/LRI.md index d75c431..b70fd55 100644 --- a/LRI.md +++ b/LRI.md @@ -1,6 +1,3 @@ -*(TODO: blog post?)* -*(this is bad, do better)* - # Anatomy of an LRI The file is made up of many blocks, usually 10 or 11 but cases of 40 have occurred. diff --git a/NOTES.md b/NOTES.md index 705b09e..e7c8136 100644 --- a/NOTES.md +++ b/NOTES.md @@ -9,7 +9,7 @@ so I figured looking for known data could help? I decided looking for a timestam would be the best bet because the camera gives me that information in the gallery app. Down to the minute, at least. We already know some of the protobuf definitions because of work by [Daniel Lawrence Lu](https://github.com/dllu)! That work can be -found in [lri-rs](https://github.com/dllu/lri-rs). +found in [dllu/lri-rs](https://github.com/dllu/lri-rs). [lri-rs_lightheader]: https://github.com/dllu/lri-rs/blob/main/proto/lightheader.proto#L77-L106 @@ -116,4 +116,4 @@ command: `java -jar quiltflower.jar -dgs=1 Light-L16-Archive/APKs/light_camera_d And it's proved useful! In `light/co/camera/proto/LightHeader.java` we can get an idea of the file header? -Can we parse the message in the header with the protobuf as described in: [dllu/lri-rs](https://github.com/dllu/lri-rs/blob/main/proto/lightheader.proto)? \ No newline at end of file +Can we parse the message in the header with the protobuf as described in: [dllu/lri-rs](https://github.com/dllu/lri-rs/blob/main/proto/lightheader.proto)? *(genny from the future, Nov 17th: yes we can :D)* \ No newline at end of file diff --git a/README.md b/README.md index 5ba1c46..ba0c9d6 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,32 @@ -Still early days. It's usable, to some degree, but nothing is stable, everything is broken, and I will scream. - -### LRI File Structure -The file is made up if blocks each with a short header, a protobuf message, and possibly some associated data. - -Things seem to be **little endian** - -#### Block Header -The header is 32 bytes long. and goes as follows: -| bytes | meaning | -| ----- | ------- | -| 4 | Magic Number: "LELR" | -| 8 | block length | -| 8 | protobuf message offset from the start of the block | -| 4 | protobuf message length | -| 1 | message type. 0 for `LightHeader` *(as described in lightheader.proto)*, 1 for `view_preferences.proto`, or 2 for gps data | -| 7 | reserved | +Still early days. Some things work, some things don't. + +I've details what I know about the LRI format in [LRI.md](LRI.md). + +And details about a weird format they use called Bayer JPEG described in [bayer_jpeg.md](bayer_jpeg.md) + +I took some notes as I worked on this that are in [NOTES.md](NOTES.md) if you're interested in that. + +## lri-rs +A Rust crate for parsing LRI files. This library isn't perfect, but it works enough to be able to grab image data from the filee. + +## prism +Breaks an LRI into the individual images it contains. + +TODO: I'd like to, one day, be able to write DNG files from prism, but currently it just spits out PNG. + +## lri-proto +This is a gently modified version of the [dllu/lri.rs](https://github.com/dllu/lri-rs) repository. Without the work from Daniel pulling the protobuf definitions from the Lumen software I truly don't know if I could've got as far as I did. + +MIT Copyright Daniel Lawrence Lu + +## lri-study +Run with the arguments `gather ` to print information about the LRI files in the directory to stdout. + +This was very useful to me while developing lri-rs to be able to see if patterns repeated across many different images so I could make some assumptions. + +### Licensing? +`lri-proto` is MIT Copyright Daniel Lawrence Lu. + +everything else is ISC copyright gennyble . + +Just means you have to provide attribution to the correct person if you use this code and that you're free to do with it what you like. \ No newline at end of file diff --git a/lri-rs/LICENSE b/lri-rs/LICENSE new file mode 100644 index 0000000..8a55383 --- /dev/null +++ b/lri-rs/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright 2023 gennyble + +Permission to use, copy, modify, and/or distribute this software for +any purposewith or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/lri-study/LICENSE b/lri-study/LICENSE new file mode 100644 index 0000000..8a55383 --- /dev/null +++ b/lri-study/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright 2023 gennyble + +Permission to use, copy, modify, and/or distribute this software for +any purposewith or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file diff --git a/prism/LICENSE b/prism/LICENSE new file mode 100644 index 0000000..8a55383 --- /dev/null +++ b/prism/LICENSE @@ -0,0 +1,15 @@ +ISC License + +Copyright 2023 gennyble + +Permission to use, copy, modify, and/or distribute this software for +any purposewith or without fee is hereby granted, provided that the +above copyright notice and this permission notice appear in all copies. + +THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL +WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE +FOR ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY +DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER +IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. \ No newline at end of file -- cgit 1.4.1-3-g733a5