riCOM_cpp
This repository contains the C++ implementation of the riCOM (Real Time Centre Of Mass) algorithm for 4D Scanning electron microscopy.
SdlImageWindow.h
Go to the documentation of this file.
1 /* Copyright (C) 2021 Thomas Friedrich, Chu-Ping Yu,
2  * University of Antwerp - All Rights Reserved.
3  * You may use, distribute and modify
4  * this code under the terms of the GPL3 license.
5  * You should have received a copy of the GPL3 license with
6  * this file. If not, please visit:
7  * https://www.gnu.org/licenses/gpl-3.0.en.html
8  *
9  * Authors:
10  * Thomas Friedrich <thomas.friedrich@uantwerpen.be>
11  * Chu-Ping Yu <chu-ping.yu@uantwerpen.be>
12  */
13 
14 #ifndef SDLIMAGEWINDOW_H
15 #define SDLIMAGEWINDOW_H
16 
17 #include <SDL.h>
18 #include <SDL_image.h>
19 #include <SDL_opengl.h>
20 #include <iostream>
21 
23 {
24 public:
25  const char *title; // Window title
26  explicit SdlImageWindow(const char *title);
27  explicit SdlImageWindow(const char *title, SDL_Surface *srf, int nx, int ny, float scale);
28  void create_window(SDL_Surface *srf, int nx, int ny, float scale);
29  void update_image();
30 
31 private:
32  SDL_Window *window; // Pointer for the window
33  SDL_Renderer *renderer; // Pointer for the renderer
34  SDL_Texture *tex; // Texture for the window
35  SDL_Surface *srf; // Surface (data source)
36 };
37 #endif // SDLIMAGEWINDOW_H
const char * title
void create_window(SDL_Surface *srf, int nx, int ny, float scale)
SdlImageWindow(const char *title)