This example requires Qt5 >= 5.9 setup for building.
11#include <cvb/ui/image_view.hpp>
12#include <cvb/image.hpp>
14int main(
int argc,
char* argv[])
41 titleStream <<
"(X:" << mousePos.
X() <<
", Y:" << mousePos.
Y() <<
") (R:"
42 << qFloor(pixelVal[0]) <<
", G:" << qFloor(pixelVal[1]) <<
", B:" << qFloor(pixelVal[2]) <<
")";
static std::unique_ptr< Image > Load(const String &fileName)
Loads an image with the given file name.
Definition: detail_image.hpp:32
T X() const noexcept
Gets the x-component of the point.
Definition: point_2d.hpp:86
T Y() const noexcept
Gets the y-component of the point.
Definition: point_2d.hpp:106
View to display an image.
Definition: decl_image_view.hpp:75
Cvb::EventCookie RegisterEventMouseMoved(std::function< void(Cvb::Point2D< int >, const std::vector< double > &)> handler)
Register a callback to get pixel values under the moving mouse.
Definition: detail_image_view.hpp:243
void SetUploadMode(Cvb::UI::UploadMode uploadMode)
Set the current upload mode.
Definition: decl_image_view.hpp:354
void Refresh(Cvb::UI::RefreshMode refreshMode)
Refresh the view using a specified mode.
Definition: detail_image_view.hpp:68
void SetRenderEngine(Cvb::UI::RenderEngine renderEngine)
Set the current render engine.
Definition: detail_image_view.hpp:238
QString CvbToQt(const Cvb::String &text) noexcept
Convenience converter for strings.
Definition: ui.hpp:254