Skip to content

Commit

Permalink
OIIO 2.5.9+ update & export to HEIC
Browse files Browse the repository at this point in the history
v 1.46
• OIIO 2.5.9
• export to HEIC
  • Loading branch information
ssh4net committed Mar 17, 2024
1 parent 5cf30e5 commit 2d56803
Show file tree
Hide file tree
Showing 12 changed files with 410 additions and 26 deletions.
57 changes: 41 additions & 16 deletions UnRAWer/Unrawer.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,14 +56,14 @@
</ImportGroup>
<PropertyGroup Label="UserMacros" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
<IncludePath>C:\Qt\6.2.4\msvc2019_64\include;e:\DVR\include;e:\DVR\include\boost-1_84;e:\GH\toml11\build\RELEASE\include;$(IncludePath)</IncludePath>
<IncludePath>C:\Qt\6.2.4\msvc2019_64\include;e:\DVR\include;e:\DVR\include\boost-1_85;e:\GH\toml11\build\RELEASE\include;$(IncludePath)</IncludePath>
<LinkIncremental>true</LinkIncremental>
<LibraryPath>e:\DVR\lib;$(LibraryPath)</LibraryPath>
<IgnoreImportLibrary>true</IgnoreImportLibrary>
<SourcePath>E:\GH\LibRaw\src;E:\GH\OpenColorIO\src;E:\GH\OpenImageIO\src;$(SourcePath)</SourcePath>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
<IncludePath>C:\Qt\6.2.4\msvc2019_64\include;e:\DVR\include;e:\DVR\include\boost-1_84;e:\GH\toml11\build\RELEASE\include</IncludePath>
<IncludePath>C:\Qt\6.2.4\msvc2019_64\include;e:\DVR\include;e:\DVR\include\boost-1_85;e:\GH\toml11\build\RELEASE\include;$(IncludePath)</IncludePath>
<SourcePath>E:\GH\LibRaw\src;E:\GH\OpenColorIO\src;E:\GH\OpenImageIO\src;$(SourcePath)</SourcePath>
<LibraryPath>e:\DVR\lib;$(LibraryPath)</LibraryPath>
</PropertyGroup>
Expand All @@ -73,7 +73,6 @@
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<PreprocessorDefinitions />
<AdditionalOptions>-DBOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN7 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<QtMoc>
<PrependInclude>$(ProjectDir)src\stdafx.h;%(PrependInclude)</PrependInclude>
Expand All @@ -100,6 +99,17 @@ xcopy /y e:\DVR\bin\Iex-3_2.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\raw_r.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\raw.dll "$(TargetDir)"

xcopy /y e:\DVR\bin\heif.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\libde265.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\libx265.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\kvazaar.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\brotlidec.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\brotlicommon.dll "$(TargetDir)"

xcopy /fy e:\DVR\lib\bz2.dll "$(TargetDir)bz2-1.dll"*

xcopy /y e:\DVR\bin\freetype.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\Ptex.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\liblzma.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\turbojpeg.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\jpeg62.dll "$(TargetDir)"
Expand All @@ -110,16 +120,16 @@ xcopy /y e:\DVR\bin\openjp2.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\libexpat.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\gif.dll "$(TargetDir)"

xcopy /y e:\GH\Little-CMS\bin\lcms2.dll "$(TargetDir)"
xcopy /y e:\GH\Little-CMS\RELEASE\bin\lcms2.dll "$(TargetDir)"

xcopy /y e:\DVR\bin\OpenImageIO.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\OpenImageIO_Util.dll "$(TargetDir)"

xcopy /y e:\DVR\lib\boost_atomic-vc143-mt-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_filesystem-vc143-mt-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_log_setup-vc143-mt-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_log-vc143-mt-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_thread-vc143-mt-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_atomic-vc143-mt-x64-1_85.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_filesystem-vc143-mt-x64-1_85.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_log_setup-vc143-mt-x64-1_85.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_log-vc143-mt-x64-1_85.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_thread-vc143-mt-x64-1_85.dll "$(TargetDir)"

