reworked pixelshift code and temporary removed Fuji S5 dual frame support
This commit is contained in:
parent
6276b17be2
commit
89901f4b36
@ -138,7 +138,8 @@ void dfInfo::updateRawImage()
|
||||
std::list<Glib::ustring>::iterator iName = pathNames.begin();
|
||||
ri = new RawImage(*iName); // First file used also for extra pixels informations (width,height, shutter, filters etc.. )
|
||||
|
||||
if( ri->loadRaw(true)) {
|
||||
unsigned int imageNum = 0;
|
||||
if( ri->loadRaw(true, imageNum)) {
|
||||
delete ri;
|
||||
ri = nullptr;
|
||||
} else {
|
||||
@ -163,7 +164,7 @@ void dfInfo::updateRawImage()
|
||||
for( ++iName; iName != pathNames.end(); ++iName) {
|
||||
RawImage* temp = new RawImage(*iName);
|
||||
|
||||
if( !temp->loadRaw(true)) {
|
||||
if( !temp->loadRaw(true,imageNum)) {
|
||||
temp->compress_image(); //\ TODO would be better working on original, because is temporary
|
||||
nFiles++;
|
||||
|
||||
@ -199,8 +200,9 @@ void dfInfo::updateRawImage()
|
||||
}
|
||||
} else {
|
||||
ri = new RawImage(pathname);
|
||||
unsigned int imageNum = 0;
|
||||
|
||||
if( ri->loadRaw(true)) {
|
||||
if( ri->loadRaw(true,imageNum)) {
|
||||
delete ri;
|
||||
ri = nullptr;
|
||||
} else {
|
||||
@ -365,7 +367,8 @@ dfInfo* DFManager::addFileInfo (const Glib::ustring& filename, bool pool)
|
||||
}
|
||||
|
||||
RawImage ri (filename);
|
||||
int res = ri.loadRaw (false); // Read informations about shot
|
||||
unsigned int imageNum = 0;
|
||||
int res = ri.loadRaw (false, imageNum); // Read informations about shot
|
||||
|
||||
if (res != 0) {
|
||||
return nullptr;
|
||||
|
@ -130,8 +130,8 @@ void ffInfo::updateRawImage()
|
||||
if( !pathNames.empty() ) {
|
||||
std::list<Glib::ustring>::iterator iName = pathNames.begin();
|
||||
ri = new RawImage(*iName); // First file used also for extra pixels informations (width,height, shutter, filters etc.. )
|
||||
|
||||
if( ri->loadRaw(true)) {
|
||||
unsigned int imageNum = 0;
|
||||
if( ri->loadRaw(true, imageNum)) {
|
||||
delete ri;
|
||||
ri = nullptr;
|
||||
} else {
|
||||
@ -156,7 +156,7 @@ void ffInfo::updateRawImage()
|
||||
for( ++iName; iName != pathNames.end(); ++iName) {
|
||||
RawImage* temp = new RawImage(*iName);
|
||||
|
||||
if( !temp->loadRaw(true)) {
|
||||
if( !temp->loadRaw(true,imageNum)) {
|
||||
temp->compress_image(); //\ TODO would be better working on original, because is temporary
|
||||
nFiles++;
|
||||
|
||||
@ -192,8 +192,9 @@ void ffInfo::updateRawImage()
|
||||
}
|
||||
} else {
|
||||
ri = new RawImage(pathname);
|
||||
unsigned int imageNum = 0;
|
||||
|
||||
if( ri->loadRaw(true)) {
|
||||
if( ri->loadRaw(true, imageNum)) {
|
||||
delete ri;
|
||||
ri = nullptr;
|
||||
} else {
|
||||
@ -326,7 +327,8 @@ ffInfo* FFManager::addFileInfo (const Glib::ustring& filename, bool pool)
|
||||
|
||||
|
||||
RawImage ri (filename);
|
||||
int res = ri.loadRaw (false); // Read informations about shot
|
||||
unsigned int imageNum = 0;
|
||||
int res = ri.loadRaw (false, imageNum); // Read informations about shot
|
||||
|
||||
if (res != 0) {
|
||||
return nullptr;
|
||||
|
@ -80,6 +80,9 @@ public:
|
||||
|
||||
virtual bool IsrgbSourceModified() const = 0; // tracks whether cached rgb output of demosaic has been modified
|
||||
|
||||
virtual void setCurrentFrame(unsigned int frameNum) = 0;
|
||||
|
||||
|
||||
// use right after demosaicing image, add coarse transformation and put the result in the provided Imagefloat*
|
||||
virtual void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const ToneCurveParams &hlp, const ColorManagementParams &cmp, const RAWParams &raw) = 0;
|
||||
virtual eSensorType getSensorType ()
|
||||
|
@ -185,6 +185,7 @@ void ImProcCoordinator::updatePreviewImage (int todo, Crop* cropCall)
|
||||
|
||||
// raw auto CA is bypassed if no high detail is needed, so we have to compute it when high detail is needed
|
||||
if ( (todo & M_PREPROC) || (!highDetailPreprocessComputed && highDetailNeeded)) {
|
||||
imgsrc->setCurrentFrame(params.raw.bayersensor.imageNum);
|
||||
imgsrc->preprocess( rp, params.lensProf, params.coarse );
|
||||
imgsrc->getRAWHistogram( histRedRaw, histGreenRaw, histBlueRaw );
|
||||
|
||||
|
@ -398,7 +398,7 @@ skip_block:
|
||||
}
|
||||
}
|
||||
|
||||
int RawImage::loadRaw (bool loadData, unsigned int imageNum, bool closeFile, ProgressListener *plistener, double progressRange)
|
||||
int RawImage::loadRaw (bool loadData, unsigned int &imageNum, bool closeFile, ProgressListener *plistener, double progressRange)
|
||||
{
|
||||
ifname = filename.c_str();
|
||||
image = nullptr;
|
||||
@ -427,8 +427,10 @@ int RawImage::loadRaw (bool loadData, unsigned int imageNum, bool closeFile, Pro
|
||||
|
||||
identify ();
|
||||
|
||||
std::cout << "israw : " << is_raw << std::endl;
|
||||
// in case dcraw didn't handle the above mentioned case...
|
||||
shot_select = std::min(shot_select, std::max(is_raw, 1u) - 1);
|
||||
imageNum = shot_select;
|
||||
|
||||
if (!is_raw) {
|
||||
fclose(ifp);
|
||||
|
@ -106,7 +106,7 @@ public:
|
||||
explicit RawImage( const Glib::ustring &name );
|
||||
~RawImage();
|
||||
|
||||
int loadRaw (bool loadData = true, unsigned int imageNum = 0, bool closeFile = true, ProgressListener *plistener = nullptr, double progressRange = 1.0);
|
||||
int loadRaw (bool loadData, unsigned int &imageNum, bool closeFile = true, ProgressListener *plistener = nullptr, double progressRange = 1.0);
|
||||
void get_colorsCoeff( float* pre_mul_, float* scale_mul_, float* cblack_, bool forceAutoWB );
|
||||
void set_prefilters()
|
||||
{
|
||||
|
@ -475,8 +475,8 @@ RawImageSource::~RawImageSource ()
|
||||
|
||||
delete idata;
|
||||
|
||||
if (ri) {
|
||||
delete ri;
|
||||
for(size_t i = 0; i < numFrames; ++i) {
|
||||
delete riFrames[i];
|
||||
}
|
||||
|
||||
flushRGB();
|
||||
@ -1506,14 +1506,29 @@ int RawImageSource::load (const Glib::ustring &fname, int imageNum, bool batch)
|
||||
plistener->setProgress (0.0);
|
||||
}
|
||||
|
||||
ri = new RawImage(fname);
|
||||
int errCode = ri->loadRaw (true, imageNum, true, plistener, 0.8);
|
||||
unsigned int tempImageNum = 4;
|
||||
do {
|
||||
tempImageNum --;
|
||||
numFrames ++;
|
||||
ri = new RawImage(fname);
|
||||
int errCode = ri->loadRaw (true, tempImageNum, true, plistener, 0.8);
|
||||
std::cout << "imagenum : " << tempImageNum << " width : " << ri->get_width() << " height : " << ri->get_height() << std::endl;
|
||||
|
||||
if (errCode) {
|
||||
return errCode;
|
||||
if (errCode) {
|
||||
return errCode;
|
||||
}
|
||||
riFrames[tempImageNum] = ri;
|
||||
ri->compress_image();
|
||||
ri->set_prefilters();
|
||||
} while (tempImageNum);
|
||||
|
||||
if(numFrames > 1 ) {
|
||||
if(riFrames[0]->get_width() != riFrames[1]->get_width() || riFrames[0]->get_height() != riFrames[1]->get_height()) {
|
||||
numFrames = 1;
|
||||
}
|
||||
}
|
||||
|
||||
ri->compress_image();
|
||||
std::cout << "numframes : " << numFrames << std::endl;
|
||||
|
||||
if (plistener) {
|
||||
plistener->setProgress (0.9);
|
||||
@ -1627,7 +1642,6 @@ int RawImageSource::load (const Glib::ustring &fname, int imageNum, bool batch)
|
||||
}*/
|
||||
|
||||
|
||||
ri->set_prefilters();
|
||||
|
||||
//Load complete Exif informations
|
||||
RawMetaDataLocation rml;
|
||||
|
@ -25,7 +25,7 @@
|
||||
#include "curves.h"
|
||||
#include "color.h"
|
||||
#include "iimage.h"
|
||||
|
||||
#include <iostream>
|
||||
#define HR_SCALE 2
|
||||
|
||||
namespace rtengine
|
||||
@ -71,6 +71,9 @@ protected:
|
||||
bool rgbSourceModified;
|
||||
|
||||
RawImage* ri; // Copy of raw pixels, NOT corrected for initial gain, blackpoint etc.
|
||||
RawImage* riFrames[16] = {nullptr};
|
||||
unsigned int currFrame = 0;
|
||||
unsigned int numFrames = 0;
|
||||
|
||||
// to accelerate CIELAB conversion:
|
||||
double lc00, lc01, lc02, lc10, lc11, lc12, lc20, lc21, lc22;
|
||||
@ -195,7 +198,11 @@ public:
|
||||
static void HLRecovery_blend (float* rin, float* gin, float* bin, int width, float maxval, float* hlmax);
|
||||
static void init ();
|
||||
static void cleanup ();
|
||||
|
||||
void setCurrentFrame(unsigned int frameNum) {
|
||||
currFrame = std::min(numFrames - 1, frameNum);
|
||||
ri = riFrames[currFrame];
|
||||
std::cout << "currFrame : " << currFrame << std::endl;
|
||||
}
|
||||
protected:
|
||||
typedef unsigned short ushort;
|
||||
void processFalseColorCorrection (Imagefloat* i, const int steps);
|
||||
|
@ -470,7 +470,7 @@ int refreshmap[rtengine::NUMOFEVENTS] = {
|
||||
RETINEX, // EvRetinexgaintransmission
|
||||
RETINEX, // EvLskal
|
||||
OUTPUTPROFILE, // EvOBPCompens
|
||||
DEMOSAIC // EvRawImageNum
|
||||
DARKFRAME // EvRawImageNum
|
||||
|
||||
};
|
||||
|
||||
|
@ -156,7 +156,8 @@ Thumbnail* Thumbnail::loadFromImage (const Glib::ustring& fname, int &w, int &h,
|
||||
Thumbnail* Thumbnail::loadQuickFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh, bool rotate, bool inspectorMode)
|
||||
{
|
||||
RawImage *ri = new RawImage(fname);
|
||||
int r = ri->loadRaw(false, 0, false);
|
||||
unsigned int imageNum = 0;
|
||||
int r = ri->loadRaw(false, imageNum, false);
|
||||
|
||||
if( r ) {
|
||||
delete ri;
|
||||
@ -270,7 +271,9 @@ RawMetaDataLocation Thumbnail::loadMetaDataFromRaw (const Glib::ustring& fname)
|
||||
rml.ciffLength = -1;
|
||||
|
||||
RawImage ri(fname);
|
||||
int r = ri.loadRaw(false);
|
||||
unsigned int imageNum = 0;
|
||||
|
||||
int r = ri.loadRaw(false, imageNum);
|
||||
|
||||
if( !r ) {
|
||||
rml.exifBase = ri.get_exifBase();
|
||||
@ -284,7 +287,9 @@ RawMetaDataLocation Thumbnail::loadMetaDataFromRaw (const Glib::ustring& fname)
|
||||
Thumbnail* Thumbnail::loadFromRaw (const Glib::ustring& fname, RawMetaDataLocation& rml, int &w, int &h, int fixwh, double wbEq, bool rotate, int imageNum)
|
||||
{
|
||||
RawImage *ri = new RawImage (fname);
|
||||
int r = ri->loadRaw(1, imageNum, 0);
|
||||
unsigned int tempImageNum = 0;
|
||||
|
||||
int r = ri->loadRaw(1, tempImageNum, 0);
|
||||
|
||||
if( r ) {
|
||||
delete ri;
|
||||
|
@ -102,6 +102,7 @@ IImage16* processImage (ProcessingJob* pjob, int& errorCode, ProgressListener* p
|
||||
ImProcFunctions ipf (¶ms, true);
|
||||
|
||||
PreviewProps pp (0, 0, fw, fh, 1);
|
||||
imgsrc->setCurrentFrame(params.raw.bayersensor.imageNum);
|
||||
imgsrc->preprocess( params.raw, params.lensProf, params.coarse, params.dirpyrDenoise.enabled);
|
||||
|
||||
if (params.toneCurve.autoexp) {// this enabled HLRecovery
|
||||
|
@ -95,6 +95,8 @@ public:
|
||||
{
|
||||
return rgbSourceModified;
|
||||
}
|
||||
void setCurrentFrame(unsigned int frameNum) {}
|
||||
|
||||
};
|
||||
}
|
||||
#endif
|
||||
|
Loading…
x
Reference in New Issue
Block a user