Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Quick Pipe #69

Merged
merged 24 commits into from
May 30, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
808aeef
Add UI functionality for double-requesting images
CarVac Jan 27, 2018
645b7b2
Update ppa from qt 5.9 to 5.9.1
CarVac Jan 27, 2018
0d6bb89
clean up pipeline a bit
CarVac Jan 30, 2018
fa640b2
Implement quick pipe with thumb size preview
CarVac Feb 8, 2018
86699e7
Make save buttons wait for full image to complete
CarVac Feb 8, 2018
e732859
Correct image saving button enablement
CarVac Feb 8, 2018
3320d89
Refactor validity to enable frequent checking
CarVac Feb 9, 2018
5a7e710
Make crop play nicely with the quick preview
CarVac Feb 9, 2018
b9be15d
Fix incorrect histogram updating on slider drag
CarVac Feb 10, 2018
290f9e7
Make image smoothing default to off
CarVac Feb 15, 2018
38339ed
in process of implementing upscaling
CarVac Mar 18, 2018
fdfb402
now it compiles but still doesn't do anything special
CarVac Mar 20, 2018
4d63f2f
Steal demosaic from quick pipe, make res adjable
CarVac Apr 15, 2018
f4a17f8
use 0.18 version of LibRaw
CarVac Apr 15, 2018
63aadad
Make LibRaw 0.18 build
CarVac Apr 15, 2018
0102dc0
another try to fix libraw patch
CarVac Apr 15, 2018
0c8a6f4
Reduce memory usage of quick pipe demosaic stealincg
CarVac Apr 16, 2018
4502fde
re-add disabling crop and export while processing
CarVac Apr 17, 2018
45865d6
Make full size steal the exif data
CarVac Apr 17, 2018
7c1fd30
Make full pipeline abort for any parameter change
CarVac Apr 21, 2018
42ed206
Merge remote-tracking branch 'origin/dev' into dev
CarVac Apr 29, 2018
c3076ca
fix warning about unused var in settings
CarVac Apr 29, 2018
2ada68b
Check import destination directory for validity
CarVac Apr 29, 2018
369f72a
update readme
CarVac Apr 30, 2018
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ sudo: require
dist: trusty

before_install:
- sudo add-apt-repository ppa:beineri/opt-qt59-trusty -y
- sudo add-apt-repository ppa:beineri/opt-qt591-trusty -y
- sudo apt-get update -qq

install:
Expand All @@ -16,6 +16,7 @@ script:
- git clone https://github.com/LibRaw/LibRaw-demosaic-pack-GPL2.git
- git clone https://github.com/LibRaw/LibRaw-demosaic-pack-GPL3.git
- cd LibRaw
- git checkout 0.18-stable
- patch -p1 < ../patches/libraw-makefile.patch
- make -j3 -f Makefile.dist
- sudo make install -f Makefile.dist
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,11 @@ libtiff
libgomp
libexiv2
libjpeg
libraw
libraw v0.18 or older

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

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.
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.

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

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

# Status

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

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.

Expand Down
35 changes: 34 additions & 1 deletion filmulator-gui/core/diffuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,8 @@ void diffuse_x(matrix<float> &developer_concentration, int convlength,
// in Signal Processing 44 (1995) 139-151
//Referencing code from here:
//https://github.com/halide/Halide/blob/e23f83b9bde63ed64f4d9a2fbe1ed29b9cfbf2e6/test/generator/gaussian_blur_generator.cpp

//Don't use this for radii > 70!!!
void diffuse_short_convolution(matrix<float> &developer_concentration,
const float sigma_const,
const float pixels_per_millimeter,
Expand All @@ -178,7 +180,7 @@ void diffuse_short_convolution(matrix<float> &developer_concentration,
const int width = developer_concentration.nc();

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

//We set the padding to be 4 standard deviations so as to catch as much as possible.
const int paddedWidth = width + 4*sigma + 3;
Expand Down Expand Up @@ -456,3 +458,34 @@ void diffuse_short_convolution(matrix<float> &developer_concentration,
}
}
}

//Since the aforementioned infinite impulse response doesn't work nicely with large radii,
//this will downsample it so that the radius ends up at about 30.
//Then, it'll apply the van Vliet IIR filter.
//If the radius was already less than 70, then it won't downsample at all.
void diffuse_resize_iir(matrix<float> &developer_concentration,
const float sigma_const,
const float pixels_per_millimeter,
const float timestep)
{
//set up test sigma
const double sigma = sqrt(timestep*pow(sigma_const*pixels_per_millimeter,2));

std::cout << "sigma: " << sigma << "=======================================================" << std::endl;

//If it's small enough, we're not going to resize at all.
if (sigma < 70)
{
diffuse_short_convolution(developer_concentration,
sigma_const,
pixels_per_millimeter,
timestep);
}
else
{
diffuse(developer_concentration,
sigma_const,
pixels_per_millimeter,
timestep);
}
}
5 changes: 5 additions & 0 deletions filmulator-gui/core/filmSim.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,11 @@ void diffuse_short_convolution(matrix<float> &developer_concentration,
const float pixels_per_millimeter,
const float timestep);

void diffuse_resize_iir(matrix<float> &developer_concentration,
const float sigma_const,
const float pixels_per_millimeter,
const float timestep);

//Reading raws with libraw
//TODO: remove
//PROBABLY NOT NECESSARY ANYMORE
Expand Down
32 changes: 18 additions & 14 deletions filmulator-gui/core/filmulate.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ bool ImagePipeline::filmulate(matrix<float> &input_image,
FilmParams filmParam;
AbortStatus abort;
Valid valid;
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams(FilmFetch::initial);
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams();
if(abort == AbortStatus::restart)
{
return true;
Expand Down Expand Up @@ -120,14 +120,14 @@ bool ImagePipeline::filmulate(matrix<float> &input_image,
for(int i = 0; i <= development_steps; i++)
{
//Check for cancellation
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams(FilmFetch::subsequent);
abort = paramManager->claimFilmAbort();
if(abort == AbortStatus::restart)
{
return true;
}

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

gettimeofday(&develop_start,NULL);

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

//Check for cancellation
std::tie(valid, abort, filmParam) = paramManager->claimFilmParams(FilmFetch::subsequent);
abort = paramManager->claimFilmAbort();
if(abort == AbortStatus::restart)
{
return true;
}

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

//Now, we are going to perform the diffusion part.
//Here we mix the layer among itself, which grants us the
// local contrast increases.
// diffuse(developer_concentration,
// sigma_const,
// pixels_per_millimeter,
// timestep);
diffuse_short_convolution(developer_concentration,
sigma_const,
pixels_per_millimeter,
timestep);
diffuse(developer_concentration,
sigma_const,
pixels_per_millimeter,
timestep);
// diffuse_short_convolution(developer_concentration,
// sigma_const,
// pixels_per_millimeter,
// timestep);
// diffuse_resize_iir(developer_concentration,
// sigma_const,
// pixels_per_millimeter,
// timestep);

diffuse_dif += timeDiff(diffuse_start);

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

std::tie(valid, abort, filmParam) = paramManager->claimFilmParams(FilmFetch::subsequent);
abort = paramManager->claimFilmAbort();
if(abort == AbortStatus::restart)
{
return true;
Expand Down
Loading