Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for wider channel size in f3d::image #858

Merged
merged 24 commits into from
Jul 10, 2023
Prev Previous commit
Next Next commit
review mw
  • Loading branch information
Meakk committed Jul 10, 2023
commit a84339dee6454fe7b9618ade765f88aa1bc2bc92
1 change: 1 addition & 0 deletions application/F3DConfig.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ namespace F3D
const std::string PluginsInstallDir = "@F3D_PLUGINS_INSTALL_DIR@";
}

// TODO: Use CMake definitions and get rid of these
#cmakedefine01 F3D_MACOS_BUNDLE
#cmakedefine01 F3D_MODULE_RAYTRACING
#cmakedefine01 F3D_MODULE_EXR
Expand Down
1 change: 1 addition & 0 deletions library/VTKExtensions/Core/vtkF3DConfigure.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
static const std::string F3D_RESERVED_STRING = "f3d_reserved";
static const std::string F3D_EXIT_HOTKEY_SYM = "Escape";

// TODO: Use CMake definitions and get rid of these
#cmakedefine01 F3D_WINDOWS_GUI

#cmakedefine01 F3D_MODULE_EXTERNAL_RENDERING
Expand Down
2 changes: 2 additions & 0 deletions library/public/image.h
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,8 @@ class F3D_EXPORT image
/**
* Set/Get image buffer data.
* Its size is expected to be `width * height * channelCount * typeSize`.
Meakk marked this conversation as resolved.
Show resolved Hide resolved
*
* \deprecated { setData and getData are deprecated, use setContent and getContent instead }
*/
Meakk marked this conversation as resolved.
Show resolved Hide resolved
image& setContent(void* buffer);
void* getContent() const;
Expand Down
2 changes: 1 addition & 1 deletion library/testing/TestSDKExternalWindowQT.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ class F3DWindow : public QOpenGLWindow
QImage frameBuffer = grabFramebuffer().mirrored().convertToFormat(QImage::Format_RGB888);

f3d::image img(frameBuffer.width(), frameBuffer.height(), 3);
img.setData(frameBuffer.bits());
img.setContent(frameBuffer.bits());

if (!TestSDKHelpers::RenderTest(
img, this->mBaselinePath, this->mOutputPath, "TestSDKExternalWindowQT"))
Expand Down
5 changes: 4 additions & 1 deletion python/F3DPythonBindings.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -258,8 +258,10 @@ PYBIND11_MODULE(f3d, module)
.def_static("getReadersInfo", &f3d::engine::getReadersInfo)
.def_static("getPluginsList", &f3d::engine::getPluginsList);

// deprecated functions, will be removed in the next major release
// deprecated functions, will be removed in the next major release, F3D v3.0.0
#ifndef F3D_NO_DEPRECATED
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
image.def("setResolution",
[](f3d::image& img, unsigned int width, unsigned height)
{
Expand Down Expand Up @@ -288,5 +290,6 @@ PYBIND11_MODULE(f3d, module)
PyErr_WarnEx(PyExc_DeprecationWarning, "getData is deprecated, use getContent instead.", 1);
getImageBytes(img);
});
#pragma GCC diagnostic pop
#endif
}