RAWファイルの処理(2) ホワイトバランス/色温度の処理 (Photoshop CS3)

RAWファイルのオプション指定は数多くあります。前回は露出でしたが今回はホワイトバランス、色温度などのオプションを指定して複数開くサンプルです。
ホワイトバランスはwhiteBalanceに以下のものを設定します。

[ホワイトバランスで指定できる値]
撮影時のものWhiteBalanceType.ASSHOT;
自動WhiteBalanceType.AUTO;
曇天WhiteBalanceType.CLOUDY;
カスタムWhiteBalanceType.CUSTOM;
昼光WhiteBalanceType.DAYLIGHT;
フラッシュWhiteBalanceType.FLASH;
蛍光灯WhiteBalanceType.FLUORESCENT;
日陰WhiteBalanceType.SHADE;
タングステンWhiteBalanceType.TUNGSTEN;

以下のスクリプトは全てのホワイトバランスを指定して開くものです。


rawOpt = new CameraRAWOpenOptions();
filename = File.openDialog("RAWファイルを指定してください");
if (filename)
{
fileObj = new File(filename);
rawOpt.whiteBalance = WhiteBalanceType.ASSHOT;
open(fileObj,rawOpt);
rawOpt.whiteBalance = WhiteBalanceType.AUTO;
open(fileObj,rawOpt);
rawOpt.whiteBalance = WhiteBalanceType.CLOUDY;
open(fileObj,rawOpt);
rawOpt.whiteBalance = WhiteBalanceType.CUSTOM;
open(fileObj,rawOpt);
rawOpt.whiteBalance = WhiteBalanceType.DAYLIGHT;
open(fileObj,rawOpt);
rawOpt.whiteBalance = WhiteBalanceType.FLASH;
open(fileObj,rawOpt);
rawOpt.whiteBalance = WhiteBalanceType.FLUORESCENT;
open(fileObj,rawOpt);
rawOpt.whiteBalance = WhiteBalanceType.SHADE;
open(fileObj,rawOpt);
rawOpt.whiteBalance = WhiteBalanceType.TUNGSTEN;
open(fileObj,rawOpt);
}

画像の色合いはホワイトバランス以外に色温度も重要な要素の1つです。色温度はtemperatureで指定します。指定できる色温度の範囲は2000〜50000になります。以下のサンプルは色温度2000〜9000まで1000刻みでRAWファイルを開いて表示するものです。
rawOpt = new CameraRAWOpenOptions();
filename = File.openDialog("RAWファイルを指定してください");
if (filename)
{
fileObj = new File(filename);
for(i=2000; i<=9000; i+=1000)
{
rawOpt.temperature = i;
open(fileObj,rawOpt);
}
}

色温度の範囲は以下の行で指定します。
for(i=2000; i<=9000; i+=1000)

2000が最初の色温度、9000が最後の色温度、1000が増減値になります。

[サンプルをダウンロード]