Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
graphene-rect.h File Reference
#include "graphene-types.h"
#include "graphene-point.h"
#include "graphene-size.h"
#include "graphene-vec2.h"

Go to the source code of this file.

Data Structures

struct  _graphene_rect_t
 

Macros

#define GRAPHENE_RECT_INIT(_x, _y, _w, _h)    (graphene_rect_t) { .origin = { .x = (_x), .y = (_y) }, .size = { .width = (_w), .height = (_h) } }
 
#define GRAPHENE_RECT_INIT_ZERO   GRAPHENE_RECT_INIT (0.f, 0.f, 0.f, 0.f)
 

Functions

GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_tgraphene_rect_alloc (void)
 
GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_free (graphene_rect_t *r)
 
GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_tgraphene_rect_init (graphene_rect_t *r, float x, float y, float width, float height)
 
GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_tgraphene_rect_init_from_rect (graphene_rect_t *r, const graphene_rect_t *src)
 
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_rect_equal (const graphene_rect_t *a, const graphene_rect_t *b)
 
GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_tgraphene_rect_normalize (graphene_rect_t *r)
 
GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_normalize_r (const graphene_rect_t *r, graphene_rect_t *res)
 
GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_center (const graphene_rect_t *r, graphene_point_t *p)
 
GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_top_left (const graphene_rect_t *r, graphene_point_t *p)
 
GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_top_right (const graphene_rect_t *r, graphene_point_t *p)
 
GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_bottom_right (const graphene_rect_t *r, graphene_point_t *p)
 
GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_bottom_left (const graphene_rect_t *r, graphene_point_t *p)
 
GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_get_vertices (const graphene_rect_t *r, graphene_vec2_t vertices[])
 
GRAPHENE_AVAILABLE_IN_1_0 float graphene_rect_get_x (const graphene_rect_t *r)
 
GRAPHENE_AVAILABLE_IN_1_0 float graphene_rect_get_y (const graphene_rect_t *r)
 
GRAPHENE_AVAILABLE_IN_1_0 float graphene_rect_get_width (const graphene_rect_t *r)
 
GRAPHENE_AVAILABLE_IN_1_0 float graphene_rect_get_height (const graphene_rect_t *r)
 
GRAPHENE_AVAILABLE_IN_1_10 float graphene_rect_get_area (const graphene_rect_t *r)
 
GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_union (const graphene_rect_t *a, const graphene_rect_t *b, graphene_rect_t *res)
 
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_rect_intersection (const graphene_rect_t *a, const graphene_rect_t *b, graphene_rect_t *res)
 
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_rect_contains_point (const graphene_rect_t *r, const graphene_point_t *p)
 
GRAPHENE_AVAILABLE_IN_1_0 bool graphene_rect_contains_rect (const graphene_rect_t *a, const graphene_rect_t *b)
 
GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_tgraphene_rect_offset (graphene_rect_t *r, float d_x, float d_y)
 
GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_offset_r (const graphene_rect_t *r, float d_x, float d_y, graphene_rect_t *res)
 
GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_tgraphene_rect_inset (graphene_rect_t *r, float d_x, float d_y)
 
GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_inset_r (const graphene_rect_t *r, float d_x, float d_y, graphene_rect_t *res)
 
graphene_rect_tgraphene_rect_round_to_pixel (graphene_rect_t *r)
 
void graphene_rect_round (const graphene_rect_t *r, graphene_rect_t *res)
 
GRAPHENE_AVAILABLE_IN_1_10 void graphene_rect_round_extents (const graphene_rect_t *r, graphene_rect_t *res)
 
GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_interpolate (const graphene_rect_t *a, const graphene_rect_t *b, double factor, graphene_rect_t *res)
 
GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_expand (const graphene_rect_t *r, const graphene_point_t *p, graphene_rect_t *res)
 
GRAPHENE_AVAILABLE_IN_1_4 const graphene_rect_tgraphene_rect_zero (void)
 
GRAPHENE_AVAILABLE_IN_1_10 void graphene_rect_scale (const graphene_rect_t *r, float s_h, float s_v, graphene_rect_t *res)
 

Macro Definition Documentation

◆ GRAPHENE_RECT_INIT

#define GRAPHENE_RECT_INIT ( _x,
_y,
_w,
_h )    (graphene_rect_t) { .origin = { .x = (_x), .y = (_y) }, .size = { .width = (_w), .height = (_h) } }

GRAPHENE_RECT_INIT: @_x: the X coordinate of the origin @_y: the Y coordinate of the origin @_w: the width @_h: the height

Initializes a graphene_rect_t when declaring it.

Since: 1.0

Definition at line 50 of file graphene-rect.h.

50#define GRAPHENE_RECT_INIT(_x,_y,_w,_h) \
51 (graphene_rect_t) { .origin = { .x = (_x), .y = (_y) }, .size = { .width = (_w), .height = (_h) } }

◆ GRAPHENE_RECT_INIT_ZERO

#define GRAPHENE_RECT_INIT_ZERO   GRAPHENE_RECT_INIT (0.f, 0.f, 0.f, 0.f)

GRAPHENE_RECT_INIT_ZERO:

Initializes a graphene_rect_t to a degenerate rectangle with an origin in (0, 0) and a size of 0.

