This project is an image viewer built using Qt6, C++, and Vulkan. It supports BMP, PNG, and JPG images and provides essential viewing features such as pan, zoom, and scrolling. The application utilizes Vulkan for rendering and implements custom shaders for efficient image processing.
- Supported Image Formats: BMP, PNG, JPG.
- Pan & Scrolling:
- Panning occurs while holding the left mouse button and dragging.
- Scrolling is handled using the mouse's horizontal and vertical scrolls.
- Zooming:
- Supports zoom levels from 10% to 1600%.
- Linear Resampling for zoom levels below 100%.
- Pixelation for zoom levels above 100%, displaying each pixel as an n×n block up to 1600%.
- Integral Zoom Levels above 100% (200%, 300%, ..., 1600%).
- Zoom to Pixel: Ensures that the mouse pointer remains focused on the exact pixel it was pointing to before zooming.
- Zooming is activated by holding the Control button and using the mouse scroll.
- Vulkan Integration:
- Custom Vulkan swapchain.
- Vertex and fragment shaders for optimized rendering.
- File Open Dialog: Allows users to select and load images.
Ensure the following dependencies are installed before building:
- Qt6 (with Vulkan support)
- Vulkan SDK
- CMake
- C++14 or later
- Install Dependencies:
- Download and install the Vulkan SDK.
- Install Qt6 with Vulkan support.
- Clone the Repository:
git clone https://github.com/HosseinAssaran/VulkanImageViewer.git cd VulkanImageViewer
- Set Up Environment Variables:
export CMAKE_PREFIX_PATH=~/Qt/6.8.1/gcc_64/lib/cmake/Qt6/
- Configure the Project:
mkdir build && cd build cmake ..
- Build the Project:
cmake --build .
- Run the Application:
./vulkanimageviewer
- Open Image: Use the file dialog to load an image.
- Zooming:
- Hold
Ctrl
and use the mouse scroll to zoom in/out. - The zooming maintains focus on the exact pixel under the pointer.
- Hold
- Panning:
- Click and drag with the left mouse button.
- Use arrow keys for navigation.
- Scrolling:
- Use the mouse's vertical and horizontal scroll.
- Rendering Pipeline:
- Uses Vulkan swapchain for efficient image rendering.
- Implements vertex and fragment shaders.
- Supports different resampling methods (linear resampling for zoom < 100%, pixelation for zoom ≥ 100%).
- Memory Management:
- Uses Vulkan buffers for optimized image loading and rendering.
- The project has been built and tested on Ubuntu and can be compiled on any Linux-based system.
This project is licensed under the GNU Affero General Public License v3.0 (AGPL-3.0).
Feel free to fork and submit pull requests to improve the project.
For more details, visit the GitHub Repository.