astyle'd rtengine/clutstore.cc
This commit is contained in:
parent
7a417f2b56
commit
add88cc62c
@ -31,9 +31,11 @@ bool loadFile(
|
|||||||
|
|
||||||
if (fw == fh) {
|
if (fw == fh) {
|
||||||
unsigned int level = 1;
|
unsigned int level = 1;
|
||||||
|
|
||||||
while (level * level * level < fw) {
|
while (level * level * level < fw) {
|
||||||
++level;
|
++level;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (level * level * level == fw && level > 1) {
|
if (level * level * level == fw && level > 1) {
|
||||||
clut_level = level;
|
clut_level = level;
|
||||||
res = true;
|
res = true;
|
||||||
@ -57,6 +59,7 @@ bool loadFile(
|
|||||||
AlignedBuffer<std::uint16_t> image(fw * fh * 4 + 1);
|
AlignedBuffer<std::uint16_t> image(fw * fh * 4 + 1);
|
||||||
|
|
||||||
std::size_t index = 0;
|
std::size_t index = 0;
|
||||||
|
|
||||||
for (int y = 0; y < fh; ++y) {
|
for (int y = 0; y < fh; ++y) {
|
||||||
for (int x = 0; x < fw; ++x) {
|
for (int x = 0; x < fw; ++x) {
|
||||||
image.data[index] = img_float->r(y, x);
|
image.data[index] = img_float->r(y, x);
|
||||||
@ -248,6 +251,7 @@ void rtengine::HaldCLUT::splitClutFilename(
|
|||||||
Glib::ustring basename = Glib::path_get_basename(filename);
|
Glib::ustring basename = Glib::path_get_basename(filename);
|
||||||
|
|
||||||
Glib::ustring::size_type last_slash_pos = basename.rfind('/');
|
Glib::ustring::size_type last_slash_pos = basename.rfind('/');
|
||||||
|
|
||||||
if (last_slash_pos == Glib::ustring::npos) {
|
if (last_slash_pos == Glib::ustring::npos) {
|
||||||
last_slash_pos = basename.rfind('\\');
|
last_slash_pos = basename.rfind('\\');
|
||||||
}
|
}
|
||||||
@ -284,6 +288,7 @@ std::shared_ptr<rtengine::HaldCLUT> rtengine::CLUTStore::getClut(const Glib::ust
|
|||||||
|
|
||||||
if (!cache.get(filename, result)) {
|
if (!cache.get(filename, result)) {
|
||||||
std::unique_ptr<rtengine::HaldCLUT> clut(new rtengine::HaldCLUT);
|
std::unique_ptr<rtengine::HaldCLUT> clut(new rtengine::HaldCLUT);
|
||||||
|
|
||||||
if (clut->load(filename)) {
|
if (clut->load(filename)) {
|
||||||
result = std::move(clut);
|
result = std::move(clut);
|
||||||
cache.insert(filename, result);
|
cache.insert(filename, result);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user