Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ By default, `rawtoaces` will determine the adopted white by finding the set of w

$ rawtoaces --wb-method 1 D60 --mat-method 0 input.raw

You can use the environment varilable of `AMPAS_DATA_PATH` to specify the repository for your own datasets. If you have spectral sensitivity data for your camera but it is not included with `rawtoaces` you may place that data in `/usr/local/include/rawtoaces/data/camera` or place the data in the folder pointed by `AMPAS_DATA_PATH`.
You can use the environment variable of `RAWTOACES_DATA_PATH` to specify the repository for your own datasets. If you have spectral sensitivity data for your camera but it is not included with `rawtoaces` you may place that data in `/usr/local/include/rawtoaces/data/camera` or place the data in the folder pointed by `RAWTOACES_DATA_PATH`. The rawtoaces versions prior to v1.1 used the environment variable `AMPAS_DATA_PATH`, the old name is still supported for backward compatibility. If both variables are present, `RAWTOACES_DATA_PATH` takes priority.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a place that describes what is expected structure of this folder?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, in the data repo readme



#### Spectral Datasets
Expand Down
26 changes: 22 additions & 4 deletions include/rawtoaces/define.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include <string>
#include <algorithm>
#include <boost/filesystem.hpp>
#include <iostream>

#ifndef WIN32
# include <sys/stat.h>
Expand Down Expand Up @@ -343,10 +344,14 @@ inline vector<string> openDir( string path = "." )
{
vector<string> paths;

for ( auto &i: boost::filesystem::directory_iterator( path ) )
if ( boost::filesystem::exists( path ) )
{
if ( i.status().type() != boost::filesystem::file_type::directory_file )
paths.push_back( i.path().string() );
for ( auto &i: boost::filesystem::directory_iterator( path ) )
{
if ( i.status().type() !=
boost::filesystem::file_type::directory_file )
paths.push_back( i.path().string() );
}
}

return paths;
Expand Down Expand Up @@ -448,7 +453,20 @@ inline dataPath &pathsFinder()
const char *env;

vector<string> &PATHs = cdp.paths;
env = getenv( "AMPAS_DATA_PATH" );

env = getenv( "RAWTOACES_DATA_PATH" );
if ( !env )
{
// Fallback to the old environment variable.
env = getenv( "AMPAS_DATA_PATH" );
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

/nit random thought - maybe throw some warning message into console saying that this one is deprecated now and they should switch to a new one?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good idea. done!


if ( env )
{
std::cerr << "Warning: The environment variable "
<< "AMPAS_DATA_PATH is now deprecated. Please use "
<< "RAWTOACES_DATA_PATH instead." << std::endl;
}
}

if ( env )
path = env;
Expand Down
9 changes: 5 additions & 4 deletions src/rawtoaces_util/acesrender.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void usage( const char *prog )
" 3=Average a grey box for white balance <x y w h>\n"
" 4=Use custom white balance <r g b g>\n"
" (default = 0)\n"
" --mat-method [0-2] IDT matrix calculation method\n"
" --mat-method [0-3] IDT matrix calculation method\n"
" 0=Calculate matrix from camera spec sens\n"
" 1=Use file metadata color matrix\n"
" 2=Use adobe coeffs included in libraw\n"
Expand Down Expand Up @@ -876,7 +876,7 @@ int AcesRender::unpack( const char *pathToRaw )
// inputs:
// const char * : camera spectral sensitivity path
// (either in the environment variable of
// "AMPAS_CAMERA_SENSITIVITIES_PATH"
// "${RAWTOACES_DATA_PATH}/camera"
// such as "/usr/local/include/rawtoaces/data/camera"
// or specified by users)
// libraw_iparams_t : main parameters read from RAW
Expand Down Expand Up @@ -916,8 +916,9 @@ int AcesRender::fetchCameraSenPath( const libraw_iparams_t &P )
//
// inputs:
// const char * : type of light source ("unknown" if not specified)
// (in the environment variable of "AMPAS_ILLUMINANT_PATH"
// such as "/usr/local/include/rawtoaces/data/Illuminant")
// (in the environment variable of
// "${RAWTOACES_DATA_PATH}/illuminant" such as
// "/usr/local/include/rawtoaces/data/illuminant")
//
// outputs:
// int : "1" means loading/injecting light source datasets successfully,
Expand Down
Loading