Skip to content

Commit 1150b31

Browse files
authored
Merge pull request #69 from CarVac/dev
Quick Pipe
2 parents 573e9c4 + 369f72a commit 1150b31

22 files changed

+1209
-167
lines changed

.travis.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sudo: require
44
dist: trusty
55

66
before_install:
7-
- sudo add-apt-repository ppa:beineri/opt-qt59-trusty -y
7+
- sudo add-apt-repository ppa:beineri/opt-qt591-trusty -y
88
- sudo apt-get update -qq
99

1010
install:
@@ -16,6 +16,7 @@ script:
1616
- git clone https://github.com/LibRaw/LibRaw-demosaic-pack-GPL2.git
1717
- git clone https://github.com/LibRaw/LibRaw-demosaic-pack-GPL3.git
1818
- cd LibRaw
19+
- git checkout 0.18-stable
1920
- patch -p1 < ../patches/libraw-makefile.patch
2021
- make -j3 -f Makefile.dist
2122
- sudo make install -f Makefile.dist

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,11 @@ libtiff
2222
libgomp
2323
libexiv2
2424
libjpeg
25-
libraw
25+
libraw v0.18 or older
2626

2727
Some libraw package maintainers don't include the GPL demosaic packs, so we highly encourage you to compile it yourself.
2828

29-
It also requires Qt 5.4: open the .pro file from Qt Creator and select Build in order to run it. You may have to initialize the build configurations upon first loading the project; I suggest you add the -j# flag to the Make build parameters to speed compilation.
29+
It also requires Qt 5.4 or newer: open the .pro file from Qt Creator and select Build in order to run it. You may have to initialize the build configurations upon first loading the project; I suggest you add the -j# flag to the Make build parameters to speed compilation.
3030

3131
A note: Use a standalone git client to clone the repository initially, and then you can use Qt Creator's built-in git tools.
3232

@@ -55,7 +55,7 @@ If you want the UI to appear larger on a high-pixel density display, use the Use
5555

5656
# Status
5757

58-
If told to make a version number for it right now, I'd put it as 0.6.3.
58+
If told to make a version number for it right now, I'd put it as 0.7.0.
5959

6060
Currently, the photo editor is mostly complete, although noise reduction and sharpening are currently missing. Both the Import and Organize tabs need some UI massaging, as does the queue. Finally, the Output tab hasn't even been started yet.
6161