Since: 1.10

Definition at line 61 of file graphene-rect.h.

Function Documentation

◆ graphene_rect_alloc()

GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_t * graphene_rect_alloc ( void )

◆ graphene_rect_contains_point()

GRAPHENE_AVAILABLE_IN_1_0 bool graphene_rect_contains_point ( const graphene_rect_t * r,
const graphene_point_t * p )

◆ graphene_rect_contains_rect()

GRAPHENE_AVAILABLE_IN_1_0 bool graphene_rect_contains_rect ( const graphene_rect_t * a,
const graphene_rect_t * b )

◆ graphene_rect_equal()

GRAPHENE_AVAILABLE_IN_1_0 bool graphene_rect_equal ( const graphene_rect_t * a,
const graphene_rect_t * b )

◆ graphene_rect_expand()

GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_expand ( const graphene_rect_t * r,
const graphene_point_t * p,
graphene_rect_t * res )

◆ graphene_rect_free()

GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_free ( graphene_rect_t * r)

◆ graphene_rect_get_area()

GRAPHENE_AVAILABLE_IN_1_10 float graphene_rect_get_area ( const graphene_rect_t * r)

◆ graphene_rect_get_bottom_left()

GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_bottom_left ( const graphene_rect_t * r,
graphene_point_t * p )

◆ graphene_rect_get_bottom_right()

GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_bottom_right ( const graphene_rect_t * r,
graphene_point_t * p )

◆ graphene_rect_get_center()

GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_center ( const graphene_rect_t * r,
graphene_point_t * p )

◆ graphene_rect_get_height()

GRAPHENE_AVAILABLE_IN_1_0 float graphene_rect_get_height ( const graphene_rect_t * r)

◆ graphene_rect_get_top_left()

GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_top_left ( const graphene_rect_t * r,
graphene_point_t * p )

◆ graphene_rect_get_top_right()

GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_get_top_right ( const graphene_rect_t * r,
graphene_point_t * p )

◆ graphene_rect_get_vertices()

GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_get_vertices ( const graphene_rect_t * r,
graphene_vec2_t vertices[] )

◆ graphene_rect_get_width()

GRAPHENE_AVAILABLE_IN_1_0 float graphene_rect_get_width ( const graphene_rect_t * r)

◆ graphene_rect_get_x()

GRAPHENE_AVAILABLE_IN_1_0 float graphene_rect_get_x ( const graphene_rect_t * r)

◆ graphene_rect_get_y()

GRAPHENE_AVAILABLE_IN_1_0 float graphene_rect_get_y ( const graphene_rect_t * r)

◆ graphene_rect_init()

GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_t * graphene_rect_init ( graphene_rect_t * r,
float x,
float y,
float width,
float height )

◆ graphene_rect_init_from_rect()

GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_t * graphene_rect_init_from_rect ( graphene_rect_t * r,
const graphene_rect_t * src )

◆ graphene_rect_inset()

GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_t * graphene_rect_inset ( graphene_rect_t * r,
float d_x,
float d_y )

◆ graphene_rect_inset_r()

GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_inset_r ( const graphene_rect_t * r,
float d_x,
float d_y,
graphene_rect_t * res )

◆ graphene_rect_interpolate()

GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_interpolate ( const graphene_rect_t * a,
const graphene_rect_t * b,
double factor,
graphene_rect_t * res )

◆ graphene_rect_intersection()

GRAPHENE_AVAILABLE_IN_1_0 bool graphene_rect_intersection ( const graphene_rect_t * a,
const graphene_rect_t * b,
graphene_rect_t * res )

◆ graphene_rect_normalize()

GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_t * graphene_rect_normalize ( graphene_rect_t * r)

◆ graphene_rect_normalize_r()

GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_normalize_r ( const graphene_rect_t * r,
graphene_rect_t * res )

◆ graphene_rect_offset()

GRAPHENE_AVAILABLE_IN_1_0 graphene_rect_t * graphene_rect_offset ( graphene_rect_t * r,
float d_x,
float d_y )

◆ graphene_rect_offset_r()

GRAPHENE_AVAILABLE_IN_1_4 void graphene_rect_offset_r ( const graphene_rect_t * r,
float d_x,
float d_y,
graphene_rect_t * res )

◆ graphene_rect_round()

void graphene_rect_round ( const graphene_rect_t * r,
graphene_rect_t * res )

◆ graphene_rect_round_extents()

GRAPHENE_AVAILABLE_IN_1_10 void graphene_rect_round_extents ( const graphene_rect_t * r,
graphene_rect_t * res )

◆ graphene_rect_round_to_pixel()

graphene_rect_t * graphene_rect_round_to_pixel ( graphene_rect_t * r)

◆ graphene_rect_scale()

GRAPHENE_AVAILABLE_IN_1_10 void graphene_rect_scale ( const graphene_rect_t * r,
float s_h,
float s_v,
graphene_rect_t * res )

◆ graphene_rect_union()

GRAPHENE_AVAILABLE_IN_1_0 void graphene_rect_union ( const graphene_rect_t * a,
const graphene_rect_t * b,
graphene_rect_t * res )

◆ graphene_rect_zero()

GRAPHENE_AVAILABLE_IN_1_4 const graphene_rect_t * graphene_rect_zero ( void )