Ewl_Histogram: A Simple Histogram widget
Detailed Description
- Remarks:
- Inherits from Ewl_Image.
Tutorial
Data Structures | |
struct | Ewl_Histogram |
Inherit from the Ewl_Image and extends to create a histogram widget. More... | |
Defines | |
#define | EWL_HISTOGRAM(histogram) ((Ewl_Histogram *)histogram) |
#define | EWL_HISTOGRAM_IS(w) (ewl_widget_type_is(EWL_WIDGET(w), EWL_HISTOGRAM_TYPE)) |
#define | EWL_HISTOGRAM_TYPE "histogram" |
Typedefs | |
typedef struct Ewl_Histogram | Ewl_Histogram |
Functions | |
void | ewl_histogram_cb_configure (Ewl_Widget *w, void *event, void *data) |
Ewl_Histogram_Channel | ewl_histogram_channel_get (Ewl_Histogram *histogram) |
Sets the color channel to graph in the histogram. | |
void | ewl_histogram_channel_set (Ewl_Histogram *histogram, Ewl_Histogram_Channel channel) |
Sets the color channel to graph in the histogram. | |
void | ewl_histogram_color_get (Ewl_Histogram *histogram, unsigned int *r, unsigned int *g, unsigned int *b, unsigned int *a) |
Get the current color values for drawing the histogram. | |
void | ewl_histogram_color_set (Ewl_Histogram *histogram, unsigned int r, unsigned int g, unsigned int b, unsigned int a) |
Changes the drawing color of a histogram. | |
Ewl_Image * | ewl_histogram_image_get (Ewl_Histogram *histogram) |
Get the source image used to generate the histogram. | |
void | ewl_histogram_image_set (Ewl_Histogram *histogram, Ewl_Image *image) |
Change the source image used to generate the histogram. | |
int | ewl_histogram_init (Ewl_Histogram *histogram) |
Initialize a histogram widget to starting values. | |
Ewl_Widget * | ewl_histogram_new (void) |
Create a new Ewl_Histogram widget. |
Define Documentation
#define EWL_HISTOGRAM | ( | histogram | ) | ((Ewl_Histogram *)histogram) |
Typecast a pointer to an Ewl_Histogram pointer.
Referenced by ewl_histogram_cb_configure().
#define EWL_HISTOGRAM_IS | ( | w | ) | (ewl_widget_type_is(EWL_WIDGET(w), EWL_HISTOGRAM_TYPE)) |
Returns TRUE if the widget is an Ewl_Histogram, FALSE otherwise
#define EWL_HISTOGRAM_TYPE "histogram" |
The type name for the Ewl_Histogram widget
Referenced by ewl_histogram_cb_configure(), ewl_histogram_channel_get(), ewl_histogram_channel_set(), ewl_histogram_color_get(), ewl_histogram_color_set(), ewl_histogram_image_get(), ewl_histogram_image_set(), and ewl_histogram_init().
Typedef Documentation
typedef struct Ewl_Histogram Ewl_Histogram |
The Ewl_Histogram
Function Documentation
void ewl_histogram_cb_configure | ( | Ewl_Widget * | w, | |
void * | event, | |||
void * | data | |||
) |
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_HISTOGRAM, and EWL_HISTOGRAM_TYPE.
Referenced by ewl_histogram_init().
Ewl_Histogram_Channel ewl_histogram_channel_get | ( | Ewl_Histogram * | hist | ) |
Sets the color channel to graph in the histogram.
- Parameters:
-
hist,: the histogram to change the channel drawn
- Returns:
- Returns the currently drawn color channel.
References channel, DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, EWL_HISTOGRAM_CHANNEL_Y, and EWL_HISTOGRAM_TYPE.
void ewl_histogram_channel_set | ( | Ewl_Histogram * | hist, | |
Ewl_Histogram_Channel | channel | |||
) |
Sets the color channel to graph in the histogram.
- Parameters:
-
hist,: the histogram to change the channel drawn channel,: the color channel to draw in the histogram
- Returns:
- Returns no value.
References channel, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_HISTOGRAM_TYPE, EWL_WIDGET, REALIZED, and source.
void ewl_histogram_color_get | ( | Ewl_Histogram * | hist, | |
unsigned int * | r, | |||
unsigned int * | g, | |||
unsigned int * | b, | |||
unsigned int * | a | |||
) |
Get the current color values for drawing the histogram.
- Parameters:
-
hist,: the histogram widget to retrieve display color r,: red value for histogram drawing color g,: green value for histogram drawing color b,: blue value for histogram drawing color a,: apha value for histogram drawing color
- Returns:
- Returns no value.
References Ewl_Color_Set::a, Ewl_Color_Set::b, color, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_HISTOGRAM_TYPE, Ewl_Color_Set::g, and Ewl_Color_Set::r.
void ewl_histogram_color_set | ( | Ewl_Histogram * | hist, | |
unsigned int | r, | |||
unsigned int | g, | |||
unsigned int | b, | |||
unsigned int | a | |||
) |
Changes the drawing color of a histogram.
- Parameters:
-
hist,: the histogram widget to change display color r,: red value for histogram drawing color g,: green value for histogram drawing color b,: blue value for histogram drawing color a,: apha value for histogram drawing color
- Returns:
- Returns no value.
References Ewl_Color_Set::a, Ewl_Color_Set::b, color, DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, EWL_HISTOGRAM_TYPE, EWL_WIDGET, ewl_widget_configure(), Ewl_Color_Set::g, and Ewl_Color_Set::r.
Ewl_Image* ewl_histogram_image_get | ( | Ewl_Histogram * | hist | ) |
Get the source image used to generate the histogram.
- Parameters:
-
hist,: the histogram to get source image
- Returns:
- Returns a pointer to the current source image.
References DCHECK_PARAM_PTR_RET, DCHECK_TYPE_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, EWL_HISTOGRAM_TYPE, EWL_IMAGE, and source.
void ewl_histogram_image_set | ( | Ewl_Histogram * | hist, | |
Ewl_Image * | image | |||
) |
Change the source image used to generate the histogram.
- Parameters:
-
hist,: the histogram to change source image image,: the new source image for the histogram
- Returns:
- Returns no value.
References DCHECK_PARAM_PTR, DCHECK_TYPE, DENTER_FUNCTION, DLEAVE_FUNCTION, DLEVEL_STABLE, ewl_callback_append(), EWL_CALLBACK_REVEAL, EWL_HISTOGRAM_TYPE, EWL_IMAGE_TYPE, EWL_WIDGET, REALIZED, and source.
int ewl_histogram_init | ( | Ewl_Histogram * | hist | ) |
Initialize a histogram widget to starting values.
- Parameters:
-
hist,: the histogram widget to initialize
- Returns:
- Returns TRUE on success, FALSE on failure.
References channel, DCHECK_PARAM_PTR_RET, DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_INT, ewl_callback_append(), EWL_CALLBACK_CONFIGURE, ewl_histogram_cb_configure(), EWL_HISTOGRAM_CHANNEL_R, EWL_HISTOGRAM_TYPE, EWL_IMAGE, ewl_image_init(), EWL_OBJECT, ewl_object_preferred_inner_size_set(), EWL_WIDGET, ewl_widget_appearance_set(), and ewl_widget_inherit().
Referenced by ewl_histogram_new().
Ewl_Widget* ewl_histogram_new | ( | void | ) |
Create a new Ewl_Histogram widget.
- Returns:
- Returns a new Ewl_Histogram widget.
References DENTER_FUNCTION, DLEVEL_STABLE, DRETURN_PTR, ewl_histogram_init(), EWL_WIDGET, FREE, and NEW.