PDAF patterns ignored in user's camconst, #4435

This commit is contained in:
heckflosse 2018-03-10 12:18:56 +01:00
parent c556e026f1
commit 64979b0660
3 changed files with 27 additions and 5 deletions

View File

@ -380,10 +380,28 @@ CameraConst::has_pdafPattern()
return pdafPattern.size() > 0;
}
void
CameraConst::get_pdafPattern(std::vector<int> &pattern)
std::vector<int>
CameraConst::get_pdafPattern()
{
pattern = pdafPattern;
return pdafPattern;
}
void
CameraConst::update_pdafPattern(const std::vector<int> &other)
{
if (other.empty()) {
return;
}
pdafPattern = other;
}
void
CameraConst::update_pdafOffset(int other)
{
if (other == 0) {
return;
}
pdafOffset = other;
}
bool
@ -719,6 +737,8 @@ CameraConstantsStore::parse_camera_constants_file(Glib::ustring filename_)
// deleting all the existing levels, replaced by the new ones
existingcc->update_Levels(cc);
existingcc->update_Crop(cc);
existingcc->update_pdafPattern(cc->get_pdafPattern());
existingcc->update_pdafOffset(cc->get_pdafOffset());
if (settings->verbose) {
printf("Merging camera constants for \"%s\"\n", make_model.c_str());

View File

@ -37,7 +37,7 @@ public:
bool has_pdafPattern(void);
void update_dcrawMatrix(const short *other);
const short *get_dcrawMatrix(void);
void get_pdafPattern(std::vector<int> &pattern);
std::vector<int> get_pdafPattern();
int get_pdafOffset() {return pdafOffset;}
bool has_rawCrop(void);
void get_rawCrop(int& left_margin, int& top_margin, int& width, int& height);
@ -47,6 +47,8 @@ public:
int get_WhiteLevel(int idx, int iso_speed, float fnumber);
void update_Levels(const CameraConst *other);
void update_Crop(CameraConst *other);
void update_pdafPattern(const std::vector<int> &other);
void update_pdafOffset(int other);
};
class CameraConstantsStore

View File

@ -134,7 +134,7 @@ PDAFLinesFilter::PDAFLinesFilter(RawImage *ri):
CameraConst *cc = ccs->get(ri_->get_maker().c_str(), ri_->get_model().c_str());
if (cc) {
cc->get_pdafPattern(pattern_);
pattern_ = cc->get_pdafPattern();
if(!pattern_.empty()) {
offset_ = cc->get_pdafOffset();
}