Raw-rs: use camera white balance when available (#1941)

* add new White Balance Tag

* merge raw_to_image step with demosiacing

* Use white balance from camera in scale colors step

* Nit

---------

Co-authored-by: Keavon Chambers <keavon@keavon.com>
This commit is contained in:
Elbert Ronnie
2024-09-02 18:39:01 +05:30
committed by GitHub
co-authored by Keavon Chambers
parent 444929adbf
commit 82ef5c83ae
11 changed files with 51 additions and 52 deletions
+1
View File
@@ -30,6 +30,7 @@ pub enum TagId {
JpegLength = 0x202,
SonyToneCurve = 0x7010,
BlackLevel = 0x7310,
WhiteBalanceRggbLevels = 0x7313,
CfaPatternDim = 0x828d,
CfaPattern = 0x828e,
ColorMatrix1 = 0xc621,
+11 -2
View File
@@ -1,4 +1,4 @@
use super::types::{Array, ConstArray, TagType, TypeByte, TypeIfd, TypeLong, TypeNumber, TypeSRational, TypeShort, TypeSonyToneCurve, TypeString};
use super::types::{Array, ConstArray, TagType, TypeByte, TypeIfd, TypeLong, TypeNumber, TypeSRational, TypeSShort, TypeShort, TypeSonyToneCurve, TypeString};
use super::{Ifd, TagId, TiffError, TiffRead};
use std::io::{Read, Seek};
@@ -27,6 +27,7 @@ pub struct JpegLength;
pub struct SonyDataOffset;
pub struct SonyToneCurve;
pub struct BlackLevel;
pub struct WhiteBalanceRggbLevels;
pub struct CfaPatternDim;
pub struct CfaPattern;
pub struct ColorMatrix1;
@@ -173,11 +174,19 @@ impl SimpleTag for SonyToneCurve {
}
impl SimpleTag for BlackLevel {
const ID: TagId = TagId::BlackLevel;
type Type = ConstArray<TypeShort, 4>;
const ID: TagId = TagId::BlackLevel;
const NAME: &'static str = "Black Level";
}
impl SimpleTag for WhiteBalanceRggbLevels {
type Type = ConstArray<TypeSShort, 4>;
const ID: TagId = TagId::WhiteBalanceRggbLevels;
const NAME: &'static str = "White Balance Levels (RGGB)";
}
pub trait Tag {
type Output;