Forge: window.h Source File

Forge

- Main Page
- Namespaces
- Data Structures
- Files

- File List
- Globals

window.h
Go to the documentation of this file.
1 /*******************************************************
2 * Copyright (c) 2015-2019, ArrayFire
3 * All rights reserved.
4 *
5 * This file is distributed under 3-clause BSD license.
6 * The complete license agreement can be obtained at:
7 * http://arrayfire.com/licenses/BSD-3-Clause
8 ********************************************************/
9
10 #pragma once
11
12 #include <fg/defines.h>
13 #include <fg/font.h>
14 #include <fg/image.h>
15 #include <fg/plot.h>
16 #include <fg/plot3.h>
17 #include <fg/surface.h>
18 #include <fg/histogram.h>
19
20 namespace internal
21 {
22 class _Window;
23 }
24
25 namespace fg
26 {
27
33 class Window {
34 private:
35 internal::_Window* value;
36
37 Window() {}
38
39 public:
52 FGAPI Window(int pWidth, int pHeight, const char* pTitle,
53 const Window* pWindow=0, const bool invisible = false);
54
60 FGAPI Window(const Window& other);
61
65 FGAPI ~Window();
66
72 FGAPI void setFont(Font* pFont);
73
79 FGAPI void setTitle(const char* pTitle);
80
87 FGAPI void setPos(int pX, int pY);
88
95 FGAPI void setSize(unsigned pWidth, unsigned pHeight);
96
102 FGAPI void setColorMap(ColorMap cmap);
103
108 FGAPI long long context() const;
109
114 FGAPI long long display() const;
115
119 FGAPI int width() const;
120
124 FGAPI int height() const;
125
129 FGAPI internal::_Window* get() const;
130
134 FGAPI void makeCurrent();
135
139 FGAPI void hide();
140
144 FGAPI void show();
145
153 FGAPI bool close();
154
164 FGAPI void draw(const Image& pImage, const bool pKeepAspectRatio=true);
165
175 FGAPI void draw(const Plot& pPlot);
176
186 FGAPI void draw(const Plot3& pPlot3);
187
197 FGAPI void draw(const Surface& pSurface);
207 FGAPI void draw(const Histogram& pHist);
208
218 FGAPI void grid(int pRows, int pCols);
219
237 FGAPI void draw(int pColId, int pRowId, const Image& pImage, const char* pTitle=0, const bool pKeepAspectRatio=true);
238
256 FGAPI void draw(int pColId, int pRowId, const Plot& pPlot, const char* pTitle = 0);
257
258
276 FGAPI void draw(int pColId, int pRowId, const Plot3& pPlot3, const char* pTitle = 0);
277
295 FGAPI void draw(int pColId, int pRowId, const Surface& pSurface, const char* pTitle = 0);
296
314 FGAPI void draw(int pColId, int pRowId, const Histogram& pHist, const char* pTitle = 0);
315
322 FGAPI void swapBuffers();
323 };
324
325 }
fg::Window::swapBuffers
FGAPI void swapBuffers()
Swaps background OpenGL buffer with front buffer.
fg::Histogram
Bar graph to display data frequencey.
Definition: histogram.h:27
fg::Plot
Line graph to display plots.
Definition: plot.h:27
fg::Window::makeCurrent
FGAPI void makeCurrent()
Make the current window's OpenGL context active context.
fg
Definition: CPUCopy.hpp:13
fg::ColorMap
ColorMap
Color maps.
Definition: defines.h:110
fg::Plot3
3d graph to display 3d line plots.
Definition: plot3.h:27
fg::Window::setSize
FGAPI void setSize(unsigned pWidth, unsigned pHeight)
Set the size of the window programmatically.
surface.h
fg::Window::display
FGAPI long long display() const
Get Native Window display handle.
font.h
fg::Window::context
FGAPI long long context() const
Get OpenGL context handle.
fg::Window::hide
FGAPI void hide()
Hide the window.
fg::Window
Window is where other objects such as Images, Plots etc.
Definition: window.h:33
plot3.h
FGAPI
#define FGAPI
Definition: defines.h:32
defines.h
fg::Window::setPos
FGAPI void setPos(int pX, int pY)
Set the start position where the window will appear.
internal
Definition: font.h:13
fg::Window::setFont
FGAPI void setFont(Font *pFont)
Set font to be used by the window to draw text.
fg::Window::width
FGAPI int width() const
image.h
fg::Font
Font object is essentially a resource handler for the specific font you want to use.
Definition: font.h:26
histogram.h
fg::Window::setTitle
FGAPI void setTitle(const char *pTitle)
Set the window title.
plot.h
fg::Surface
3d graph to display plots.
Definition: surface.h:27
fg::Window::draw
FGAPI void draw(const Image &pImage, const bool pKeepAspectRatio=true)
Render an Image to Window.
fg::Window::setColorMap
FGAPI void setColorMap(ColorMap cmap)
Set the colormap to be used for subsequent rendering calls.
fg::Window::close
FGAPI bool close()
Check if the window is ready for close.
fg::Window::height
FGAPI int height() const
fg::Window::grid
FGAPI void grid(int pRows, int pCols)
Setup grid layout for multivew mode.
fg::Window::~Window
FGAPI ~Window()
Window Destructor.
fg::Window::show
FGAPI void show()
Show the window if hidden, otherwise no effect.
fg::Image
Definition: image.h:25