xcopy /y c:\Qt\6.2.4\msvc2019_64\bin\Qt6Core.dll "$(TargetDir)"
xcopy /y c:\Qt\6.2.4\msvc2019_64\bin\Qt6Gui.dll "$(TargetDir)"
Expand Down Expand Up @@ -157,7 +167,6 @@ xcopy /y e:\DVR\bin\libwebpmux.dll "$(TargetDir)"</Command>
<ClCompile>
<LanguageStandard>stdcpp17</LanguageStandard>
<LanguageStandard_C>stdc11</LanguageStandard_C>
<AdditionalOptions>-DBOOST_USE_WINAPI_VERSION=BOOST_WINAPI_VERSION_WIN7 %(AdditionalOptions)</AdditionalOptions>
</ClCompile>
<QtMoc>
<PrependInclude>$(ProjectDir)src\stdafx.h;%(PrependInclude)</PrependInclude>
Expand Down Expand Up @@ -190,6 +199,21 @@ xcopy /y e:\DVR\bin\Iex-3_2_d.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\raw_rd.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\rawd.dll "$(TargetDir)"

xcopy /y e:\DVR\bin\freetyped.dll "$(TargetDir)"

xcopy /y e:\DVR\bin\heifd.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\libde265d.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\libx265d.dll "$(TargetDir)"

xcopy /y e:\DVR\lib\bz2d.dll "$(TargetDir)bz2-1.dll"*

xcopy /y e:\DVR\bin\kvazaard.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\brotliencd.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\brotlidecd.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\brotlicommond.dll "$(TargetDir)"

xcopy /y e:\DVR\bin\freetyped.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\Ptex_d.dll "$(TargetDir)"
xcopy /y e:\DVR\debug\bin\liblzma.dll "$(TargetDir)"
xcopy /y e:\DVR\debug\bin\turbojpeg.dll "$(TargetDir)"
xcopy /y e:\DVR\debug\bin\jpeg62.dll "$(TargetDir)"
Expand All @@ -200,16 +224,16 @@ xcopy /y e:\DVR\bin\openjp2d.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\libexpatd.dll "$(TargetDir)"
xcopy /y e:\DVR\debug\bin\gif.dll "$(TargetDir)"

xcopy /y e:\GH\Little-CMS\debug\lcms2.dll "$(TargetDir)"
xcopy /y e:\GH\Little-CMS\DEBUG\bin\lcms2.dll "$(TargetDir)"

xcopy /y e:\DVR\bin\OpenImageIO_d.dll "$(TargetDir)"
xcopy /y e:\DVR\bin\OpenImageIO_Util_d.dll "$(TargetDir)"

xcopy /y e:\DVR\lib\boost_atomic-vc143-mt-gd-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_filesystem-vc143-mt-gd-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_log_setup-vc143-mt-gd-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_log-vc143-mt-gd-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_thread-vc143-mt-gd-x64-1_84.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_atomic-vc143-mt-gd-x64-1_85.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_filesystem-vc143-mt-gd-x64-1_85.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_log_setup-vc143-mt-gd-x64-1_85.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_log-vc143-mt-gd-x64-1_85.dll "$(TargetDir)"
xcopy /y e:\DVR\lib\boost_thread-vc143-mt-gd-x64-1_85.dll "$(TargetDir)"

