Non-clipping Graphics Primitives

Non-clipping Graphics Primitives — Slightly faster, less safe drawing functions

Functions

Includes

#include <grx-3.0.h>

Description

Like the other graphics primitives, these functions operate on the current context. These are somewhat more efficient than the regular versions. These are to be used only in situations when it is absolutely certain that no drawing will be performed beyond the boundaries of the current context. Otherwise the program will almost certainly crash! ALSO NOTE: These function do not check for conflicts with the mouse cursor. (See the explanation about the mouse cursor handling later in this document.)

Functions

grx_fast_draw_pixel ()

void
grx_fast_draw_pixel (gint x,
                     gint y,
                     GrxColor c);

Draw a single pixel on the current context at the specified coordinates.

This function does not perform clipping. If you are not sure x and y are within the bounds of the current context, use grx_draw_pixel() instead.

Parameters

x

the X coordinate

 

y

the Y coordinate

 

c

the color (can include GrxColorMode)

 

grx_fast_draw_line ()

void
grx_fast_draw_line (gint x1,
                    gint y1,
                    gint x2,
                    gint y2,
                    GrxColor c);

Draws a line on the current context from the starting coordinates to the ending coordinates using the specified color.

For horizontal and vertical lines, see grx_fast_draw_hline() and grx_fast_draw_vline().

This function does not perform clipping. If you cannot ensure that the endpoints are within the bounds of the current context, then use grx_draw_line() instead.

Parameters

x1

starting X coordinate

 

y1

starting Y coordinate

 

x2

ending X coordinate

 

y2

ending Y coordinate

 

c

the color

 

grx_fast_draw_hline ()

void
grx_fast_draw_hline (gint x1,
                     gint x2,
                     gint y,
                     GrxColor c);

Draws a horizontal line on the current context from the starting coordinates to the ending coordinates using the specified color.

This is more efficient that using grx_fast_draw_line().

This function does not perform clipping. If you cannot ensure that the endpoints are within the bounds of the current context, then use grx_draw_hline() instead.

Parameters

x1

starting X coordinate

 

x2

ending X coordinate

 

y

Y coordinate

 

c

the color

 

grx_fast_draw_vline ()

void
grx_fast_draw_vline (gint x,
                     gint y1,
                     gint y2,
                     GrxColor c);

Draws a vertical line on the current context from the starting coordinates to the ending coordinates using the specified color.

This is more efficient that using grx_fast_draw_line().

This function does not perform clipping. If you cannot ensure that the endpoints are within the bounds of the current context, then use grx_draw_hline() instead.

Parameters

x

X coordinate

 

y1

starting Y coordinate

 

y2

ending Y coordinate

 

c

the color

 

grx_fast_draw_box ()

void
grx_fast_draw_box (gint x1,
                   gint y1,
                   gint x2,
                   gint y2,
                   GrxColor c);

Draws a rectangle on the current context using the specified coordinates and color.

This function does not perform clipping. If you cannot ensure that the box is within the bounds of the current context, then use grx_draw_box() instead.

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

c

the color

 

grx_fast_draw_filled_box ()

void
grx_fast_draw_filled_box (gint x1,
                          gint y1,
                          gint x2,
                          gint y2,
                          GrxColor c);

Draws a filled rectangle on the current context using the specified coordinates and color.

This function does not perform clipping. If you cannot ensure that the box is within the bounds of the current context, then use grx_draw_filled_box() instead.

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

c

the color

 

grx_fast_draw_framed_box ()

void
grx_fast_draw_framed_box (gint x1,
                          gint y1,
                          gint x2,
                          gint y2,
                          gint width,
                          const GrxFramedBoxColors *c);

Draws a framed rectangle on the current context using the specified coordinates and colors. The coordinates specify the interior box. The border extends outside of the box using the given width .

This function does not perform clipping. If you cannot ensure that the box, including the frame, is within the bounds of the current context, then use grx_draw_framed_box() instead.

Parameters

x1

the left X coordinate

 

y1

the top Y coordinate

 

x2

the right X coordinate

 

y2

the bottom Y coordinate

 

width

the width of the frame

 

c

the colors

 

grx_fast_bit_blt ()

void
grx_fast_bit_blt (gint x,
                  gint y,
                  GrxContext *src,
                  gint x1,
                  gint y1,
                  gint x2,
                  gint y2,
                  GrxColor op);

Copies an area bounded by x1, y2, x2, y2 in the source context to the current context at the location specified by dx, dy using the specified operation.

This function does not perform clipping. If you cannot ensure that the destination rectangle is within the bounds of the context, then use grx_bit_blt() instead.

Parameters

x

the destination X coordinate

 

y

the destination Y coordinate

 

src

the source context or NULL to use the current context.

[nullable]

x1

the source bounding rectangle left coordinate

 

y1

the source bounding rectangle top coordinate

 

x2

the source bounding rectangle right coordinate

 

y2

the source bounding rectangle bottom coordinate

 

op

the GrxColorMode operator and optional transparent color

 

grx_context_fast_bit_blt ()

void
grx_context_fast_bit_blt (GrxContext *context,
                          gint x,
                          gint y,
                          GrxContext *src,
                          gint x1,
                          gint y1,
                          gint x2,
                          gint y2,
                          GrxColor op);

Copies an area bounded by x1, y2, x2, y2 in the source context to the destination context at the location specified by dx, dy using the specified operation.

This function does not perform clipping. If you cannot ensure that the destination rectangle is within the bounds of the context, then use grx_context_bit_blt() instead.

Parameters

context

the destination context

 

x

the destination X coordinate

 

y

the destination Y coordinate

 

src

the source context or NULL to use the current context.

[nullable]

x1

the source bounding rectangle left coordinate

 

y1

the source bounding rectangle top coordinate

 

x2

the source bounding rectangle right coordinate

 

y2

the source bounding rectangle bottom coordinate

 

op

the GrxColorMode operator and optional transparent color

 

grx_fast_get_pixel_at ()

GrxColor
grx_fast_get_pixel_at (gint x,
                       gint y);

Gets the color value of the pixel in the current context at the specified coordinates.

This function does not perform clipping. If you are not sure x and y are within the bounds of the current context, use grx_get_pixel_at() instead.

Parameters

x

the X coordinate

 

y

the Y coordinate

 

grx_context_fast_get_pixel_at ()

GrxColor
grx_context_fast_get_pixel_at (GrxContext *context,
                               gint x,
                               gint y);

Gets the color value of the pixel in the context at the specified coordinates.

This function does not perform clipping. If you are not sure x and y are within the bounds of the context, use grx_context_get_pixel_at() instead.

Parameters

context

the context

 

x

the X coordinate

 

y

the Y coordinate

 

Types and Values