GimpDisplayShell-transform

GimpDisplayShell-transform

Synopsis

void                gimp_display_shell_transform_coords (const GimpDisplayShell *shell,
                                                         const GimpCoords *image_coords,
                                                         GimpCoords *display_coords);
void                gimp_display_shell_untransform_coords
                                                        (const GimpDisplayShell *shell,
                                                         const GimpCoords *display_coords,
                                                         GimpCoords *image_coords);
void                gimp_display_shell_transform_xy     (const GimpDisplayShell *shell,
                                                         gdouble x,
                                                         gdouble y,
                                                         gint *nx,
                                                         gint *ny);
void                gimp_display_shell_untransform_xy   (const GimpDisplayShell *shell,
                                                         gint x,
                                                         gint y,
                                                         gint *nx,
                                                         gint *ny,
                                                         gboolean round);
void                gimp_display_shell_transform_xy_f   (const GimpDisplayShell *shell,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble *nx,
                                                         gdouble *ny);
void                gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble *nx,
                                                         gdouble *ny);
void                gimp_display_shell_transform_segments
                                                        (const GimpDisplayShell *shell,
                                                         const BoundSeg *src_segs,
                                                         GimpSegment *dest_segs,
                                                         gint n_segs,
                                                         gdouble offset_x,
                                                         gdouble offset_y);
void                gimp_display_shell_untransform_viewport
                                                        (const GimpDisplayShell *shell,
                                                         gint *x,
                                                         gint *y,
                                                         gint *width,
                                                         gint *height);

Description

Details

gimp_display_shell_transform_coords ()

void                gimp_display_shell_transform_coords (const GimpDisplayShell *shell,
                                                         const GimpCoords *image_coords,
                                                         GimpCoords *display_coords);

Transforms from image coordinates to display coordinates, so that objects can be rendered at the correct points on the display.

shell :

a GimpDisplayShell

image_coords :

image coordinates

display_coords :

returns the corresponding display coordinates

gimp_display_shell_untransform_coords ()

void                gimp_display_shell_untransform_coords
                                                        (const GimpDisplayShell *shell,
                                                         const GimpCoords *display_coords,
                                                         GimpCoords *image_coords);

Transforms from display coordinates to image coordinates, so that points on the display can be mapped to points in the image.

shell :

a GimpDisplayShell

display_coords :

display coordinates

image_coords :

returns the corresponding image coordinates

gimp_display_shell_transform_xy ()

void                gimp_display_shell_transform_xy     (const GimpDisplayShell *shell,
                                                         gdouble x,
                                                         gdouble y,
                                                         gint *nx,
                                                         gint *ny);

Transforms an image coordinate to a shell coordinate.


gimp_display_shell_untransform_xy ()

void                gimp_display_shell_untransform_xy   (const GimpDisplayShell *shell,
                                                         gint x,
                                                         gint y,
                                                         gint *nx,
                                                         gint *ny,
                                                         gboolean round);

Transform from display coordinates to image coordinates, so that points on the display can be mapped to the corresponding points in the image.

shell :

a GimpDisplayShell

x :

x coordinate in display coordinates

y :

y coordinate in display coordinates

nx :

returns x oordinate in image coordinates

ny :

returns y coordinate in image coordinates

round :

if TRUE, round the results to the nearest integer; if FALSE, simply cast them to gint.

gimp_display_shell_transform_xy_f ()

void                gimp_display_shell_transform_xy_f   (const GimpDisplayShell *shell,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble *nx,
                                                         gdouble *ny);

Transforms from image coordinates to display shell canvas coordinates.

shell :

a GimpDisplayShell

x :

image x coordinate of point

y :

image y coordinate of point

nx :

returned shell canvas x coordinate

ny :

returned shell canvas y coordinate

gimp_display_shell_untransform_xy_f ()

void                gimp_display_shell_untransform_xy_f (const GimpDisplayShell *shell,
                                                         gdouble x,
                                                         gdouble y,
                                                         gdouble *nx,
                                                         gdouble *ny);

This function is identical to gimp_display_shell_untransform_xy(), except that the input and output coordinates are doubles rather than ints, and consequently there is no option related to rounding.

shell :

a GimpDisplayShell

x :

x coordinate in display coordinates

y :

y coordinate in display coordinates

nx :

place to return x coordinate in image coordinates

ny :

place to return y coordinate in image coordinates

gimp_display_shell_transform_segments ()

void                gimp_display_shell_transform_segments
                                                        (const GimpDisplayShell *shell,
                                                         const BoundSeg *src_segs,
                                                         GimpSegment *dest_segs,
                                                         gint n_segs,
                                                         gdouble offset_x,
                                                         gdouble offset_y);

Transforms from image coordinates to display coordinates, so that objects can be rendered at the correct points on the display.

shell :

a GimpDisplayShell

src_segs :

array of segments in image coordinates

dest_segs :

returns the corresponding segments in display coordinates

n_segs :

number of segments

gimp_display_shell_untransform_viewport ()

void                gimp_display_shell_untransform_viewport
                                                        (const GimpDisplayShell *shell,
                                                         gint *x,
                                                         gint *y,
                                                         gint *width,
                                                         gint *height);

This function calculates the part of the image, im image coordinates, that corresponds to the display viewport.

shell :

a GimpDisplayShell

x :

returns image x coordinate of display upper left corner

y :

returns image y coordinate of display upper left corner

width :

returns width of display measured in image coordinates

height :

returns height of display measured in image coordinates