@@ -202,6 +202,7 @@ void ImageRemoveDistortion(const image::Image<T>& imageIn,
202202 * @param medianCameraExposure median camera exposure for the sfmData
203203 * @param masksFolders the mask folders list
204204 * @param maskExtension the mask extension
205+ * @param storageDatatype output image storage data type
205206 * @return false on error
206207*/
207208bool processImage (const std::string& dstFileName,
@@ -214,7 +215,8 @@ bool processImage(const std::string& dstFileName,
214215 double cameraExposure,
215216 double medianCameraExposure,
216217 const std::vector<std::string> & masksFolders,
217- const std::string & maskExtension)
218+ const std::string & maskExtension,
219+ const image::EStorageDataType & storageDataType)
218220{
219221 image::Image<image::RGBAfColor> image;
220222 image::Image<image::RGBAfColor> image_ud;
@@ -304,7 +306,9 @@ bool processImage(const std::string& dstFileName,
304306 // Write the result
305307 try
306308 {
307- writeImage (dstFileName, image_ud, image::ImageWriteOptions (), metadata, roi);
309+ image::ImageWriteOptions writeOptions;
310+ writeOptions.storageDataType (storageDataType);
311+ writeImage (dstFileName, image_ud, writeOptions, metadata, roi);
308312 }
309313 catch (...)
310314 {
@@ -324,6 +328,7 @@ bool processImage(const std::string& dstFileName,
324328 * @param exportFullRod do we export the full rod or not
325329 * @param masksFolders the mask folders list
326330 * @param maskExtension the mask extension
331+ * @param storageDatatype output image storage data type
327332 * @param rangeStart the initial view index to process (range selection)
328333 * @param rangeEnd the last view index to process (range selection)
329334*/
@@ -334,6 +339,7 @@ bool process(const sfmData::SfMData & input,
334339 bool exportFullRod,
335340 const std::vector<std::string> & masksFolders,
336341 const std::string & maskExtension,
342+ const image::EStorageDataType & storageDataType,
337343 size_t rangeStart,
338344 size_t rangeEnd)
339345{
@@ -391,7 +397,8 @@ bool process(const sfmData::SfMData & input,
391397 view.getImage ().getCameraExposureSetting ().getExposure (),
392398 medianCameraExposure,
393399 masksFolders,
394- maskExtension);
400+ maskExtension,
401+ storageDataType);
395402 }
396403
397404 return true ;
@@ -413,6 +420,7 @@ int aliceVision_main(int argc, char* argv[])
413420 int rangeSize = 1 ;
414421 bool evCorrection = false ;
415422 bool exportFullROD = false ;
423+ image::EStorageDataType storageDataType = image::EStorageDataType::HalfFinite;
416424
417425 // clang-format off
418426 po::options_description requiredParams (" Required parameters" );
@@ -443,7 +451,9 @@ int aliceVision_main(int argc, char* argv[])
443451 " Use masks from specific folder(s).\n "
444452 " Filename should be the same or the image UID." )
445453 (" maskExtension" , po::value<std::string>(&maskExtension)->default_value (maskExtension),
446- " File extension of the masks to use." );
454+ " File extension of the masks to use." )
455+ (" storageDataType" , po::value<image::EStorageDataType>(&storageDataType)->default_value (storageDataType),
456+ (" Storage data type: " + image::EStorageDataType_informations ()).c_str ());
447457 // clang-format on
448458
449459 CmdLine cmdline (" AliceVision prepareDenseScene" );
@@ -561,6 +571,7 @@ int aliceVision_main(int argc, char* argv[])
561571 exportFullROD,
562572 masksFolders,
563573 maskExtension,
574+ storageDataType,
564575 rangeStart,
565576 rangeEnd))
566577 {
0 commit comments