GIMP Library Reference Manual | ||||
---|---|---|---|---|
Top | Description |
enum GimpPixelFetcherEdgeMode; GimpPixelFetcher; GimpPixelFetcher * gimp_pixel_fetcher_new (GimpDrawable *drawable
,gboolean shadow
); void gimp_pixel_fetcher_set_edge_mode (GimpPixelFetcher *pf
,GimpPixelFetcherEdgeMode mode
); void gimp_pixel_fetcher_set_bg_color (GimpPixelFetcher *pf
,const GimpRGB *color
); void gimp_pixel_fetcher_get_pixel (GimpPixelFetcher *pf
,gint x
,gint y
,guchar *pixel
); void gimp_pixel_fetcher_put_pixel (GimpPixelFetcher *pf
,gint x
,gint y
,const guchar *pixel
); void gimp_pixel_fetcher_destroy (GimpPixelFetcher *pf
);
These functions provide neighbourhood-based algorithms which get dramatically slower on region boundaries, to the point where a special treatment for neighbourhoods which are completely inside a tile is called for. It hides the special treatment of tile borders, making plug-in code more readable and shorter.
typedef enum { GIMP_PIXEL_FETCHER_EDGE_NONE, GIMP_PIXEL_FETCHER_EDGE_WRAP, GIMP_PIXEL_FETCHER_EDGE_SMEAR, GIMP_PIXEL_FETCHER_EDGE_BLACK, GIMP_PIXEL_FETCHER_EDGE_BACKGROUND } GimpPixelFetcherEdgeMode;
GimpPixelFetcher * gimp_pixel_fetcher_new (GimpDrawable *drawable
,gboolean shadow
);
Initialize a pixel region from the drawable.
|
the GimpDrawable the new region will be attached to. |
|
a gboolean indicating whether the region is attached to
the shadow tiles or the real drawable tiles. |
Returns : |
a pointer to a GimpPixelRgn structure (or NULL). |
void gimp_pixel_fetcher_set_edge_mode (GimpPixelFetcher *pf
,GimpPixelFetcherEdgeMode mode
);
Change the edage mode of a previously initialized pixel region.
|
a pointer to a previously initialized GimpPixelFetcher. |
|
the new edge mode from GimpPixelFetcherEdgeMode. |
void gimp_pixel_fetcher_set_bg_color (GimpPixelFetcher *pf
,const GimpRGB *color
);
Change the background color of a previously initialized pixel region.
|
a pointer to a previously initialized GimpPixelFetcher. |
|
the color to be used as bg color. |
void gimp_pixel_fetcher_get_pixel (GimpPixelFetcher *pf
,gint x
,gint y
,guchar *pixel
);
Get a pixel from the pixel region.
|
a pointer to a previously initialized GimpPixelFetcher. |
|
the x coordinate of the pixel to get. |
|
the y coordinate of the pixel to get. |
|
the memory location where to return the pixel. |
void gimp_pixel_fetcher_put_pixel (GimpPixelFetcher *pf
,gint x
,gint y
,const guchar *pixel
);
Set a pixel in the pixel region.
|
a pointer to a previously initialized GimpPixelFetcher. |
|
the x coordinate of the pixel to set. |
|
the y coordinate of the pixel to set. |
|
the pixel to set. |
void gimp_pixel_fetcher_destroy (GimpPixelFetcher *pf
);
Close a previously initializd pixel region.
|
a pointer to a previously initialized GimpPixelFetcher. |