GimpScanConvert

GimpScanConvert

Synopsis

                    GimpScanConvert;
GimpScanConvert *   gimp_scan_convert_new               (void);
void                gimp_scan_convert_free              (GimpScanConvert *sc);
void                gimp_scan_convert_set_pixel_ratio   (GimpScanConvert *sc,
                                                         gdouble ratio_xy);
void                gimp_scan_convert_set_clip_rectangle
                                                        (GimpScanConvert *sc,
                                                         gint x,
                                                         gint y,
                                                         gint width,
                                                         gint height);
void                gimp_scan_convert_add_polyline      (GimpScanConvert *sc,
                                                         guint n_points,
                                                         const GimpVector2 *points,
                                                         gboolean closed);
void                gimp_scan_convert_add_bezier        (GimpScanConvert *sc,
                                                         const GimpBezierDesc *bezier);
void                gimp_scan_convert_stroke            (GimpScanConvert *sc,
                                                         gdouble width,
                                                         GimpJoinStyle join,
                                                         GimpCapStyle cap,
                                                         gdouble miter,
                                                         gdouble dash_offset,
                                                         GArray *dash_info);
void                gimp_scan_convert_render            (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y,
                                                         gboolean antialias);
void                gimp_scan_convert_render_full       (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y,
                                                         gboolean replace,
                                                         gboolean antialias,
                                                         guchar value);
void                gimp_scan_convert_render_value      (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y,
                                                         guchar value);
void                gimp_scan_convert_compose           (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y);
void                gimp_scan_convert_compose_value     (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y,
                                                         gint value);

Description

Details

GimpScanConvert

typedef struct _GimpScanConvert GimpScanConvert;


gimp_scan_convert_new ()

GimpScanConvert *   gimp_scan_convert_new               (void);

Create a new scan conversion context.

Returns :

a newly allocated GimpScanConvert context.

gimp_scan_convert_free ()

void                gimp_scan_convert_free              (GimpScanConvert *sc);

Frees the resources allocated for sc.

sc :

a GimpScanConvert context

gimp_scan_convert_set_pixel_ratio ()

void                gimp_scan_convert_set_pixel_ratio   (GimpScanConvert *sc,
                                                         gdouble ratio_xy);

Sets the pixel aspect ratio.

sc :

a GimpScanConvert context

ratio_xy :

the aspect ratio of the major coordinate axes

gimp_scan_convert_set_clip_rectangle ()

void                gimp_scan_convert_set_clip_rectangle
                                                        (GimpScanConvert *sc,
                                                         gint x,
                                                         gint y,
                                                         gint width,
                                                         gint height);

Sets a clip rectangle on sc. Subsequent render operations will be restricted to this area.

sc :

a GimpScanConvert context

x :

horizontal offset of clip rectangle

y :

vertical offset of clip rectangle

width :

width of clip rectangle

height :

height of clip rectangle

gimp_scan_convert_add_polyline ()

void                gimp_scan_convert_add_polyline      (GimpScanConvert *sc,
                                                         guint n_points,
                                                         const GimpVector2 *points,
                                                         gboolean closed);

Adds a bezier path to sc.

Please note that you should use gimp_scan_convert_stroke() if you specify open paths.

sc :

a GimpScanConvert context

gimp_scan_convert_add_bezier ()

void                gimp_scan_convert_add_bezier        (GimpScanConvert *sc,
                                                         const GimpBezierDesc *bezier);


gimp_scan_convert_stroke ()

void                gimp_scan_convert_stroke            (GimpScanConvert *sc,
                                                         gdouble width,
                                                         GimpJoinStyle join,
                                                         GimpCapStyle cap,
                                                         gdouble miter,
                                                         gdouble dash_offset,
                                                         GArray *dash_info);

Stroke the content of a GimpScanConvert. The next gimp_scan_convert_render() will result in the outline of the polygon defined with the commands above.

You cannot add additional polygons after this command.

Note that if you have nonstandard resolution, "width" gives the width (in pixels) for a vertical stroke, i.e. use the X resolution to calculate the width of a stroke when operating with real world units.

sc :

a GimpScanConvert context

width :

line width in pixels

join :

how lines should be joined

cap :

how to render the end of lines

miter :

convert a mitered join to a bevelled join if the miter would extend to a distance of more than miter times width from the actual join point

dash_offset :

offset to apply on the dash pattern

dash_info :

dash pattern or NULL for a solid line

gimp_scan_convert_render ()

void                gimp_scan_convert_render            (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y,
                                                         gboolean antialias);

This is a wrapper around gimp_scan_convert_render_full() that replaces the content of the tile_manager with a rendered form of the path passed in.

You cannot add additional polygons after this command.

sc :

a GimpScanConvert context

tile_manager :

the TileManager to render to

off_x :

horizontal offset into the tile_manager

off_y :

vertical offset into the tile_manager

antialias :

whether to apply antialiasiing

gimp_scan_convert_render_full ()

void                gimp_scan_convert_render_full       (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y,
                                                         gboolean replace,
                                                         gboolean antialias,
                                                         guchar value);

This function renders the area described by the path to the tile_manager, taking the offset off_x and off_y in the tilemanager into account. The rendering can happen antialiased and be rendered on top of existing content or replacing it completely. The value specifies the opacity value to be used for the objects in the sc.

This function expects a tile manager of depth 1.

You cannot add additional polygons after this command.

sc :

a GimpScanConvert context

tile_manager :

the TileManager to render to

off_x :

horizontal offset into the tile_manager

off_y :

vertical offset into the tile_manager

replace :

if true the original content of the tile_manager gets destroyed

antialias :

if true the rendering happens antialiased

value :

value to use for covered pixels

gimp_scan_convert_render_value ()

void                gimp_scan_convert_render_value      (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y,
                                                         guchar value);

This is a wrapper around gimp_scan_convert_render_full() that doesn't do antialiasing but gives control over the value that should be used for pixels covered by the scan conversion. Uncovered pixels are set to zero.

You cannot add additional polygons after this command.

sc :

a GimpScanConvert context

tile_manager :

the TileManager to render to

off_x :

horizontal offset into the tile_manager

off_y :

vertical offset into the tile_manager

value :

value to use for covered pixels

gimp_scan_convert_compose ()

void                gimp_scan_convert_compose           (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y);

This is a wrapper around of gimp_scan_convert_render_full() that composes the (aliased) scan conversion on top of the content of the tile_manager.

You cannot add additional polygons after this command.

sc :

a GimpScanConvert context

tile_manager :

the TileManager to render to

off_x :

horizontal offset into the tile_manager

off_y :

vertical offset into the tile_manager

gimp_scan_convert_compose_value ()

void                gimp_scan_convert_compose_value     (GimpScanConvert *sc,
                                                         TileManager *tile_manager,
                                                         gint off_x,
                                                         gint off_y,
                                                         gint value);

This is a wrapper around gimp_scan_convert_render_full() that composes the (aliased) scan conversion with value value on top of the content of the tile_manager.

You cannot add additional polygons after this command.

sc :

a GimpScanConvert context

tile_manager :

the TileManager to render to

off_x :

horizontal offset into the tile_manager

off_y :

vertical offset into the tile_manager

value :

value to use for covered pixels