xcopy /y c:\Qt\6.2.4\msvc2019_64\bin\Qt6Cored.dll "$(TargetDir)"
xcopy /y c:\Qt\6.2.4\msvc2019_64\bin\Qt6Guid.dll "$(TargetDir)"
Expand Down Expand Up @@ -294,6 +318,7 @@ xcopy /y e:\DVR\bin\libwebpmuxd.dll "$(TargetDir)"</Command>
<ClInclude Include="src\Common.h" />
<ClInclude Include="src\fileProcessor.h" />
<ClInclude Include="src\imageio.h" />
<ClInclude Include="src\libraw_oiio.h" />
<ClInclude Include="src\LOG.H" />
<ClInclude Include="src\process.h" />
<ClInclude Include="src\processors.h" />
Expand Down
3 changes: 3 additions & 0 deletions UnRAWer/Unrawer.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@
<ClInclude Include="src\processors.h">
<Filter>src</Filter>
</ClInclude>
<ClInclude Include="src\libraw_oiio.h">
<Filter>src</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<QtMoc Include="src\ui.h">
Expand Down
26 changes: 25 additions & 1 deletion UnRAWer/src/IMAGEIO.CPP
Original file line number Diff line number Diff line change
Expand Up @@ -310,8 +310,32 @@ bool img_write(std::shared_ptr<ImageBuf> out_buf, const std::string& outputFileN
ospec.attribute("pnm:binary", 1);
ospec.attribute("oiio:UnassociatedAlpha", 1);
ospec.attribute("jpeg:subsampling", "4:4:4");
ospec.attribute("Compression", "jpeg:100");
ospec.attribute("png:compressionLevel", 4);

switch (settings.fileFormat) {
case 0:
ospec.attribute("Compression", "zip");
break;
case 1:
ospec.attribute("Compression", "piz");
break;
case 2:
ospec.attribute("Compression", "zip");
break;
case 3:
ospec.attribute("Compression", "jpeg:100");
break;
case 4:
ospec.attribute("Compression", "jpeg2000:100"); // Not used
break;
case 5:
ospec.attribute("Compression", "heic:100");
break;
default:
ospec.attribute("Compression", "zip");
break;
}

//rspec.attribute("tiff:bigtiff", 1);
//rspec.set_format(TypeDesc::FLOAT); // temporary
//LOG(info) << "Channels: " << rspec.nchannels << " Alpha channel: " << rspec.alpha_channel << std::endl;
Expand Down
2 changes: 2 additions & 0 deletions UnRAWer/src/fileProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ QString getExtension(QString& extension, Settings* settings) {
case 4:
return ".jp2";
case 5:
return ".heic";
case 6:
return ".ppm";
}
//Only RAW fils are supported
Expand Down
6 changes: 5 additions & 1 deletion UnRAWer/src/processors.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,11 @@ void LReader(int index, std::shared_ptr<ProcessingParams>& processing_entry,
LOG(error) << "Reader: Cannot read file: " << processing->srcFile << std::endl;
return;
}
//////////////////////////////

//
//
//
(*fileCntr)--;

(*myPools)["LUnpacker"]->enqueue(LUnpacker, index, processing_entry, fileCntr, myPools);
Expand Down Expand Up @@ -758,7 +762,7 @@ void Writer(int index, std::shared_ptr<ProcessingParams>& processing_entry,
if (settings.defFormat == 0) {
raw->imgdata.params.output_tiff = 1; // TIF
}
else if (settings.defFormat == 5) {
else if (settings.defFormat == 6) {
raw->imgdata.params.output_tiff = 0; // PPM
}
else {
Expand Down
1 change: 1 addition & 0 deletions UnRAWer/src/processors.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@

#include "threadpool.h"
#include "fileProcessor.h"
#include "libraw_oiio.h"

#include <OpenImageIO/imageio.h>
#include <OpenImageIO/imagebuf.h>
Expand Down
4 changes: 2 additions & 2 deletions UnRAWer/src/settings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ bool loadSettings(Settings& settings, const std::string& filename) {
// Export
if (!check("Export", "DefaultFormat")) return false;
settings.defFormat = parsed["Export"]["DefaultFormat"].as_integer();
if (settings.defFormat < 0 || settings.defFormat > 5) {
if (settings.defFormat < 0 || settings.defFormat > 6) {
LOG(error) << "Error parsing settings file: [Export] section: \"DefaultFormat\" key value is out of range." << std::endl;
return false;
}
if (!check("Export", "FileFormat")) return false;
settings.fileFormat = parsed["Export"]["FileFormat"].as_integer();// .value_or(-1);
if (settings.fileFormat < -1 || settings.fileFormat > 5) {
if (settings.fileFormat < -1 || settings.fileFormat > 6) {
LOG(error) << "Error parsing settings file: [Export] section: \"FileFormat\" key value is out of range." << std::endl;
return false;
}
Expand Down
4 changes: 2 additions & 2 deletions UnRAWer/src/settings.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ struct Settings {
float mltThreads;
uint verbosity;

std::vector<std::string> out_formats = { "tif", "exr", "png", "jpg", "jp2", "ppm" };
std::vector<std::string> out_formats = { "tif", "exr", "png", "jpg", "jp2", "heic", "ppm"};
std::string ocioConfigPath, dLutPreset;

std::map<std::string, std::string> lut_Preset;
Expand Down Expand Up @@ -91,7 +91,7 @@ struct Settings {

numThreads = 5; // Number of threads: 0 - auto, >0 - number of threads
rangeMode = 0; // Float type: 0 - unsigned, 1 - signed, 2 - unsigned -> signed, 3 - signed -> unsigned
fileFormat = -1; // File format: -1 - original, 0 - TIFF, 1 - OpenEXR, 2 - PNG, 3 - JPEG, 4 - JPEG-2000, 5 - PPM
fileFormat = -1; // File format: -1 - original, 0 - TIFF, 1 - OpenEXR, 2 - PNG, 3 - JPEG, 4 - JPEG-2000, 5 - HEIC, 6 - PPM
defFormat = 0; // Default file format = TIFF
bitDepth = -1; // Bit depth: -1 - Original, 0 - uint8, 1 - uint16, 2 - uint32, 3 - uint64, 4 - half, 5 - float, 6 - double
defBDepth = 1; // Default bit depth = uint16
Expand Down
5 changes: 3 additions & 2 deletions UnRAWer/src/ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ MainWindow::MainWindow() {
}
// File Formats
std::vector<std::pair<const QString, int>> frmtMenu = {
{"Original", -1}, {"TIFF", 0}, {"OpenEXR", 1}, {"PNG", 2}, {"JPEG", 3}, {"JPEG-2000", 4}, {"PPM", 5} };
{"Original", -1}, {"TIFF", 0}, {"OpenEXR", 1}, {"PNG", 2}, {"JPEG", 3}, {"JPEG-2000", 4}, {"HEIC", 5}, {"PPM", 6} };
for (auto& [title, value] : frmtMenu) {
QAction* action = createAction(title, FrmtGroup, fmt_submenu, true, (settings.fileFormat == value));
frmtActions.push_back(action);
Expand Down Expand Up @@ -436,7 +436,8 @@ void MainWindow::frmtSettings() {
{"PNG", 2},
{"JPEG", 3},
{"JPEG2000", 4},
{"PPM", 5}
{"HEIC", 5},
{"PPM", 6}
};

QAction* action = qobject_cast<QAction*>(sender());
Expand Down
2 changes: 1 addition & 1 deletion UnRAWer/src/ui.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@
#include "process.h"

#define VERSION_MAJOR 1
#define VERSION_MINOR 45
#define VERSION_MINOR 46

void setPBarColor(QProgressBar* progressBar, const QColor& color = QColor("#05B8CC"));

Expand Down
3 changes: 2 additions & 1 deletion UnRAWer/src/unrw_config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ RangeMode = 0
# 2 - PNG
# 3 - JPEG
# 4 - JPEG-2000
# 5 - PPM
# 5 - HEIC
# 6 - PPM
DefaultFormat = 3
FileFormat = -1
# Bit depth:
Expand Down
Loading

0 comments on commit 2d56803

Please sign in to comment.