Transition to C++23 (#11)

* enum field renaming

* renderer cleanups

* compiling for C++23

* version bump

* fix build
This commit is contained in:
m-aXimilian
2025-10-07 12:18:00 +02:00
committed by Maximilian Kueffner
parent 1ea83d9d11
commit fec5c08aaa
15 changed files with 60 additions and 55 deletions
+13 -9
View File
@@ -55,21 +55,25 @@ GLuint pixelarium::render::CvMatRender::uploadTexture()
const int width = img_.cols;
const int height = img_.rows;
switch (img_.type()) {
// see
// https://stackoverflow.com/questions/10167534/how-to-find-out-what-type-of-a-mat-object-is-with-mattype-in-opencv
// for pixel a pixel type table
switch (img_.type())
{
case CV_8U:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_BYTE, img_.data);
break;
case CV_16U:
case CV_16UC3:
case 26:
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
case CV_16UC4:
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_UNSIGNED_SHORT, img_.data);
break;
case 5:
case 29:
glPixelStorei(GL_UNPACK_ALIGNMENT, 1);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, width, height, 0, GL_RGBA, GL_FLOAT, img_.data);
case CV_32F:
case CV_32FC4:
glTexImage2D(GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT, width, height, 0, GL_DEPTH_COMPONENT, GL_FLOAT,
img_.data);
break;
default:
glPixelStorei(GL_UNPACK_ROW_LENGTH, 0);
glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, img_.cols, img_.rows, 0, GL_RGBA, GL_UNSIGNED_BYTE, img_.data);
break;
}
+5 -5
View File
@@ -33,15 +33,15 @@ std::unique_ptr<pixelarium::render::IPixelariumImageView> pixelarium::render::Im
switch (type)
{
case imaging::ImageFileType::UNKNOWN:
case imaging::ImageFileType::ABSTRACT:
case imaging::ImageFileType::kUnknown:
case imaging::ImageFileType::kAbstract:
return {};
case imaging::ImageFileType::PNG:
case imaging::ImageFileType::JPG:
case imaging::ImageFileType::kPng:
case imaging::ImageFileType::kJpg:
log_.Info(std::format("{}: Creating a Default View", __PRETTY_FUNCTION__));
// beware: here we copy the actual image resource over to the new image
return std::make_unique<PixelariumImageViewDefault>(img);
case imaging::ImageFileType::CZI:
case imaging::ImageFileType::kCzi:
log_.Info(std::format("{}: Creating a CZI View", __PRETTY_FUNCTION__));
// beware: here we copy the actual image resource over to the new image
return std::make_unique<PixelariumImageViewCzi>(img, log_);
+1 -1
View File
@@ -51,7 +51,7 @@ void pixelarium::render::PixelariumImageViewCzi::ShowImage()
this->is_dirty_ = false;
}
if (czi_img->Empty() || this->img_->type_ == imaging::ImageFileType::UNKNOWN || !cached_image_ ||
if (czi_img->Empty() || this->img_->type_ == imaging::ImageFileType::kUnknown || !cached_image_ ||
czi_img->Name().empty())
{
// do nothing
+1 -1
View File
@@ -18,7 +18,7 @@ void pixelarium::render::PixelariumImageViewDefault::ShowImage()
this->is_dirty_ = false;
}
if (this->img_->Empty() || this->img_->type_ == imaging::ImageFileType::UNKNOWN || !cached_image_ ||
if (this->img_->Empty() || this->img_->type_ == imaging::ImageFileType::kUnknown || !cached_image_ ||
this->img_->Name().empty())
{
// do nothing