Commit f28ec4bf authored by Michael Natterer's avatar Michael Natterer 😴

libgimpbase: always allocate GimpPixPipeParams.placement, add docs

parent 8bd4a4fa
......@@ -61,10 +61,11 @@ gimp_pixpipe_params_init (GimpPixPipeParams *params)
params->dim = 1;
params->cols = 1;
params->rows = 1;
params->placement = "constant";
params->free_placement_string = FALSE;
params->placement = g_strdup ("constant");
for (i = 0; i < GIMP_PIXPIPE_MAXDIM; i++)
params->selection[i] = g_strdup ("random");
params->rank[0] = 1;
for (i = 1; i < GIMP_PIXPIPE_MAXDIM; i++)
params->rank[i] = 0;
......@@ -133,8 +134,8 @@ gimp_pixpipe_params_parse (const gchar *string,
{
if (r)
{
g_free (params->placement);
params->placement = g_strdup (r + 1);
params->free_placement_string = TRUE;
}
}
else if (strncmp (p, "rank", strlen ("rank")) == 0 && r)
......@@ -196,9 +197,8 @@ gimp_pixpipe_params_free (GimpPixPipeParams *params)
{
gint i;
g_free (params->placement);
for (i = 0; i < GIMP_PIXPIPE_MAXDIM; i++)
g_free (params->selection[i]);
if (params->free_placement_string)
g_free (params->placement);
}
......@@ -40,6 +40,23 @@ G_BEGIN_DECLS
typedef struct _GimpPixPipeParams GimpPixPipeParams;
/**
* GimpPixPipeParams:
* @step: Step
* @ncells: Number of cells
* @dim: Dimension
* @cols: Columns
* @rows: Rows
* @cellwidth: Cell width
* @cellheight: Cell height
* @placement: Placement
* @free_placement_string: Unused, ignore
* @rank: Rank
* @selection: Selection
* @free_selection_string: Unused, ignore
*
* PLease somebody help documenting this.
**/
struct _GimpPixPipeParams
{
gint step;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment