feat: leica m9 engine
This commit is contained in:
1 parent
d0c32a83af
commit
988c6f7a63
23 files changed
+833
-4
No files matched your search
Binary file not shown.
@@ -0,0 +1,553 @@
|
||||
{
|
||||
"format_version": 1,
|
||||
"firmware": "LEICA_M9_1.216",
|
||||
"source_filename": "m9-1_216.upd",
|
||||
"firmware_size": 9407124,
|
||||
"firmware_sha256": "c3d30d7124abe6a3674cf2095719c178454b8773b1454cb70cf54ae468024da4",
|
||||
"decoded_firmware_sha256": "4f962bb7799ad9a6745ab36c2a3ba59757bfcbd205f50472ddf1b904a5756d20",
|
||||
"xor_period": 1021,
|
||||
"xor_key_sha256": "595c49ebabdaafcde7cc6cbd6aa7a37092d7c2ad4ca47d0d8bc57a04a5bed3a1",
|
||||
"xor_key_recovery": "Most frequent byte per period residue; full image SHA256 verified",
|
||||
"provenance": "Data extracted directly from user-provided M9 firmware",
|
||||
"archive_format": "Recursive little-endian PWAD",
|
||||
"leaf_file_count": 36,
|
||||
"entry_count": 43,
|
||||
"assets": [
|
||||
{
|
||||
"path": "PROCESS/LUTS.bin",
|
||||
"source_path": "LUTS/PROCESS/LUTS",
|
||||
"decoded_firmware_offset": 3084,
|
||||
"size": 427744,
|
||||
"sha256": "25debaf581d3fdbeca6ad7c6426ca5d9e597b98856c540ceddcc912b79409d8d"
|
||||
}
|
||||
],
|
||||
"audit": {
|
||||
"srecords": {
|
||||
"checksums_verified": 1887,
|
||||
"record_types": {
|
||||
"S0": 1,
|
||||
"S2": 1885,
|
||||
"S8": 1
|
||||
}
|
||||
},
|
||||
"symbol_counts": {
|
||||
"bf0": 878,
|
||||
"bf1": 854
|
||||
},
|
||||
"boot_block_counts": {
|
||||
"bf0": 41,
|
||||
"bf1": 43
|
||||
},
|
||||
"icc": {
|
||||
"ICCPROF/sRGB.icc": {
|
||||
"profile_class": "mntr",
|
||||
"color_space": "RGB ",
|
||||
"pcs": "XYZ ",
|
||||
"tags": [
|
||||
{
|
||||
"signature": "cprt",
|
||||
"offset": 336,
|
||||
"size": 51
|
||||
},
|
||||
{
|
||||
"signature": "desc",
|
||||
"offset": 388,
|
||||
"size": 108
|
||||
},
|
||||
{
|
||||
"signature": "wtpt",
|
||||
"offset": 496,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "bkpt",
|
||||
"offset": 516,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "rXYZ",
|
||||
"offset": 536,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "gXYZ",
|
||||
"offset": 556,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "bXYZ",
|
||||
"offset": 576,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "dmnd",
|
||||
"offset": 596,
|
||||
"size": 112
|
||||
},
|
||||
{
|
||||
"signature": "dmdd",
|
||||
"offset": 708,
|
||||
"size": 136
|
||||
},
|
||||
{
|
||||
"signature": "vued",
|
||||
"offset": 844,
|
||||
"size": 134
|
||||
},
|
||||
{
|
||||
"signature": "view",
|
||||
"offset": 980,
|
||||
"size": 36
|
||||
},
|
||||
{
|
||||
"signature": "lumi",
|
||||
"offset": 1016,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "meas",
|
||||
"offset": 1036,
|
||||
"size": 36
|
||||
},
|
||||
{
|
||||
"signature": "tech",
|
||||
"offset": 1072,
|
||||
"size": 12
|
||||
},
|
||||
{
|
||||
"signature": "rTRC",
|
||||
"offset": 1084,
|
||||
"size": 2060
|
||||
},
|
||||
{
|
||||
"signature": "gTRC",
|
||||
"offset": 1084,
|
||||
"size": 2060
|
||||
},
|
||||
{
|
||||
"signature": "bTRC",
|
||||
"offset": 1084,
|
||||
"size": 2060
|
||||
}
|
||||
]
|
||||
},
|
||||
"ICCPROF/A-RGB.icc": {
|
||||
"profile_class": "mntr",
|
||||
"color_space": "RGB ",
|
||||
"pcs": "XYZ ",
|
||||
"tags": [
|
||||
{
|
||||
"signature": "cprt",
|
||||
"offset": 252,
|
||||
"size": 50
|
||||
},
|
||||
{
|
||||
"signature": "desc",
|
||||
"offset": 304,
|
||||
"size": 107
|
||||
},
|
||||
{
|
||||
"signature": "wtpt",
|
||||
"offset": 412,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "bkpt",
|
||||
"offset": 432,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "rTRC",
|
||||
"offset": 452,
|
||||
"size": 14
|
||||
},
|
||||
{
|
||||
"signature": "gTRC",
|
||||
"offset": 468,
|
||||
"size": 14
|
||||
},
|
||||
{
|
||||
"signature": "bTRC",
|
||||
"offset": 484,
|
||||
"size": 14
|
||||
},
|
||||
{
|
||||
"signature": "rXYZ",
|
||||
"offset": 500,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "gXYZ",
|
||||
"offset": 520,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "bXYZ",
|
||||
"offset": 540,
|
||||
"size": 20
|
||||
}
|
||||
]
|
||||
},
|
||||
"ICCPROF/ECI-RGB.icc": {
|
||||
"profile_class": "mntr",
|
||||
"color_space": "RGB ",
|
||||
"pcs": "XYZ ",
|
||||
"tags": [
|
||||
{
|
||||
"signature": "cprt",
|
||||
"offset": 252,
|
||||
"size": 36
|
||||
},
|
||||
{
|
||||
"signature": "desc",
|
||||
"offset": 288,
|
||||
"size": 103
|
||||
},
|
||||
{
|
||||
"signature": "wtpt",
|
||||
"offset": 392,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "bkpt",
|
||||
"offset": 412,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "rTRC",
|
||||
"offset": 432,
|
||||
"size": 14
|
||||
},
|
||||
{
|
||||
"signature": "gTRC",
|
||||
"offset": 448,
|
||||
"size": 14
|
||||
},
|
||||
{
|
||||
"signature": "bTRC",
|
||||
"offset": 464,
|
||||
"size": 14
|
||||
},
|
||||
{
|
||||
"signature": "rXYZ",
|
||||
"offset": 480,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "gXYZ",
|
||||
"offset": 500,
|
||||
"size": 20
|
||||
},
|
||||
{
|
||||
"signature": "bXYZ",
|
||||
"offset": 520,
|
||||
"size": 20
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
},
|
||||
"records": [
|
||||
{
|
||||
"path": "RULES",
|
||||
"offset": 124,
|
||||
"size": 2788,
|
||||
"sha256": "54d4a605b4298987d7033854072b5de379cb8c620ddb645cf7c7d714eecb960d",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS",
|
||||
"offset": 2912,
|
||||
"size": 4228656,
|
||||
"sha256": "20003710e450cbfaa08d85a408f3f55f9fa8951c5149b32b9cdd1bcc4b673d36",
|
||||
"container": true
|
||||
},
|
||||
{
|
||||
"path": "LUTS/PROCESS",
|
||||
"offset": 2988,
|
||||
"size": 4055604,
|
||||
"sha256": "6a7f8faa9e2dcd783759e73b50bb10431b544a0898be44d7240626c798d69a1e",
|
||||
"container": true
|
||||
},
|
||||
{
|
||||
"path": "LUTS/PROCESS/CREATE",
|
||||
"offset": 3064,
|
||||
"size": 20,
|
||||
"sha256": "09f87daaccac4f3ab9e44d24a974bfdffc8cb30da6124ed5eb39f627961b2254",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/PROCESS/LUTS",
|
||||
"offset": 3084,
|
||||
"size": 427744,
|
||||
"sha256": "25debaf581d3fdbeca6ad7c6426ca5d9e597b98856c540ceddcc912b79409d8d",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/PROCESS/GAINMAP",
|
||||
"offset": 430828,
|
||||
"size": 20008,
|
||||
"sha256": "8f2075372d16c021b12a898195ccc9623c19c13715ee0309c8e8be76f7ad6911",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/PROCESS/LENS",
|
||||
"offset": 450836,
|
||||
"size": 3607756,
|
||||
"sha256": "6bd6743bdd1dba0521e1b04cfbe1cc1c62455567d79db071a9ac3d78192d5940",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/CCD",
|
||||
"offset": 4058592,
|
||||
"size": 148662,
|
||||
"sha256": "ec9938b060ff24a2075d41fd95ef8540baf4eee7c88fa282fd36efd4734740b2",
|
||||
"container": true
|
||||
},
|
||||
{
|
||||
"path": "LUTS/CCD/CREATE",
|
||||
"offset": 4058668,
|
||||
"size": 20,
|
||||
"sha256": "09f87daaccac4f3ab9e44d24a974bfdffc8cb30da6124ed5eb39f627961b2254",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/CCD/BLEMISH",
|
||||
"offset": 4058688,
|
||||
"size": 1092,
|
||||
"sha256": "ac0a7736ec88a5ab20aee8b44e2c6b5e7db54089117f9e29d6bf8142b87cfd7b",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/CCD/WREF",
|
||||
"offset": 4059780,
|
||||
"size": 147452,
|
||||
"sha256": "97bfd883f943f6815501b88350906887dfbbf8f64febda0a70943c53c8f21de4",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/CCD/LIN",
|
||||
"offset": 4207232,
|
||||
"size": 22,
|
||||
"sha256": "8c9bf334a1b585e6be5b2dbb9d5c7aa6c02b2ea53dcc95cc264c93f7020e3887",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/ICCPROF",
|
||||
"offset": 4207256,
|
||||
"size": 4304,
|
||||
"sha256": "ece22b043482b18346ee35d718cb35e5954bce45721a0c8524832cb70a1a69b5",
|
||||
"container": true
|
||||
},
|
||||
{
|
||||
"path": "LUTS/ICCPROF/ECI-RGB",
|
||||
"offset": 4207316,
|
||||
"size": 540,
|
||||
"sha256": "a05d905da9a54b1070d2a6cbd51a8780d7fd45f3279ec5e31e4555810109d1be",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/ICCPROF/sRGB",
|
||||
"offset": 4207856,
|
||||
"size": 3144,
|
||||
"sha256": "2b3aa1645779a9e634744faf9b01e9102b0c9b88fd6deced7934df86b949af7e",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/ICCPROF/A-RGB",
|
||||
"offset": 4211000,
|
||||
"size": 560,
|
||||
"sha256": "304f569a83c1e5eddaddac54e99ed03339333db013738bb499ab64f049887e28",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "LUTS/WBPARAM",
|
||||
"offset": 4211560,
|
||||
"size": 20008,
|
||||
"sha256": "8f2075372d16c021b12a898195ccc9623c19c13715ee0309c8e8be76f7ad6911",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "BF561",
|
||||
"offset": 4231568,
|
||||
"size": 294592,
|
||||
"sha256": "c40b5c84ba8b20e030a1f55be6f8f7593391d8bbdf4ab42ff618fb884d02c2a8",
|
||||
"container": true
|
||||
},
|
||||
{
|
||||
"path": "BF561/bf0",
|
||||
"offset": 4231644,
|
||||
"size": 119550,
|
||||
"sha256": "61334b081aade232d5900bc43b95b35611502825344f3b30d20713bcb50c8dcb",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "BF561/bf1",
|
||||
"offset": 4351196,
|
||||
"size": 119540,
|
||||
"sha256": "06abf2c4ef5e14beeadc033359d7fe4ae955c8a30b4ef26afa756afcf6d21870",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "BF561/bf0.map",
|
||||
"offset": 4470736,
|
||||
"size": 28096,
|
||||
"sha256": "1efdcd44e8a0739494d9bd1923767b12f04dae5c0b60cb4b02e940aaa28777de",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "BF561/bf1.map",
|
||||
"offset": 4498832,
|
||||
"size": 27328,
|
||||
"sha256": "b983c97e739f836482263ecd6df45bf0120c0a3fa8cffdc14455b660f628ba05",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "BODY",
|
||||
"offset": 4526160,
|
||||
"size": 143418,
|
||||
"sha256": "00295e22bf1c413a60c725635570b336f6df96be4a06af67ea8c006ff147f34b",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI",
|
||||
"offset": 4669580,
|
||||
"size": 3647672,
|
||||
"sha256": "1b11eb9971701a863e49f6a2266258646bd48de4b3a1ac0fb3efa3fcda39ab29",
|
||||
"container": true
|
||||
},
|
||||
{
|
||||
"path": "GUI/TRANS",
|
||||
"offset": 4669672,
|
||||
"size": 131704,
|
||||
"sha256": "2a256bcb37119a11ba0398d3b906f139106f50afac6de542922c8212387fe638",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES",
|
||||
"offset": 4801376,
|
||||
"size": 267433,
|
||||
"sha256": "47b06b5d6d40efafcaff38f10f3aa87d31d717fc6cc6ec6e0ba45ee71be0e7b2",
|
||||
"container": true
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/21_1PRT",
|
||||
"offset": 4801580,
|
||||
"size": 18411,
|
||||
"sha256": "964a448963680f0877511c28d2ff58dabab18b2f4683bc0e72271c42a663eb62",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/21_2GRP",
|
||||
"offset": 4819992,
|
||||
"size": 23172,
|
||||
"sha256": "64b4f3e5dd19c2c7a1e2b67a29738e5588eb46fd2a428cabd46f82c095a34676",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/21_3PAN",
|
||||
"offset": 4843164,
|
||||
"size": 23034,
|
||||
"sha256": "668f04ec5aa40b606880fb946e38fcd471903df3ae31dedece025b6a05d3feae",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/24_1PRT",
|
||||
"offset": 4866200,
|
||||
"size": 18489,
|
||||
"sha256": "c47091e1525edaa3084691f5347d56bad9941079626d9289c83d01c08e779bd0",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/24_2GRP",
|
||||
"offset": 4884692,
|
||||
"size": 23230,
|
||||
"sha256": "aeafd19017c984b5af36edfef6de72f8aaa192d4d9250410f904e555eb2039ae",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/24_3PAN",
|
||||
"offset": 4907924,
|
||||
"size": 22998,
|
||||
"sha256": "d745e5b12590d8ad6ce455258b7a0aa2f98de024e7ff488f2a3f7f03e827d73d",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/28_1PRT",
|
||||
"offset": 4930924,
|
||||
"size": 22605,
|
||||
"sha256": "fbaab266ad5081bf309ee4f8a8689dfae157bae4ea2ede2a6efd29b4b3031218",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/28_2GRP",
|
||||
"offset": 4953532,
|
||||
"size": 23081,
|
||||
"sha256": "0ebc510363569f32b8780fbb454272d31956afdbf2231dbe86f2f2ba44ec23ae",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/28_3PAN",
|
||||
"offset": 4976616,
|
||||
"size": 23282,
|
||||
"sha256": "4807cf02b240e25fb2c9165b12cd8d76880426e841fe70b7088a2d9227db39ac",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/35_1PRT",
|
||||
"offset": 4999900,
|
||||
"size": 22496,
|
||||
"sha256": "10d8f8d48adee4d63c9fa03df329c010121d3d817b72e3bd3447f7926375b325",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/35_2GRP",
|
||||
"offset": 5022396,
|
||||
"size": 23532,
|
||||
"sha256": "7e68a8805ee1f3b0a17cd4dfe68c3ed1fd26a96ee736c255966d501b125fe90c",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/IMAGES/35_3PAN",
|
||||
"offset": 5045928,
|
||||
"size": 22881,
|
||||
"sha256": "de2e06c0bad9d3f3abec4dbf7422fb94ca24ab97d1233defc0fafe4c41d4c039",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/FONT1",
|
||||
"offset": 5068812,
|
||||
"size": 1522988,
|
||||
"sha256": "253219215c6cf9eb5a518ae6ca3b1f200bd5cf26313a004f288d7658ae46a64a",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/USBLOGO",
|
||||
"offset": 6591800,
|
||||
"size": 1775,
|
||||
"sha256": "a41526a713fbec29a578efd05e479109f04f34a43d3f25d83a4c3de85eff26d1",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "GUI/FONT2",
|
||||
"offset": 6593576,
|
||||
"size": 1723676,
|
||||
"sha256": "a253001d344b3efd8146eb2d2b0d28ab8ce19af6af970c304904ceabb34d4e57",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "FPGA",
|
||||
"offset": 8317252,
|
||||
"size": 150176,
|
||||
"sha256": "e5f0bd2ca24f2e920f7573e8d83fa4b1a9e27da259bf891b55cfdc7afef5e674",
|
||||
"container": false
|
||||
},
|
||||
{
|
||||
"path": "BF547",
|
||||
"offset": 8467428,
|
||||
"size": 939688,
|
||||
"sha256": "f044097bc9ce0deba129f593321aeb20d30c5c2e7b8c3074e44717e7765c66bd",
|
||||
"container": false
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -9,6 +9,7 @@ internal class EquivalentCameraCalibration(private val target: EquivalentCameraT
|
||||
|
||||
private fun targetProfile(context: Context): DcpProfile = bundledProfile ?: synchronized(this) {
|
||||
bundledProfile ?: when (target) {
|
||||
EquivalentCameraTarget.LeicaM9 -> LeicaProfile.calibrationProfile(context)
|
||||
EquivalentCameraTarget.LumixS9 -> {
|
||||
val info = requireNotNull(DcpManager(context).getAvailableDcps().firstOrNull {
|
||||
it.isBuiltIn && it.filePath == target.assetPath
|
||||
@@ -100,7 +101,8 @@ internal class EquivalentCameraCalibration(private val target: EquivalentCameraT
|
||||
internal enum class EquivalentCameraTarget(val assetPath: String) {
|
||||
LumixS9("dcp/Panasonic DC-S9 Adobe Standard.dcp"),
|
||||
HasselbladX2DII100C("hncs/x2d_ii_100c_calibration.json"),
|
||||
CanonEOSR5("canon/eos_r5/calibration.json");
|
||||
CanonEOSR5("canon/eos_r5/calibration.json"),
|
||||
LeicaM9("leica/m9/PROCESS/LUTS.bin");
|
||||
|
||||
val calibration by lazy { EquivalentCameraCalibration(this) }
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
package com.hinnka.mycamera.raw
|
||||
|
||||
import android.content.Context
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
import java.security.MessageDigest
|
||||
|
||||
/** M9 1.216 matrix/LUT recipe. Spatial processing and source calibration remain upstream. */
|
||||
internal data class LeicaRenderPlan(
|
||||
val tables: FloatArray,
|
||||
/** Two row-major signed integer matrices consumed by ASMExecuteColorMatrix_10. */
|
||||
val redAtLeastGreenMatrix: IntArray,
|
||||
val redBelowGreenMatrix: IntArray,
|
||||
val curveIndex: Int,
|
||||
)
|
||||
|
||||
internal object LeicaProfile {
|
||||
const val TABLE_WIDTH = 1024
|
||||
const val TABLE_HEIGHT = 2
|
||||
private const val ASSET = "leica/m9/PROCESS/LUTS.bin"
|
||||
private const val SHA256 = "25debaf581d3fdbeca6ad7c6426ca5d9e597b98856c540ceddcc912b79409d8d"
|
||||
// M9 sRGB, standard saturation/contrast. Shared editor adjustments follow the engine.
|
||||
private const val COLOR_SPACE = 0
|
||||
private const val SATURATION = 2
|
||||
private const val CONTRAST = 2
|
||||
private data class Profile(val renderPlan: LeicaRenderPlan, val calibration: DcpProfile)
|
||||
@Volatile private var cached: Profile? = null
|
||||
|
||||
// Source ISO does not identify M9 capture modes; always use the normal curve.
|
||||
fun createRenderPlan(context: Context): LeicaRenderPlan = profile(context).renderPlan
|
||||
|
||||
fun calibrationProfile(context: Context): DcpProfile = profile(context).calibration
|
||||
|
||||
private fun profile(context: Context): Profile = cached ?: synchronized(this) {
|
||||
cached ?: decode(context.assets.open(ASSET).use { it.readBytes() }).also { cached = it }
|
||||
}
|
||||
|
||||
private fun decode(bytes: ByteArray): Profile {
|
||||
require(bytes.size == 427744)
|
||||
require(MessageDigest.getInstance("SHA-256").digest(bytes)
|
||||
.joinToString("") { "%02x".format(it.toInt() and 255) } == SHA256) {
|
||||
"Leica M9 LUT asset checksum mismatch"
|
||||
}
|
||||
val data = ByteBuffer.wrap(bytes).order(ByteOrder.LITTLE_ENDIAN)
|
||||
require(data.getInt(0) == 13 && data.getInt(0x18) == 20 && data.getInt(0x1c) == 2048)
|
||||
require(data.getInt(0x54) == 2 && data.getInt(0x58) == 5 && data.getInt(0x5c) == 5)
|
||||
val curveOffset = data.getInt(4)
|
||||
val matrixOffset = data.getInt(8)
|
||||
val calibrationOffset = data.getInt(12)
|
||||
require(curveOffset == 0xcf8 && matrixOffset == 0xb44 && calibrationOffset == 0xcd0)
|
||||
require(matrixOffset + 11 * 36 == calibrationOffset && calibrationOffset + 40 == curveOffset)
|
||||
require(curveOffset + 20 * 2048 == data.getInt(0x10))
|
||||
val matrixIndex = COLOR_SPACE * 5 + SATURATION
|
||||
fun matrix(branch: Int) = IntArray(9) {
|
||||
data.getShort(matrixOffset + matrixIndex * 36 + branch * 18 + it * 2).toInt()
|
||||
}.also { coefficients ->
|
||||
// 14-bit input and signed coefficients must fit the shader's 32-bit sums.
|
||||
for (row in 0..2) require((0..2).sumOf {
|
||||
kotlin.math.abs(coefficients[row * 3 + it]).toLong() * 16383L
|
||||
} <= Int.MAX_VALUE)
|
||||
}
|
||||
val firstMatrix = matrix(0)
|
||||
val secondMatrix = matrix(1)
|
||||
val curveIndex = COLOR_SPACE * 5 + CONTRAST
|
||||
val table = FloatArray(2048) {
|
||||
(bytes[curveOffset + curveIndex * 2048 + it].toInt() and 255) / 255f
|
||||
}
|
||||
require(table.first() == 0f && table.last() == 1f)
|
||||
require((1 until table.size).all { table[it] >= table[it - 1] })
|
||||
val renderPlan = LeicaRenderPlan(table, firstMatrix, secondMatrix, curveIndex)
|
||||
// Two illuminant + 9 signed /10000 ColorMatrix records in DNG row-major order.
|
||||
fun calibrationMatrix(slot: Int) = FloatArray(9) {
|
||||
data.getShort(calibrationOffset + slot * 20 + 2 + it * 2) / 10000f
|
||||
}
|
||||
require(data.getShort(calibrationOffset).toInt() == 17)
|
||||
require(data.getShort(calibrationOffset + 20).toInt() == 21)
|
||||
val calibration = RawCameraCalibration(
|
||||
colorMatrix1 = calibrationMatrix(0),
|
||||
colorMatrix2 = calibrationMatrix(1),
|
||||
calibrationIlluminant1 = 17,
|
||||
calibrationIlluminant2 = 21,
|
||||
).toDcpProfile("Leica M9 firmware calibration")
|
||||
return Profile(renderPlan, calibration)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,127 @@
|
||||
package com.hinnka.mycamera.raw
|
||||
|
||||
import android.opengl.GLES30
|
||||
import java.nio.ByteBuffer
|
||||
import java.nio.ByteOrder
|
||||
|
||||
/** M9 DSP matrix/lookup stage; see docs/leica-rendering.md for the normalized input boundary. */
|
||||
internal object LeicaToneShader {
|
||||
val DEFINITION = RawEngineToneShaderDefinition(
|
||||
engineUniforms = """
|
||||
uniform highp sampler2D uLeicaTables;
|
||||
uniform highp ivec3 uLeicaRedAtLeastGreenMatrix[3];
|
||||
uniform highp ivec3 uLeicaRedBelowGreenMatrix[3];
|
||||
""".trimIndent(),
|
||||
engineFunctions = """
|
||||
int leicaMatrixIndex(ivec3 coefficients, ivec3 camera) {
|
||||
int value = coefficients.r * camera.r + coefficients.g * camera.g
|
||||
+ coefficients.b * camera.b;
|
||||
// Signed high word of the DSP integer MAC, then 11-bit clipping.
|
||||
return clamp(value >> 16, 0, 2047);
|
||||
}
|
||||
|
||||
float leicaLookup(int index) {
|
||||
// Original byte lookup; the DSP does not interpolate adjacent entries.
|
||||
return texelFetch(uLeicaTables, ivec2(index % 1024, index / 1024), 0).r;
|
||||
}
|
||||
|
||||
vec3 applyEngineTone(vec3 color) {
|
||||
// Input is calibrated, white-balanced M9 RGB after shared PGTM/exposure.
|
||||
// Host normalized black/white maps to the DSP's 14-bit input domain.
|
||||
ivec3 camera = ivec3(floor(clamp(color, 0.0, 1.0) * 16383.0));
|
||||
ivec3 indices;
|
||||
if (camera.r >= camera.g) {
|
||||
indices = ivec3(leicaMatrixIndex(uLeicaRedAtLeastGreenMatrix[0], camera),
|
||||
leicaMatrixIndex(uLeicaRedAtLeastGreenMatrix[1], camera),
|
||||
leicaMatrixIndex(uLeicaRedAtLeastGreenMatrix[2], camera));
|
||||
} else {
|
||||
indices = ivec3(leicaMatrixIndex(uLeicaRedBelowGreenMatrix[0], camera),
|
||||
leicaMatrixIndex(uLeicaRedBelowGreenMatrix[1], camera),
|
||||
leicaMatrixIndex(uLeicaRedBelowGreenMatrix[2], camera));
|
||||
}
|
||||
vec3 encodedSrgb = vec3(leicaLookup(indices.r), leicaLookup(indices.g),
|
||||
leicaLookup(indices.b));
|
||||
// Shared adjustments require linear sRGB and the output pass encodes once.
|
||||
bvec3 high = greaterThan(encodedSrgb, vec3(0.04045));
|
||||
vec3 low = encodedSrgb / 12.92;
|
||||
vec3 upper = pow((encodedSrgb + 0.055) / 1.055, vec3(2.4));
|
||||
return vec3(high.r ? upper.r : low.r, high.g ? upper.g : low.g,
|
||||
high.b ? upper.b : low.b);
|
||||
}
|
||||
""".trimIndent(),
|
||||
)
|
||||
}
|
||||
|
||||
internal class LeicaToneAlgorithm(quad: RawFullscreenQuad) :
|
||||
RawRenderingEngineToneAlgorithm(quad, LeicaToneShader.DEFINITION) {
|
||||
private var texture = 0
|
||||
private var uploadedTables: FloatArray? = null
|
||||
|
||||
override fun bindEngineResources(program: Int, input: RawEngineTonePass.Input) {
|
||||
super.bindEngineResources(program, input)
|
||||
val plan = requireNotNull(input.leicaRenderPlan) { "Leica requires an M9 render plan" }
|
||||
ensureTexture(plan.tables)
|
||||
GLES30.glActiveTexture(GLES30.GL_TEXTURE0 + TEXTURE_UNIT)
|
||||
GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, texture)
|
||||
GLES30.glUniform1i(GLES30.glGetUniformLocation(program, "uLeicaTables"), TEXTURE_UNIT)
|
||||
GLES30.glUniform3iv(GLES30.glGetUniformLocation(program, "uLeicaRedAtLeastGreenMatrix[0]"),
|
||||
3, plan.redAtLeastGreenMatrix, 0)
|
||||
GLES30.glUniform3iv(GLES30.glGetUniformLocation(program, "uLeicaRedBelowGreenMatrix[0]"),
|
||||
3, plan.redBelowGreenMatrix, 0)
|
||||
GLES30.glActiveTexture(GLES30.GL_TEXTURE0)
|
||||
RawGlesProgram.logErrors("LeicaToneAlgorithm.bindEngineResources")
|
||||
}
|
||||
|
||||
private fun ensureTexture(tables: FloatArray) {
|
||||
if (texture != 0 && uploadedTables === tables) return
|
||||
require(tables.size == LeicaProfile.TABLE_WIDTH * LeicaProfile.TABLE_HEIGHT)
|
||||
releaseEngineResources()
|
||||
val limit = IntArray(1)
|
||||
GLES30.glGetIntegerv(GLES30.GL_MAX_TEXTURE_IMAGE_UNITS, limit, 0)
|
||||
check(limit[0] > TEXTURE_UNIT) { "Leica texture unit unavailable" }
|
||||
GLES30.glGetIntegerv(GLES30.GL_MAX_TEXTURE_SIZE, limit, 0)
|
||||
check(limit[0] >= LeicaProfile.TABLE_WIDTH) { "Leica table texture exceeds GL limit" }
|
||||
val unpackAlignment = IntArray(1)
|
||||
GLES30.glGetIntegerv(GLES30.GL_UNPACK_ALIGNMENT, unpackAlignment, 0)
|
||||
try {
|
||||
val names = IntArray(1)
|
||||
GLES30.glGenTextures(1, names, 0)
|
||||
texture = names[0]
|
||||
check(texture != 0) { "Unable to allocate Leica table texture" }
|
||||
val buffer = ByteBuffer.allocateDirect(tables.size * Float.SIZE_BYTES)
|
||||
.order(ByteOrder.nativeOrder()).asFloatBuffer()
|
||||
buffer.put(tables).position(0)
|
||||
GLES30.glActiveTexture(GLES30.GL_TEXTURE0 + TEXTURE_UNIT)
|
||||
GLES30.glBindTexture(GLES30.GL_TEXTURE_2D, texture)
|
||||
GLES30.glPixelStorei(GLES30.GL_UNPACK_ALIGNMENT, 1)
|
||||
GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_MIN_FILTER, GLES30.GL_NEAREST)
|
||||
GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_MAG_FILTER, GLES30.GL_NEAREST)
|
||||
GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_S, GLES30.GL_CLAMP_TO_EDGE)
|
||||
GLES30.glTexParameteri(GLES30.GL_TEXTURE_2D, GLES30.GL_TEXTURE_WRAP_T, GLES30.GL_CLAMP_TO_EDGE)
|
||||
GLES30.glTexStorage2D(GLES30.GL_TEXTURE_2D, 1, GLES30.GL_R32F,
|
||||
LeicaProfile.TABLE_WIDTH, LeicaProfile.TABLE_HEIGHT)
|
||||
GLES30.glTexSubImage2D(GLES30.GL_TEXTURE_2D, 0, 0, 0,
|
||||
LeicaProfile.TABLE_WIDTH, LeicaProfile.TABLE_HEIGHT, GLES30.GL_RED, GLES30.GL_FLOAT, buffer)
|
||||
val error = GLES30.glGetError()
|
||||
check(error == GLES30.GL_NO_ERROR) { "Leica table upload failed: GL error=$error" }
|
||||
uploadedTables = tables
|
||||
} catch (error: Throwable) {
|
||||
releaseEngineResources()
|
||||
throw error
|
||||
} finally {
|
||||
GLES30.glPixelStorei(GLES30.GL_UNPACK_ALIGNMENT, unpackAlignment[0])
|
||||
GLES30.glActiveTexture(GLES30.GL_TEXTURE0)
|
||||
}
|
||||
}
|
||||
|
||||
override fun releaseEngineResources() {
|
||||
if (texture != 0) GLES30.glDeleteTextures(1, intArrayOf(texture), 0)
|
||||
texture = 0
|
||||
uploadedTables = null
|
||||
}
|
||||
|
||||
private companion object {
|
||||
// PGTM uses 7 and HDR reference uses 2/4; GLES 3 guarantees 16 fragment units.
|
||||
const val TEXTURE_UNIT = 10
|
||||
}
|
||||
}
|
||||
@@ -523,6 +523,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = null,
|
||||
canonRenderPlan = null,
|
||||
fujiRenderPlan = if (warmupColorEngine.isFuji) FujiProfile.createRenderPlan(context, FujiFilmSimulation.Provia) else null,
|
||||
leicaRenderPlan = if (warmupColorEngine.isLeica) LeicaProfile.createRenderPlan(context) else null,
|
||||
colorEngine = warmupColorEngine,
|
||||
profileToEngineTransform = identityMatrix3x3(),
|
||||
profileExposureUniforms = ProfileExposureUniforms.NEUTRAL,
|
||||
@@ -1578,6 +1579,7 @@ class RawDemosaicProcessor {
|
||||
val lumixRenderPlan: LumixRenderPlan?,
|
||||
val canonRenderPlan: CanonRenderPlan?,
|
||||
val fujiRenderPlan: FujiRenderPlan?,
|
||||
val leicaRenderPlan: LeicaRenderPlan?,
|
||||
val engineWorkingColorSpace: ColorSpace,
|
||||
val profileToEngineTransform: FloatArray,
|
||||
val shadowsHighlightsParams: ShadowsHighlightsParams,
|
||||
@@ -2374,6 +2376,7 @@ class RawDemosaicProcessor {
|
||||
requestedColorEngine.isLumix -> EquivalentCameraTarget.LumixS9
|
||||
requestedColorEngine.isHncs -> EquivalentCameraTarget.HasselbladX2DII100C
|
||||
requestedColorEngine.isCanon -> EquivalentCameraTarget.CanonEOSR5
|
||||
requestedColorEngine.isLeica -> EquivalentCameraTarget.LeicaM9
|
||||
else -> null
|
||||
}
|
||||
var embeddedDngRenderPlan: DcpRenderPlan? = sourceDngRenderPlan
|
||||
@@ -3070,6 +3073,17 @@ class RawDemosaicProcessor {
|
||||
"photonHdr=${normalizedToneMappingParameters.usePhotonHdr}")
|
||||
}
|
||||
} else null
|
||||
val leicaRenderPlan = if (colorEngine.isLeica) {
|
||||
check(dngFile != null || actualMetadata.cameraCalibration != null) {
|
||||
"Leica M9 requires fixed source ColorMatrix calibration for camera capture"
|
||||
}
|
||||
LeicaProfile.createRenderPlan(context).also {
|
||||
PLog.i(TAG, "Leica M9 DSP: input=wb-camera-rgb output=linear-sRGB " +
|
||||
"curve=${it.curveIndex} " +
|
||||
"matrix=2 branch=R>=G contrast=2 saturation=2 localMapping=shared-PGTM " +
|
||||
"photonHdr=${normalizedToneMappingParameters.usePhotonHdr}")
|
||||
}
|
||||
} else null
|
||||
val canonRenderPlan = if (colorEngine.isCanon) {
|
||||
check(profileWorkingColorSpace == ColorSpace.ProPhoto)
|
||||
check(dngFile != null || actualMetadata.cameraCalibration != null) {
|
||||
@@ -3815,6 +3829,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = lumixRenderPlan,
|
||||
canonRenderPlan = canonRenderPlan,
|
||||
fujiRenderPlan = fujiRenderPlan,
|
||||
leicaRenderPlan = leicaRenderPlan,
|
||||
engineWorkingColorSpace = engineWorkingColorSpace,
|
||||
profileToEngineTransform = profileToEngineTransform,
|
||||
shadowsHighlightsParams = shadowsHighlightsParams,
|
||||
@@ -3999,6 +4014,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = lumixRenderPlan,
|
||||
canonRenderPlan = canonRenderPlan,
|
||||
fujiRenderPlan = fujiRenderPlan,
|
||||
leicaRenderPlan = leicaRenderPlan,
|
||||
colorEngine = colorEngine,
|
||||
outputWorkingColorSpace = engineWorkingColorSpace,
|
||||
profileToEngineTransform = combinedProfileToEngineTransform,
|
||||
@@ -4030,6 +4046,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = lumixRenderPlan,
|
||||
canonRenderPlan = canonRenderPlan,
|
||||
fujiRenderPlan = fujiRenderPlan,
|
||||
leicaRenderPlan = leicaRenderPlan,
|
||||
colorEngine = colorEngine,
|
||||
outputWorkingColorSpace = engineWorkingColorSpace,
|
||||
profileToEngineTransform = combinedProfileToEngineTransform,
|
||||
@@ -4240,6 +4257,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = lumixRenderPlan,
|
||||
canonRenderPlan = canonRenderPlan,
|
||||
fujiRenderPlan = fujiRenderPlan,
|
||||
leicaRenderPlan = leicaRenderPlan,
|
||||
colorEngine = colorEngine,
|
||||
outputWorkingColorSpace = engineWorkingColorSpace,
|
||||
profileToEngineTransform = profileToEngineTransform,
|
||||
@@ -4603,6 +4621,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = config.lumixRenderPlan,
|
||||
canonRenderPlan = config.canonRenderPlan,
|
||||
fujiRenderPlan = config.fujiRenderPlan,
|
||||
leicaRenderPlan = config.leicaRenderPlan,
|
||||
colorEngine = config.colorEngine,
|
||||
outputWorkingColorSpace = config.engineWorkingColorSpace,
|
||||
profileToEngineTransform = config.profileToEngineTransform,
|
||||
@@ -4641,6 +4660,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = config.lumixRenderPlan,
|
||||
canonRenderPlan = config.canonRenderPlan,
|
||||
fujiRenderPlan = config.fujiRenderPlan,
|
||||
leicaRenderPlan = config.leicaRenderPlan,
|
||||
colorEngine = config.colorEngine,
|
||||
outputWorkingColorSpace = config.engineWorkingColorSpace,
|
||||
profileToEngineTransform = config.profileToEngineTransform,
|
||||
@@ -7075,6 +7095,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan: LumixRenderPlan? = null,
|
||||
canonRenderPlan: CanonRenderPlan? = null,
|
||||
fujiRenderPlan: FujiRenderPlan? = null,
|
||||
leicaRenderPlan: LeicaRenderPlan? = null,
|
||||
colorEngine: RawRenderingEngine = RawRenderingEngine.AdobeCurve,
|
||||
outputWorkingColorSpace: ColorSpace = ColorSpace.ProPhoto,
|
||||
profileToEngineTransform: FloatArray = identityMatrix3x3(),
|
||||
@@ -7104,6 +7125,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = lumixRenderPlan,
|
||||
canonRenderPlan = canonRenderPlan,
|
||||
fujiRenderPlan = fujiRenderPlan,
|
||||
leicaRenderPlan = leicaRenderPlan,
|
||||
colorEngine = colorEngine,
|
||||
profileToEngineTransform = profileToEngineTransform,
|
||||
profileExposureUniforms = profileExposureUniforms,
|
||||
@@ -7224,6 +7246,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan: LumixRenderPlan?,
|
||||
canonRenderPlan: CanonRenderPlan?,
|
||||
fujiRenderPlan: FujiRenderPlan?,
|
||||
leicaRenderPlan: LeicaRenderPlan?,
|
||||
colorEngine: RawRenderingEngine,
|
||||
profileToEngineTransform: FloatArray,
|
||||
profileExposureUniforms: ProfileExposureUniforms,
|
||||
@@ -7266,6 +7289,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = lumixRenderPlan,
|
||||
canonRenderPlan = canonRenderPlan,
|
||||
fujiRenderPlan = fujiRenderPlan,
|
||||
leicaRenderPlan = leicaRenderPlan,
|
||||
bindProfileGainTable = { program ->
|
||||
if (metadata != null) {
|
||||
bindProfileGainTableMap(
|
||||
@@ -7676,6 +7700,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan: LumixRenderPlan?,
|
||||
canonRenderPlan: CanonRenderPlan?,
|
||||
fujiRenderPlan: FujiRenderPlan?,
|
||||
leicaRenderPlan: LeicaRenderPlan?,
|
||||
colorEngine: RawRenderingEngine,
|
||||
outputWorkingColorSpace: ColorSpace,
|
||||
profileToEngineTransform: FloatArray,
|
||||
@@ -7740,6 +7765,7 @@ class RawDemosaicProcessor {
|
||||
lumixRenderPlan = lumixRenderPlan,
|
||||
canonRenderPlan = canonRenderPlan,
|
||||
fujiRenderPlan = fujiRenderPlan,
|
||||
leicaRenderPlan = leicaRenderPlan,
|
||||
bindProfileGainTable = { program ->
|
||||
bindProfileGainTableMap(
|
||||
program = program,
|
||||
|
||||
@@ -33,6 +33,7 @@ internal class RawEngineTonePass(
|
||||
val lumixRenderPlan: LumixRenderPlan? = null,
|
||||
val canonRenderPlan: CanonRenderPlan? = null,
|
||||
val fujiRenderPlan: FujiRenderPlan? = null,
|
||||
val leicaRenderPlan: LeicaRenderPlan? = null,
|
||||
val bindProfileGainTable: (program: Int) -> Unit,
|
||||
)
|
||||
|
||||
@@ -54,6 +55,7 @@ internal class RawEngineTonePass(
|
||||
private val lumixAlgorithm = LumixToneAlgorithm(quad)
|
||||
private val canonAlgorithm = CanonToneAlgorithm(quad)
|
||||
private val fujiAlgorithm = FujiToneAlgorithm(quad)
|
||||
private val leicaAlgorithm = LeicaToneAlgorithm(quad)
|
||||
|
||||
fun render(input: Input): Output? = algorithmFor(input.colorEngine).render(input)
|
||||
|
||||
@@ -79,6 +81,7 @@ internal class RawEngineTonePass(
|
||||
lumixAlgorithm.release()
|
||||
canonAlgorithm.release()
|
||||
fujiAlgorithm.release()
|
||||
leicaAlgorithm.release()
|
||||
dcpTextures.release()
|
||||
curveTextures.release()
|
||||
}
|
||||
@@ -94,6 +97,7 @@ internal class RawEngineTonePass(
|
||||
RawRenderingEngine.Lumix -> lumixAlgorithm
|
||||
RawRenderingEngine.Canon -> canonAlgorithm
|
||||
RawRenderingEngine.Fuji -> fujiAlgorithm
|
||||
RawRenderingEngine.Leica -> leicaAlgorithm
|
||||
}
|
||||
}
|
||||
|
||||
@@ -319,6 +323,7 @@ internal class RawEngineTonePass(
|
||||
RawRenderingEngine.Lumix -> LumixToneShader.DEFINITION
|
||||
RawRenderingEngine.Canon -> CanonToneShader.DEFINITION
|
||||
RawRenderingEngine.Fuji -> FujiToneShader.DEFINITION
|
||||
RawRenderingEngine.Leica -> LeicaToneShader.DEFINITION
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -47,6 +47,13 @@ enum class RawRenderingEngine(
|
||||
defaultExposureCompensationEv = 0f,
|
||||
exposureCompensationDomain = RawExposureCompensationDomain.Linear
|
||||
),
|
||||
Leica(
|
||||
shaderId = 10,
|
||||
// Output/adjustment space; M9's matrix/LUT stage consumes WB camera RGB.
|
||||
workingColorSpace = ColorSpace.SRGB,
|
||||
defaultExposureCompensationEv = 0f,
|
||||
exposureCompensationDomain = RawExposureCompensationDomain.Linear
|
||||
),
|
||||
AgX(
|
||||
shaderId = 1,
|
||||
workingColorSpace = ColorSpace.BT2020,
|
||||
@@ -85,8 +92,11 @@ enum class RawRenderingEngine(
|
||||
val isFuji: Boolean
|
||||
get() = this == Fuji
|
||||
|
||||
val isLeica: Boolean
|
||||
get() = this == Leica
|
||||
|
||||
val usesCameraInputDomain: Boolean
|
||||
get() = isLumix || isHncs || isCanon
|
||||
get() = isLumix || isHncs || isCanon || isLeica
|
||||
|
||||
companion object {
|
||||
fun fromPersistedName(
|
||||
|
||||
@@ -24,7 +24,7 @@ data class RawToneMappingParameters(
|
||||
fun colorMatchingEnabled(engine: RawRenderingEngine): Boolean = when {
|
||||
engine.isLumix -> lumixColorMatchingEnabled
|
||||
engine.isHncs -> hncsColorMatchingEnabled
|
||||
engine.isCanon -> true
|
||||
engine.isCanon || engine.isLeica -> true
|
||||
else -> false
|
||||
}
|
||||
|
||||
|
||||
@@ -996,7 +996,8 @@ private fun RawToneMappingControls(
|
||||
RawRenderingEngine.Hncs,
|
||||
RawRenderingEngine.Lumix,
|
||||
RawRenderingEngine.Canon,
|
||||
RawRenderingEngine.Fuji -> Unit
|
||||
RawRenderingEngine.Fuji,
|
||||
RawRenderingEngine.Leica -> Unit
|
||||
|
||||
RawRenderingEngine.AgX -> {
|
||||
SliderSettingItem(
|
||||
@@ -1374,6 +1375,7 @@ private fun rawRenderingEngineName(engine: RawRenderingEngine): String {
|
||||
RawRenderingEngine.Lumix -> stringResource(R.string.settings_raw_color_engine_lumix)
|
||||
RawRenderingEngine.Canon -> stringResource(R.string.settings_raw_color_engine_canon)
|
||||
RawRenderingEngine.Fuji -> stringResource(R.string.settings_raw_color_engine_fuji)
|
||||
RawRenderingEngine.Leica -> stringResource(R.string.settings_raw_color_engine_leica)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1389,6 +1391,7 @@ private fun rawColorEngineDescription(engine: RawRenderingEngine): String {
|
||||
RawRenderingEngine.Lumix -> stringResource(R.string.settings_raw_color_engine_lumix_description)
|
||||
RawRenderingEngine.Canon -> stringResource(R.string.settings_raw_color_engine_canon_description)
|
||||
RawRenderingEngine.Fuji -> stringResource(R.string.settings_raw_color_engine_fuji_description)
|
||||
RawRenderingEngine.Leica -> stringResource(R.string.settings_raw_color_engine_leica_description)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -475,6 +475,7 @@ fun PresetEditorScreen(
|
||||
RawRenderingEngine.Lumix -> stringResource(R.string.settings_raw_color_engine_lumix)
|
||||
RawRenderingEngine.Canon -> stringResource(R.string.settings_raw_color_engine_canon)
|
||||
RawRenderingEngine.Fuji -> stringResource(R.string.settings_raw_color_engine_fuji)
|
||||
RawRenderingEngine.Leica -> stringResource(R.string.settings_raw_color_engine_leica)
|
||||
RawRenderingEngine.Hncs -> stringResource(
|
||||
R.string.settings_raw_color_engine_hncs
|
||||
)
|
||||
|
||||
@@ -1288,4 +1288,6 @@
|
||||
<string name="settings_raw_fuji_film_simulation">軟片模擬</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">選擇 Fuji 軟片模擬,預設為 PROVIA。</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">根據韌體資料調整的軟片模擬,呈現效果為近似實作。</string>
|
||||
<string name="settings_raw_color_engine_leica">徠卡 M9</string>
|
||||
<string name="settings_raw_color_engine_leica_description">徠卡 M9 色彩與色調。</string>
|
||||
</resources>
|
||||
@@ -349,4 +349,5 @@
|
||||
<string name="settings_raw_fuji_film_simulation">Filmsimulation</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">Fuji Filmsimulation wählen. PROVIA ist die Standardeinstellung.</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">Filmsimulation auf Basis von Firmware-Daten mit angenäherter Wiedergabe.</string>
|
||||
<string name="settings_raw_color_engine_leica_description">Farben und Tonwerte der Leica M9.</string>
|
||||
</resources>
|
||||
@@ -349,4 +349,5 @@
|
||||
<string name="settings_raw_fuji_film_simulation">Simulation de film</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">Choisissez une simulation de film Fuji. PROVIA est le réglage par défaut.</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">Simulation de film adaptée des données du firmware, avec un rendu approximatif.</string>
|
||||
<string name="settings_raw_color_engine_leica_description">Couleurs et tonalités du Leica M9.</string>
|
||||
</resources>
|
||||
@@ -349,4 +349,5 @@
|
||||
<string name="settings_raw_fuji_film_simulation">Simulasi film</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">Pilih simulasi film Fuji. PROVIA adalah pilihan default.</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">Simulasi film yang diadaptasi dari data firmware, dengan hasil yang mendekati aslinya.</string>
|
||||
<string name="settings_raw_color_engine_leica_description">Warna dan tonal Leica M9.</string>
|
||||
</resources>
|
||||
@@ -1174,4 +1174,5 @@
|
||||
<string name="settings_raw_fuji_film_simulation">フィルムシミュレーション</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">Fuji フィルムシミュレーションを選択します。初期設定は PROVIA です。</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">ファームウェアのデータを基にしたフィルムシミュレーションです。描画は近似再現です。</string>
|
||||
<string name="settings_raw_color_engine_leica_description">Leica M9 の色と階調。</string>
|
||||
</resources>
|
||||
@@ -350,4 +350,5 @@
|
||||
<string name="settings_raw_fuji_film_simulation">필름 시뮬레이션</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">Fuji 필름 시뮬레이션을 선택하세요. 기본값은 PROVIA입니다.</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">펌웨어 데이터를 바탕으로 필름 시뮬레이션을 근사 재현합니다.</string>
|
||||
<string name="settings_raw_color_engine_leica_description">Leica M9의 색상과 계조.</string>
|
||||
</resources>
|
||||
@@ -350,4 +350,5 @@
|
||||
<string name="settings_raw_fuji_film_simulation">Simulação de filme</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">Escolha uma simulação de filme Fuji. PROVIA é a opção padrão.</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">Simulação de filme adaptada de dados do firmware, com renderização aproximada.</string>
|
||||
<string name="settings_raw_color_engine_leica_description">Cores e tonalidade da Leica M9.</string>
|
||||
</resources>
|
||||
@@ -972,4 +972,5 @@
|
||||
<string name="settings_raw_fuji_film_simulation">การจำลองฟิล์ม</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">เลือกการจำลองฟิล์ม Fuji โดยมี PROVIA เป็นค่าเริ่มต้น</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">การจำลองฟิล์มที่ดัดแปลงจากข้อมูลเฟิร์มแวร์ โดยแสดงผลแบบประมาณค่า</string>
|
||||
<string name="settings_raw_color_engine_leica_description">สีและโทนภาพแบบ Leica M9</string>
|
||||
</resources>
|
||||
@@ -1344,4 +1344,6 @@
|
||||
<string name="settings_raw_fuji_film_simulation">胶片模拟</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">选择 Fuji 胶片模拟,默认为 PROVIA。</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">基于固件数据适配的胶片模拟,渲染效果为近似实现。</string>
|
||||
<string name="settings_raw_color_engine_leica">徕卡 M9</string>
|
||||
<string name="settings_raw_color_engine_leica_description">徕卡 M9 色彩与调性。</string>
|
||||
</resources>
|
||||
@@ -1284,4 +1284,6 @@
|
||||
<string name="settings_raw_fuji_film_simulation">菲林模擬</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">選擇 Fuji 菲林模擬,預設為 PROVIA。</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">根據韌體資料調整的菲林模擬,呈現效果為近似實作。</string>
|
||||
<string name="settings_raw_color_engine_leica">徠卡 M9</string>
|
||||
<string name="settings_raw_color_engine_leica_description">徠卡 M9 色彩與色調。</string>
|
||||
</resources>
|
||||
@@ -1288,4 +1288,6 @@
|
||||
<string name="settings_raw_fuji_film_simulation">軟片模擬</string>
|
||||
<string name="settings_raw_fuji_film_simulation_description">選擇 Fuji 軟片模擬,預設為 PROVIA。</string>
|
||||
<string name="settings_raw_color_engine_fuji_description">根據韌體資料調整的軟片模擬,呈現效果為近似實作。</string>
|
||||
<string name="settings_raw_color_engine_leica">徠卡 M9</string>
|
||||
<string name="settings_raw_color_engine_leica_description">徠卡 M9 色彩與色調。</string>
|
||||
</resources>
|
||||
@@ -1375,4 +1375,6 @@
|
||||
<string name="settings_raw_fuji_style_classic_negative" translatable="false">Classic Negative</string>
|
||||
<string name="settings_raw_fuji_style_nostalgic_neg" translatable="false">Nostalgic Neg</string>
|
||||
<string name="settings_raw_fuji_style_reala_ace" translatable="false">Reala Ace</string>
|
||||
<string name="settings_raw_color_engine_leica">Leica M9</string>
|
||||
<string name="settings_raw_color_engine_leica_description">Leica M9 color and tone.</string>
|
||||
</resources>
|
||||
Reference in new issue
Block a user