SwamiguiSpectrumCanvas

SwamiguiSpectrumCanvas

Synopsis

void                (*SwamiguiSpectrumDestroyNotify)    (double *spectrum,
                                                         guint size);
                    SwamiguiSpectrumCanvas;
void                swamigui_spectrum_canvas_set_data   (SwamiguiSpectrumCanvas *canvas,
                                                         double *spectrum,
                                                         guint size,
                                                         SwamiguiSpectrumDestroyNotify notify);
int                 swamigui_spectrum_canvas_pos_to_spectrum
                                                        (SwamiguiSpectrumCanvas *canvas,
                                                         int xpos);
int                 swamigui_spectrum_canvas_spectrum_to_pos
                                                        (SwamiguiSpectrumCanvas *canvas,
                                                         int index);

Object Hierarchy

  GObject
   +----GInitiallyUnowned
         +----GtkObject
               +----GnomeCanvasItem
                     +----SwamiguiSpectrumCanvas

Properties

  "adjustment"               GtkAdjustment*        : Read / Write
  "height"                   gint                  : Read / Write
  "start"                    guint                 : Read / Write
  "width"                    gint                  : Read / Write
  "x"                        gint                  : Read / Write
  "y"                        gint                  : Read / Write
  "zoom"                     gdouble               : Read / Write
  "zoom-ampl"                gdouble               : Read / Write

Description

Details

SwamiguiSpectrumDestroyNotify ()

void                (*SwamiguiSpectrumDestroyNotify)    (double *spectrum,
                                                         guint size);

This is a function type that gets called when a spectrum canvas item is destroyed. This function is responsible for freeing spectrum.

spectrum :

The spectrum data pointer as passed to swamigui_spectrum_canvas_set_data().

size :

The number of values in the spectrum array

SwamiguiSpectrumCanvas

typedef struct _SwamiguiSpectrumCanvas SwamiguiSpectrumCanvas;

swamigui_spectrum_canvas_set_data ()

void                swamigui_spectrum_canvas_set_data   (SwamiguiSpectrumCanvas *canvas,
                                                         double *spectrum,
                                                         guint size,
                                                         SwamiguiSpectrumDestroyNotify notify);

Set the spectrum data of a spectrum canvas item.

canvas :

Spectrum data canvas item

spectrum :

Spectrum data pointer

size :

Size of spectrum data (in values, not bytes)

notify :

Function callback for freeing spectrum data when spectrum canvas doesn't need it anymore.

swamigui_spectrum_canvas_pos_to_spectrum ()

int                 swamigui_spectrum_canvas_pos_to_spectrum
                                                        (SwamiguiSpectrumCanvas *canvas,
                                                         int xpos);

Convert an X pixel position to spectrum index.

canvas :

Spectrum canvas item

xpos :

X pixel position

Returns :

Spectrum index or -1 if out of range.

swamigui_spectrum_canvas_spectrum_to_pos ()

int                 swamigui_spectrum_canvas_spectrum_to_pos
                                                        (SwamiguiSpectrumCanvas *canvas,
                                                         int index);

Convert a spectrum index to x pixel position.

canvas :

Spectrum canvas item

index :

Spectrum index

Returns :

X position, or -1 if out of view.

Property Details

The "adjustment" property

  "adjustment"               GtkAdjustment*        : Read / Write

Adjustment control for scrolling.


The "height" property

  "height"                   gint                  : Read / Write

Height in pixels.

Allowed values: >= 0

Default value: 1


The "start" property

  "start"                    guint                 : Read / Write

Start index of spectrum in view.

Default value: 0


The "width" property

  "width"                    gint                  : Read / Write

Width in pixels.

Allowed values: >= 0

Default value: 1


The "x" property

  "x"                        gint                  : Read / Write

X position in pixels.

Allowed values: >= 0

Default value: 0


The "y" property

  "y"                        gint                  : Read / Write

Y position in pixels.

Allowed values: >= 0

Default value: 0


The "zoom" property

  "zoom"                     gdouble               : Read / Write

Zoom factor in indexes per pixel.

Allowed values: >= 0

Default value: 1


The "zoom-ampl" property

  "zoom-ampl"                gdouble               : Read / Write

Amplitude zoom factor.

Allowed values: >= 0

Default value: 1