VisuGlExtBg

VisuGlExtBg — Handle the background colour and the fog.

Functions

Properties

Types and Values

Object Hierarchy

    GObject
    ╰── ToolDbgObj
        ╰── VisuGlExt
            ╰── VisuGlExtBg

Description

This module is used to support a background colour and to tune the fog. This last one can be turn on or off and its colour can be either a user defined one or the one of the background. The fog is a linear blending into the fog colour. It starts at a given z position (in the camera basis set) and ends at a lower z.

Functions

visu_gl_ext_bg_new ()

VisuGlExtBg *
visu_gl_ext_bg_new (const gchar *name);

Creates a new VisuGlExt to draw bg.

Parameters

name

the name to give to the extension (default is VISU_GL_EXT_BG_ID).

[allow-none]

Returns

a pointer to the VisuGlExt it created or NULL otherwise.

Since: 3.7


visu_gl_ext_bg_setFile ()

gboolean
visu_gl_ext_bg_setFile (VisuGlExtBg *bg,
                        const gchar *path,
                        GError **error);

Loads path and store it as a background image for the scene, see visu_gl_ext_bg_setImage().

Parameters

bg

a VisuGlExtBg object.

 

path

a file path

 

error

an error location.

 

Returns

FALSE if an error occured.

Since: 3.8


visu_gl_ext_bg_setImage ()

void
visu_gl_ext_bg_setImage (VisuGlExtBg *bg,
                         const guchar *imageData,
                         guint width,
                         guint height,
                         gboolean alpha,
                         const gchar *title,
                         gboolean fit);

Draw the imageData on the background. The image is scaled to the viewport dimensions, keeping the width/height ratio, if fit is set to TRUE. If title is not NULL, the title is also printed on the background. The image data are copied and can be free after this call.

Parameters

bg

a VisuGlExtBg object.

 

imageData

raw image data in RGB or RGBA format ;.

[allow-none]

width

the width ;

 

height

the height ;

 

alpha

TRUE if the image is RGBA ;

 

title

an optional title (can be NULL).

[allow-none]

fit

a boolean (default is TRUE).

 

visu_gl_ext_bg_setFollowCamera ()

gboolean
visu_gl_ext_bg_setFollowCamera (VisuGlExtBg *bg,
                                gboolean follow,
                                float zoomInit,
                                float xs,
                                float ys);

When follow is TRUE, the size and the position of the background image is adjusted with every camera change.

Parameters

bg

a VisuGlExtBg object.

 

follow

a boolean.

 

zoomInit

a floating point value.

 

xs

a floating point value.

 

ys

a floating point value.

 

Returns

TRUE if the following status has been changed.

Since: 3.7


visu_gl_ext_bg_setCamera ()

gboolean
visu_gl_ext_bg_setCamera (VisuGlExtBg *bg,
                          float zoom,
                          float xs,
                          float ys);

If the background image is in follow mode, see visu_gl_ext_bg_setFollowCamera(), this routine is used to update the current camera settings of the background image.

Parameters

bg

a VisuGlExtBg object.

 

zoom

a floating point value.

 

xs

a floating point value.

 

ys

a floating point value.

 

Returns

TRUE if the settings are indeed changed.

Since: 3.7

Types and Values

VISU_GL_EXT_BG_ID

#define VISU_GL_EXT_BG_ID "Background"

The id used to identify this extension, see visu_gl_ext_rebuild() for instance.

Property Details

The “background-file” property

  “background-file”          gchar *

path to the background image.

Flags: Read / Write

Default value: ""


The “display-background-filename” property

  “display-background-filename” gboolean

display or not the background filename.

Flags: Read / Write

Default value: FALSE