filmulator-gui/core/diffuse.cpp

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,8 @@ void diffuse_x(matrix<float> &developer_concentration, int convlength,
169169
// in Signal Processing 44 (1995) 139-151
170170
//Referencing code from here:
171171
//https://github.com/halide/Halide/blob/e23f83b9bde63ed64f4d9a2fbe1ed29b9cfbf2e6/test/generator/gaussian_blur_generator.cpp
172+
173+
//Don't use this for radii > 70!!!
172174
void diffuse_short_convolution(matrix<float> &developer_concentration,
173175
const float sigma_const,
174176
const float pixels_per_millimeter,
@@ -178,7 +180,7 @@ void diffuse_short_convolution(matrix<float> &developer_concentration,
178180
const int width = developer_concentration.nc();
179181

180182
//Compute the standard deviation of the blur we want, in pixels.
181-
double sigma = sqrt(timestep*pow(sigma_const*pixels_per_millimeter,2));
183+
const double sigma = sqrt(timestep*pow(sigma_const*pixels_per_millimeter,2));
182184

183185
//We set the padding to be 4 standard deviations so as to catch as much as possible.
184186
const int paddedWidth = width + 4*sigma + 3;
@@ -456,3 +458,34 @@ void diffuse_short_convolution(matrix<float> &developer_concentration,
456458
}
457459
}
458460
}
461+
462+
//Since the aforementioned infinite impulse response doesn't work nicely with large radii,
463+
//this will downsample it so that the radius ends up at about 30.
464+
//Then, it'll apply the van Vliet IIR filter.
465+
//If the radius was already less than 70, then it won't downsample at all.
466+
void diffuse_resize_iir(matrix<float> &developer_concentration,
467+
const float sigma_const,
468+
const float pixels_per_millimeter,
469+
const float timestep)
470+
{
471+
//set up test sigma
472+
const double sigma = sqrt(timestep*pow(sigma_const*pixels_per_millimeter,2));
473+
474+
std::cout << "sigma: " << sigma << "=======================================================" << std::endl;
475+
476+
//If it's small enough, we're not going to resize at all.
477+
if (sigma < 70)
478+
{
479+
diffuse_short_convolution(developer_concentration,
480+
sigma_const,
481+
pixels_per_millimeter,
482+
timestep);
483+
}
484+
else
485+
{
486+
diffuse(developer_concentration,
487+
sigma_const,
488+
pixels_per_millimeter,
489+
timestep);
490+
}
491+
}

filmulator-gui/core/filmSim.hpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,11 @@ void diffuse_short_convolution(matrix<float> &developer_concentration,
9797
const float pixels_per_millimeter,
9898
const float timestep);
9999

100+
void diffuse_resize_iir(matrix<float> &developer_concentration,
101+
const float sigma_const,
102+
const float pixels_per_millimeter,
103+
const float timestep);
104+
100105
//Reading raws with libraw
101106
//TODO: remove
102107
//PROBABLY NOT NECESSARY ANYMORE

filmulator-gui/core/filmulate.cpp

Lines changed: 18 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ bool ImagePipeline::filmulate(matrix<float> &input_image,
3131
FilmParams filmParam;
3232
AbortStatus abort;
3333
Valid valid;
34-
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams(FilmFetch::initial);
34+
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams();
3535
if(abort == AbortStatus::restart)
3636
{
3737
return true;
@@ -120,14 +120,14 @@ bool ImagePipeline::filmulate(matrix<float> &input_image,
120120
for(int i = 0; i <= development_steps; i++)
121121
{
122122
//Check for cancellation
123-
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams(FilmFetch::subsequent);
123+
abort = paramManager->claimFilmAbort();
124124
if(abort == AbortStatus::restart)
125125
{
126126
return true;
127127
}
128128

129129
//Updating for starting the development simulation. Valid is one too high here.
130-
pipeline->updateProgress(Valid::prefilmulation, float(i)/float(development_steps));
130+
pipeline->updateProgress(Valid::partfilmulation, float(i)/float(development_steps));
131131

132132
gettimeofday(&develop_start,NULL);
133133

@@ -148,26 +148,30 @@ bool ImagePipeline::filmulate(matrix<float> &input_image,
148148
gettimeofday(&diffuse_start,NULL);
149149

150150
//Check for cancellation
151-
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams(FilmFetch::subsequent);
151+
abort = paramManager->claimFilmAbort();
152152
if(abort == AbortStatus::restart)
153153
{
154154
return true;
155155
}
156156

157157
//Updating for starting the diffusion simulation. Valid is one too high here.
158-
pipeline->updateProgress(Valid::prefilmulation, float(i)/float(development_steps));
158+
pipeline->updateProgress(Valid::partfilmulation, float(i)/float(development_steps));
159159

160160
//Now, we are going to perform the diffusion part.
161161
//Here we mix the layer among itself, which grants us the
162162
// local contrast increases.
163-
// diffuse(developer_concentration,
164-
// sigma_const,
165-
// pixels_per_millimeter,
166-
// timestep);
167-
diffuse_short_convolution(developer_concentration,
168-
sigma_const,
169-
pixels_per_millimeter,
170-
timestep);
163+
diffuse(developer_concentration,
164+
sigma_const,
165+
pixels_per_millimeter,
166+
timestep);
167+
// diffuse_short_convolution(developer_concentration,
168+
// sigma_const,
169+
// pixels_per_millimeter,
170+
// timestep);
171+
// diffuse_resize_iir(developer_concentration,
172+
// sigma_const,
173+
// pixels_per_millimeter,
174+
// timestep);
171175

172176
diffuse_dif += timeDiff(diffuse_start);
173177

@@ -216,7 +220,7 @@ bool ImagePipeline::filmulate(matrix<float> &input_image,
216220
struct timeval mult_start;
217221
gettimeofday(&mult_start,NULL);
218222

219-
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams(FilmFetch::subsequent);
223+
abort = paramManager->claimFilmAbort();
220224
if(abort == AbortStatus::restart)
221225
{
222226
return true;

0 commit comments

Comments
 (0)