Skip to content

Commit 47d7f4f

Browse files
committed
switch from AMPAS_DATA_PATH to RAWTOACES_DATA_PATH
1 parent 3c3b5d1 commit 47d7f4f

File tree

3 files changed

+18
-9
lines changed

3 files changed

+18
-9
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -242,7 +242,7 @@ By default, `rawtoaces` will determine the adopted white by finding the set of w
242242

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

245-
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`.
245+
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.
246246

247247

248248
#### Spectral Datasets

include/rawtoaces/define.h

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -343,10 +343,14 @@ inline vector<string> openDir( string path = "." )
343343
{
344344
vector<string> paths;
345345

346-
for ( auto &i: boost::filesystem::directory_iterator( path ) )
346+
if ( boost::filesystem::exists( path ) )
347347
{
348-
if ( i.status().type() != boost::filesystem::file_type::directory_file )
349-
paths.push_back( i.path().string() );
348+
for ( auto &i: boost::filesystem::directory_iterator( path ) )
349+
{
350+
if ( i.status().type() !=
351+
boost::filesystem::file_type::directory_file )
352+
paths.push_back( i.path().string() );
353+
}
350354
}
351355

352356
return paths;
@@ -448,7 +452,11 @@ inline dataPath &pathsFinder()
448452
const char *env;
449453

450454
vector<string> &PATHs = cdp.paths;
451-
env = getenv( "AMPAS_DATA_PATH" );
455+
456+
env = getenv( "RAWTOACES_DATA_PATH" );
457+
if ( !env )
458+
// Fallback to the old environment variable.
459+
env = getenv( "AMPAS_DATA_PATH" );
452460

453461
if ( env )
454462
path = env;

src/rawtoaces_util/acesrender.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ void usage( const char *prog )
9797
" 3=Average a grey box for white balance <x y w h>\n"
9898
" 4=Use custom white balance <r g b g>\n"
9999
" (default = 0)\n"
100-
" --mat-method [0-2] IDT matrix calculation method\n"
100+
" --mat-method [0-3] IDT matrix calculation method\n"
101101
" 0=Calculate matrix from camera spec sens\n"
102102
" 1=Use file metadata color matrix\n"
103103
" 2=Use adobe coeffs included in libraw\n"
@@ -876,7 +876,7 @@ int AcesRender::unpack( const char *pathToRaw )
876876
// inputs:
877877
// const char * : camera spectral sensitivity path
878878
// (either in the environment variable of
879-
// "AMPAS_CAMERA_SENSITIVITIES_PATH"
879+
// "${RAWTOACES_DATA_PATH}/camera"
880880
// such as "/usr/local/include/rawtoaces/data/camera"
881881
// or specified by users)
882882
// libraw_iparams_t : main parameters read from RAW
@@ -916,8 +916,9 @@ int AcesRender::fetchCameraSenPath( const libraw_iparams_t &P )
916916
//
917917
// inputs:
918918
// const char * : type of light source ("unknown" if not specified)
919-
// (in the environment variable of "AMPAS_ILLUMINANT_PATH"
920-
// such as "/usr/local/include/rawtoaces/data/Illuminant")
919+
// (in the environment variable of
920+
// "${RAWTOACES_DATA_PATH}/illuminant" such as
921+
// "/usr/local/include/rawtoaces/data/illuminant")
921922
//
922923
// outputs:
923924
// int : "1" means loading/injecting light source datasets successfully,

0 commit comments

Comments
 (0)