window.h
Go to the documentation of this file.
/*******************************************************
* Copyright (c) 2015-2019, ArrayFire
* All rights reserved.
*
* This file is distributed under 3-clause BSD license.
* The complete license agreement can be obtained at:
* http://arrayfire.com/licenses/BSD-3-Clause
********************************************************/
#pragma once
#include <fg/defines.h>
#include <fg/font.h>
#include <fg/image.h>
#include <fg/chart.h>
#include <fg/surface.h>
#include <fg/histogram.h>
#ifdef __cplusplus
extern "C" {
#endif
FGAPI fg_err fg_create_window(fg_window *pWindow,
const int pWidth, const int pHeight,
const char* pTitle,
const fg_window pShareWindow,
const bool pInvisible);
FGAPI fg_err fg_retain_window(fg_window *pOut, fg_window pWindow);
FGAPI fg_err fg_release_window(fg_window pWindow);
FGAPI fg_err fg_set_window_font(fg_window pWindow, const fg_font pFont);
FGAPI fg_err fg_set_window_title(fg_window pWindow, const char* pTitle);
FGAPI fg_err fg_set_window_position(fg_window pWindow, const int pX, const int pY);
FGAPI fg_err fg_set_window_size(fg_window pWindow, const unsigned pWidth, const unsigned pHeight);
FGAPI fg_err fg_set_window_colormap(fg_window pWindow, const fg_color_map pColorMap);
FGAPI fg_err fg_get_window_context_handle(long long *pContext, const fg_window pWindow);
FGAPI fg_err fg_get_window_display_handle(long long *pDisplay, const fg_window pWindow);
FGAPI fg_err fg_get_window_width(int *pWidth, const fg_window pWindow);
FGAPI fg_err fg_get_window_height(int *pHeight, const fg_window pWindow);
FGAPI fg_err fg_make_window_current(const fg_window pWindow);
FGAPI fg_err fg_hide_window(const fg_window pWindow);
FGAPI fg_err fg_show_window(const fg_window pWindow);
FGAPI fg_err fg_close_window(bool* pIsClosed, const fg_window pWindow);
FGAPI fg_err fg_draw_image(const fg_window pWindow, const fg_image pImage, const bool pKeepAspectRatio);
FGAPI fg_err fg_draw_chart(const fg_window pWindow, const fg_chart pChart);
FGAPI fg_err fg_draw_image_to_cell(const fg_window pWindow, const int pRows, const int pCols, const int pIndex,
const fg_image pImage, const char* pTitle, const bool pKeepAspectRatio);
FGAPI fg_err fg_draw_chart_to_cell(const fg_window pWindow, const int pRows, const int pCols, const int pIndex,
const fg_chart pChart, const char* pTitle);
FGAPI fg_err fg_swap_window_buffers(const fg_window pWindow);
FGAPI fg_err fg_save_window_framebuffer(const char* pFullPath, const fg_window pWindow);
#ifdef __cplusplus
}
#endif
#ifdef __cplusplus
namespace forge
{
class Window {
private:
fg_window mValue;
Window() {}
public:
FGAPI Window(const int pWidth, const int pHeight, const char* pTitle,
const Window* pWindow=0, const bool invisible = false);
FGAPI Window(const Window& other);
FGAPI ~Window();
FGAPI void setFont(Font* pFont);
FGAPI void setTitle(const char* pTitle);
FGAPI void setPos(const int pX, const int pY);
FGAPI void setSize(const unsigned pWidth, const unsigned pHeight);
FGAPI void setColorMap(const ColorMap cmap);
FGAPI long long context() const;
FGAPI long long display() const;
FGAPI int width() const;
FGAPI int height() const;
FGAPI fg_window get() const;
FGAPI void makeCurrent();
FGAPI void hide();
FGAPI void show();
FGAPI bool close();
FGAPI void draw(const Image& pImage, const bool pKeepAspectRatio=true);
FGAPI void draw(const Chart& pChart);
FGAPI void draw(const int pRows, const int pCols, const int pIndex,
const Image& pImage, const char* pTitle=0, const bool pKeepAspectRatio=true);
FGAPI void draw(const int pRows, const int pCols, const int pIndex,
const Chart& pChart, const char* pTitle = 0);
FGAPI void swapBuffers();
FGAPI void saveFrameBuffer(const char* pFullPath);
};
}
#endif
chart.h
forge::Chart
Chart is base canvas where other plottable objects are rendered.
Definition chart.h:316
forge::Font
Font object is essentially a resource handler for the specific font you want to use.
Definition font.h:86
forge::Image
Image is plain rendering of an image over the window or sub-region of it.
Definition image.h:174
forge::Window::setColorMap
FGAPI void setColorMap(const ColorMap cmap)
Set the colormap to be used for subsequent rendering calls.
forge::Window::width
FGAPI int width() const
forge::Window::hide
FGAPI void hide()
Hide the window.
forge::Window::~Window
FGAPI ~Window()
Window Destructor.
forge::Window::setTitle
FGAPI void setTitle(const char *pTitle)
Set the window title.
forge::Window::draw
FGAPI void draw(const Image &pImage, const bool pKeepAspectRatio=true)
Render an Image to Window.
forge::Window::setFont
FGAPI void setFont(Font *pFont)
Set font to be used by the window to draw text.
forge::Window::draw
FGAPI void draw(const Chart &pChart)
Render a chart to Window.
forge::Window::saveFrameBuffer
FGAPI void saveFrameBuffer(const char *pFullPath)
Save window frame buffer to give location in provided image format.
forge::Window::close
FGAPI bool close()
Check if the window is ready for close.
forge::Window::height
FGAPI int height() const
forge::Window::draw
FGAPI void draw(const int pRows, const int pCols, const int pIndex, const Image &pImage, const char *pTitle=0, const bool pKeepAspectRatio=true)
Render Image to given sub-region of the window in multiview mode.
forge::Window::get
FGAPI fg_window get() const
forge::Window::Window
FGAPI Window(const Window &other)
Copy constructor for Window.
forge::Window::context
FGAPI long long context() const
Get rendering backend context handle.
forge::Window::setSize
FGAPI void setSize(const unsigned pWidth, const unsigned pHeight)
Set the size of the window programmatically.
forge::Window::draw
FGAPI void draw(const int pRows, const int pCols, const int pIndex, const Chart &pChart, const char *pTitle=0)
Render the chart to given sub-region of the window in multiview mode.
forge::Window::swapBuffers
FGAPI void swapBuffers()
Swaps background buffer with front buffer.
forge::Window::display
FGAPI long long display() const
Get Native Window display handle.
forge::Window::show
FGAPI void show()
Show the window if hidden, otherwise no effect.
forge::Window::setPos
FGAPI void setPos(const int pX, const int pY)
Set the start position where the window will appear.
forge::Window::Window
FGAPI Window(const int pWidth, const int pHeight, const char *pTitle, const Window *pWindow=0, const bool invisible=false)
Creates a Window object.
forge::Window::makeCurrent
FGAPI void makeCurrent()
Make the current window's rendering context active context.
defines.h
FGAPI
#define FGAPI
Definition defines.h:28
fg_chart
void * fg_chart
Definition defines.h:42
fg_color_map
fg_color_map
Color maps.
Definition defines.h:125
fg_font
void * fg_font
Definition defines.h:41
fg_err
fg_err
Definition defines.h:49
fg_image
void * fg_image
Definition defines.h:43
fg_window
void * fg_window
Definition defines.h:40
font.h
fg_get_window_width
FGAPI fg_err fg_get_window_width(int *pWidth, const fg_window pWindow)
Get the width of Window.
fg_draw_chart_to_cell
FGAPI fg_err fg_draw_chart_to_cell(const fg_window pWindow, const int pRows, const int pCols, const int pIndex, const fg_chart pChart, const char *pTitle)
Render given chart to Window's particular sub-view.
fg_create_window
FGAPI fg_err fg_create_window(fg_window *pWindow, const int pWidth, const int pHeight, const char *pTitle, const fg_window pShareWindow, const bool pInvisible)
Create a Window object.
fg_set_window_colormap
FGAPI fg_err fg_set_window_colormap(fg_window pWindow, const fg_color_map pColorMap)
Set the colormap to be used by the Window Object.
fg_close_window
FGAPI fg_err fg_close_window(bool *pIsClosed, const fg_window pWindow)
Check if the Window is closed.
fg_make_window_current
FGAPI fg_err fg_make_window_current(const fg_window pWindow)
Make the window's backend specific context the active context in given thread.
fg_save_window_framebuffer
FGAPI fg_err fg_save_window_framebuffer(const char *pFullPath, const fg_window pWindow)
Save the current frame buffer to a file at provided path.
fg_draw_chart
FGAPI fg_err fg_draw_chart(const fg_window pWindow, const fg_chart pChart)
Render given chart to Window.
fg_show_window
FGAPI fg_err fg_show_window(const fg_window pWindow)
Show the Window.
fg_retain_window
FGAPI fg_err fg_retain_window(fg_window *pOut, fg_window pWindow)
Increment the internal reference count for Window.
fg_get_window_context_handle
FGAPI fg_err fg_get_window_context_handle(long long *pContext, const fg_window pWindow)
Get the backend specific context handle of Window.
fg_draw_image_to_cell
FGAPI fg_err fg_draw_image_to_cell(const fg_window pWindow, const int pRows, const int pCols, const int pIndex, const fg_image pImage, const char *pTitle, const bool pKeepAspectRatio)
Render given image to Window's particular sub-view.
fg_get_window_display_handle
FGAPI fg_err fg_get_window_display_handle(long long *pDisplay, const fg_window pWindow)
Get the display device handle of Window.
fg_swap_window_buffers
FGAPI fg_err fg_swap_window_buffers(const fg_window pWindow)
Swap back buffer with front buffer.
fg_set_window_title
FGAPI fg_err fg_set_window_title(fg_window pWindow, const char *pTitle)
Set the title of Window Object.
fg_set_window_size
FGAPI fg_err fg_set_window_size(fg_window pWindow, const unsigned pWidth, const unsigned pHeight)
Set the window dimensions of Window Object.
fg_set_window_position
FGAPI fg_err fg_set_window_position(fg_window pWindow, const int pX, const int pY)
Set the window origin of Window Object w.r.t screen origin.
fg_draw_image
FGAPI fg_err fg_draw_image(const fg_window pWindow, const fg_image pImage, const bool pKeepAspectRatio)
Render given image to Window.
fg_hide_window
FGAPI fg_err fg_hide_window(const fg_window pWindow)
Hide the Window.
fg_get_window_height
FGAPI fg_err fg_get_window_height(int *pHeight, const fg_window pWindow)
Get the height of Window.
fg_set_window_font
FGAPI fg_err fg_set_window_font(fg_window pWindow, const fg_font pFont)
Set font object to be used by Window Object.
fg_release_window
FGAPI fg_err fg_release_window(fg_window pWindow)
Destroy Window Object.
histogram.h
image.h
forge
Definition chart.h:305
forge::ColorMap
fg_color_map ColorMap
Definition defines.h:183
surface.h