pntr
Header-only CPU graphics library
Loading...
Searching...
No Matches
Colors

Macros

#define PNTR_DEG2RAD   0.017453293f
 
#define PNTR_SINF(value)   _pntr_sinf(value)
 
#define PNTR_COSF(value)   _pntr_cosf(value)
 
#define PNTR_CEILF(x)   _pntr_ceilf(x)
 
#define PNTR_FABSF(x)   (((x) < 0) ? -(x) : (x))
 
#define PNTR_FLOORF(x)   (float)(((int)(x)) - (((x) < 0.0f) ? 1 : 0))
 
#define PNTR_FMODF(dividend, divisor)   ((divisor) == 0.0f ? 0.0f : (dividend) - ((int)((dividend) / (divisor))) * (divisor))
 
#define PNTR_MAX(a, b)   ((a) > (b) ? (a) : (b))
 
#define PNTR_MIN(a, b)   ((a) < (b) ? (a) : (b))
 

Detailed Description

       Compound literal to initialize a structure.

       @param type The type of the structure to intiailize.
       @return The initialized structure.
       @note MSVC C++ compiler does not support compound literals (C99 feature)

       @code
       pntr_color color = PNTR_CLITERAL(pntr_color) { 255, 255, 255, 255 };
       @endif
      /
    #define PNTR_CLITERAL(type)      (type)
#endif

#endif

/** Color, represented by an unsigned 32-bit integer.

Has four components: Red, Green, Blue, and Alpha. Depending on the pixel format, will shift the order in which the components are defines.

See also
pntr_new_color()
pntr_get_color()
PNTR_PIXELFORMAT_RGBA
PNTR_PIXELFORMAT_ARGB / typedef union pntr_color { /** The color value, represented by an unsigned 32-bit integer. / uint32_t value;

/** Union data representing the 32-bit integer, split into four bytes.

The order in which the values are sorted depends on which pixel format you're using.

See also
PNTR_PIXELFORMAT_RGBA
PNTR_PIXELFORMAT_ARGB / struct pntr_color_rgba_t { #if defined(PNTR_PIXELFORMAT_RGBA) unsigned char r; /** Red channel. */ unsigned char g; /** Green channel. */ unsigned char b; /** Blue channel. */ unsigned char a; /** Alpha channel. */ #elif defined(PNTR_PIXELFORMAT_ARGB) unsigned char b; /** Blue channel. */ unsigned char g; /** Green channel. */ unsigned char r; /** Red channel. */ unsigned char a; /** Alpha channel. */ #endif } rgba; } pntr_color;

/** A rectangle. / typedef struct pntr_rectangle { int x; /** The x position of the rectangle. */ int y; /** The y position of the rectangle. */ int width; /** The width of the rectangle. */ int height; /** The height of the rectangle. */ } pntr_rectangle;

/** An image, represented by pixel data.

See also
pntr_new_image()
pntr_gen_image_color() / typedef struct pntr_image { pntr_color* data; /** The pixel data for the image. */ int width; /** The width of the image. */ int height; /** The height of the image. */ int pitch; /** The amount of bytes of one row of the image. */

/** Whether or not the image is a portion of another image, sharing the same image data.

See also
pntr_image_subimage() / bool subimage;

/** A rectangle representing the region of the image that can be changed.

See also
pntr_image_set_clip()
pntr_image_reset_clip()
pntr_image_get_clip() / pntr_rectangle clip; } pntr_image;

/** A vector, represented by x and y coordinates. / typedef struct pntr_vector { int x; /** The X coordinate. */ int y; /** The Y coordinate. */ } pntr_vector;

/** Font used to render text.

See also
pntr_load_font_tty()
pntr_load_font_ttf()
pntr_load_font_bmf()
PNTR_ENABLE_UTF8
PNTR_ENABLE_TTF / typedef struct pntr_font { pntr_image* atlas; /** The image used for the character atlas for the font. */ pntr_rectangle* srcRects; /** The glyph source rectangles on the atlas. */ pntr_rectangle* glyphRects; /** How the glyph appears when rendering. */ char* characters; /** An array of characters that are available in the font's atlas. */ int charactersLen; /** The number of characters that the font implements. */ void* user_data; /** General extra user data that can be referenced to by the font. */ } pntr_font;

/** Pixel format. / typedef enum pntr_pixelformat { PNTR_PIXELFORMAT_RGBA8888 = 0, /** RGBA, with 8 bytes for each component. */ PNTR_PIXELFORMAT_ARGB8888, /** ARGB, with 8 bytes for each component. */ PNTR_PIXELFORMAT_GRAYSCALE /** Grayscale, with one byte for each pixel, 0 - 255. 0 being disabled, 255 being enabled. */ } pntr_pixelformat;

/** Possible image filters to apply. / typedef enum pntr_filter { PNTR_FILTER_NEARESTNEIGHBOR = 0, /** Nearest-neighbor interpolation for fast processing. Good for a pixel art look. */ PNTR_FILTER_BILINEAR /** Bilinear interpolation will combine multiple pixels together when processing for smoother scaling. */ } pntr_filter;

/** Error states definitions.

See also
pntr_set_error()
pntr_get_error() / typedef enum pntr_error { PNTR_ERROR_NONE = 0, /** No error */ PNTR_ERROR_INVALID_ARGS = -1, /** Invalid arguments */ PNTR_ERROR_NO_MEMORY = -2, /** Not enough memory */ PNTR_ERROR_NOT_SUPPORTED = -3, /** Not supported */ PNTR_ERROR_FAILED_TO_OPEN = -4, /** Failed to open */ PNTR_ERROR_FAILED_TO_WRITE = -5, /** Failed to write */ PNTR_ERROR_UNKNOWN = -6 /** Unknown error occurred */ } pntr_error;

/** The associated image format. / typedef enum pntr_image_type { PNTR_IMAGE_TYPE_UNKNOWN = 0, /** Image type: Unknown. */ PNTR_IMAGE_TYPE_PNG, /** Image type: PNG - Portable Network Graphics */ PNTR_IMAGE_TYPE_JPG, /** Image type: JPEG - Joint Photographic Experts Group */ PNTR_IMAGE_TYPE_BMP /** Image type: BMP - Bitmap */ } pntr_image_type;

#ifdef __cplusplus extern "C" { #endif

PNTR_API pntr_image* pntr_new_image(int width, int height); PNTR_API pntr_image* pntr_gen_image_color(int width, int height, pntr_color color); PNTR_API pntr_image* pntr_image_copy(pntr_image* image); PNTR_API pntr_image* pntr_image_from_image(pntr_image* image, int x, int y, int width, int height); PNTR_API pntr_image* pntr_image_subimage(pntr_image* image, int x, int y, int width, int height); PNTR_API pntr_rectangle pntr_image_get_clip(pntr_image* image); PNTR_API void pntr_image_set_clip(pntr_image* image, int x, int y, int width, int height); PNTR_API void pntr_image_set_clip_rec(pntr_image* image, pntr_rectangle clip); PNTR_API void pntr_image_reset_clip(pntr_image* image); PNTR_API void pntr_unload_image(pntr_image* image); PNTR_API void pntr_clear_background(pntr_image* image, pntr_color color); PNTR_API void pntr_draw_point(pntr_image* dst, int x, int y, pntr_color color); PNTR_API void pntr_draw_point_vec(pntr_image* dst, pntr_vector* point, pntr_color color); PNTR_API void pntr_draw_points(pntr_image* dst, pntr_vector* points, int pointsCount, pntr_color color); PNTR_API void pntr_draw_line(pntr_image* dst, int startPosX, int startPosY, int endPosX, int endPosY, pntr_color color); PNTR_API void pntr_draw_line_curve(pntr_image* dst, pntr_vector point1, pntr_vector point2, pntr_vector point3, pntr_vector point4, int segments, pntr_color color); PNTR_API void pntr_draw_line_vec(pntr_image* dst, pntr_vector start, pntr_vector end, pntr_color color); PNTR_API void pntr_draw_line_vertical(pntr_image* dst, int posX, int posY, int height, pntr_color color); PNTR_API void pntr_draw_line_horizontal(pntr_image* dst, int posX, int posY, int width, pntr_color color); PNTR_API void pntr_draw_rectangle(pntr_image* dst, int posX, int posY, int width, int height, pntr_color color); PNTR_API void pntr_draw_rectangle_rec(pntr_image* dst, pntr_rectangle rec, pntr_color color); PNTR_API void pntr_draw_rectangle_fill(pntr_image* dst, int posX, int posY, int width, int height, pntr_color color); PNTR_API void pntr_draw_rectangle_fill_rec(pntr_image* dst, pntr_rectangle rect, pntr_color color); PNTR_API void pntr_draw_rectangle_gradient(pntr_image* dst, int x, int y, int width, int height, pntr_color topLeft, pntr_color topRight, pntr_color bottomLeft, pntr_color bottomRight); PNTR_API void pntr_draw_rectangle_gradient_rec(pntr_image* dst, pntr_rectangle rect, pntr_color topLeft, pntr_color topRight, pntr_color bottomLeft, pntr_color bottomRight); PNTR_API void pntr_draw_triangle(pntr_image* dst, int x1, int y1, int x2, int y2, int x3, int y3, pntr_color color); PNTR_API void pntr_draw_triangle_vec(pntr_image* dst, pntr_vector point1, pntr_vector point2, pntr_vector point3, pntr_color color); PNTR_API void pntr_draw_triangle_fill(pntr_image* dst, int x1, int y1, int x2, int y2, int x3, int y3, pntr_color color); PNTR_API void pntr_draw_triangle_fill_vec(pntr_image* dst, pntr_vector point1, pntr_vector point2, pntr_vector point3, pntr_color color); PNTR_API void pntr_draw_ellipse(pntr_image* dst, int centerX, int centerY, int radiusX, int radiusY, pntr_color color); PNTR_API void pntr_draw_ellipse_fill(pntr_image* dst, int centerX, int centerY, int radiusX, int radiusY, pntr_color color); PNTR_API void pntr_draw_circle(pntr_image* dst, int centerX, int centerY, int radius, pntr_color color); PNTR_API void pntr_draw_circle_fill(pntr_image* dst, int centerX, int centerY, int radius, pntr_color color); PNTR_API void pntr_draw_polygon(pntr_image* dst, pntr_vector* points, int numPoints, pntr_color color); PNTR_API void pntr_draw_polygon_fill(pntr_image* dst, pntr_vector* points, int numPoints, pntr_color color); PNTR_API void pntr_draw_polyline(pntr_image* dst, pntr_vector* points, int numPoints, pntr_color color); PNTR_API void pntr_draw_arc(pntr_image* dst, int centerX, int centerY, float radius, float startAngle, float endAngle, int segments, pntr_color color); PNTR_API void pntr_draw_arc_fill(pntr_image* dst, int centerX, int centerY, float radius, float startAngle, float endAngle, int segments, pntr_color color); PNTR_API void pntr_draw_rectangle_rounded(pntr_image* dst, int x, int y, int width, int height, int topLeftRadius, int topRightRadius, int bottomLeftRadius, int bottomRightRadius, pntr_color color); PNTR_API void pntr_draw_rectangle_rounded_fill(pntr_image* dst, int x, int y, int width, int height, int cornerRadius, pntr_color color); PNTR_API void pntr_draw_image(pntr_image* dst, pntr_image* src, int posX, int posY); PNTR_API void pntr_draw_image_rec(pntr_image* dst, pntr_image* src, pntr_rectangle srcRect, int posX, int posY); PNTR_API void pntr_draw_image_tint(pntr_image* dst, pntr_image* src, int posX, int posY, pntr_color tint); PNTR_API void pntr_draw_image_tint_rec(pntr_image* dst, pntr_image* src, pntr_rectangle srcRect, int posX, int posY, pntr_color tint); PNTR_API void pntr_draw_image_rotated(pntr_image* dst, pntr_image* src, int posX, int posY, float degrees, float offsetX, float offsetY, pntr_filter filter); PNTR_API void pntr_draw_image_rotated_rec(pntr_image* dst, pntr_image* src, pntr_rectangle srcRect, int posX, int posY, float degrees, float offsetX, float offsetY, pntr_filter filter); PNTR_API void pntr_draw_image_flipped(pntr_image* dst, pntr_image* src, int posX, int posY, bool flipHorizontal, bool flipVertical, bool flipDiagonal); PNTR_API void pntr_draw_image_flipped_rec(pntr_image* dst, pntr_image* src, pntr_rectangle srcRec, int posX, int posY, bool flipHorizontal, bool flipVertical, bool flipDiagonal); PNTR_API void pntr_draw_image_scaled(pntr_image* dst, pntr_image* src, int posX, int posY, float scaleX, float scaleY, float offsetX, float offsetY, pntr_filter filter); PNTR_API void pntr_draw_image_scaled_rec(pntr_image* dst, pntr_image* src, pntr_rectangle srcRect, int posX, int posY, float scaleX, float scaleY, float offsetX, float offsetY, pntr_filter filter); PNTR_API void pntr_draw_text(pntr_image* dst, pntr_font* font, const char* text, int posX, int posY, pntr_color tint); PNTR_API void pntr_draw_text_len(pntr_image* dst, pntr_font* font, const char* text, int textLength, int posX, int posY, pntr_color tint); PNTR_API void pntr_draw_text_wrapped(pntr_image* dst, pntr_font* font, const char* text, int posX, int posY, int maxWidth, pntr_color tint); #ifdef PNTR_ENABLE_VARGS PNTR_API void pntr_draw_text_ex(pntr_image* dst, pntr_font* font, int posX, int posY, pntr_color tint, int maxlen, const char* text, ...); #endif PNTR_API pntr_color pntr_new_color(unsigned char r, unsigned char g, unsigned char b, unsigned char a); PNTR_API pntr_color pntr_get_color(unsigned int hexValue); PNTR_API unsigned char pntr_color_r(pntr_color color); PNTR_API unsigned char pntr_color_g(pntr_color color); PNTR_API unsigned char pntr_color_b(pntr_color color); PNTR_API unsigned char pntr_color_a(pntr_color color); PNTR_API void pntr_color_set_r(pntr_color* color, unsigned char r); PNTR_API void pntr_color_set_g(pntr_color* color, unsigned char g); PNTR_API void pntr_color_set_b(pntr_color* color, unsigned char b); PNTR_API void pntr_color_set_a(pntr_color* color, unsigned char a); PNTR_API pntr_color pntr_image_get_color(pntr_image* image, int x, int y); PNTR_API bool pntr_save_file(const char <em>fileName, const void *data, unsigned int bytesToWrite); PNTR_API void pntr_image_to_pixelformat(pntr_image* image, unsigned int* dataSize, pntr_pixelformat pixelFormat); PNTR_API bool pntr_save_image(pntr_image* image, const char* fileName); PNTR_API unsigned char* pntr_save_image_to_memory(pntr_image* image, pntr_image_type type, unsigned int* dataSize); PNTR_API int pntr_get_pixel_data_size(int width, int height, pntr_pixelformat pixelFormat); PNTR_API pntr_image* pntr_load_image(const char* fileName); PNTR_API pntr_image* pntr_load_image_from_memory(pntr_image_type type, const unsigned char* fileData, unsigned int dataSize); PNTR_API pntr_image* pntr_image_from_pixelformat(const void* data, int width, int height, pntr_pixelformat pixelFormat); PNTR_API void* pntr_set_error(pntr_error error); PNTR_API const char* pntr_get_error(void); PNTR_API pntr_error pntr_get_error_code(void); PNTR_API pntr_image* pntr_image_resize(pntr_image* image, int newWidth, int newHeight, pntr_filter filter); PNTR_API pntr_image* pntr_image_scale(pntr_image* image, float scaleX, float scaleY, pntr_filter filter); PNTR_API void pntr_image_color_replace(pntr_image* image, pntr_color color, pntr_color replace); PNTR_API pntr_color pntr_color_tint(pntr_color color, pntr_color tint); PNTR_API void pntr_image_color_tint(pntr_image* image, pntr_color color); PNTR_API pntr_color pntr_color_fade(pntr_color color, float alpha); PNTR_API void pntr_image_color_fade(pntr_image* image, float alpha); PNTR_API pntr_color pntr_color_brightness(pntr_color color, float factor); PNTR_API pntr_color pntr_get_pixel_color(void* srcPtr, pntr_pixelformat srcPixelFormat); PNTR_API void pntr_set_pixel_color(void* dstPtr, pntr_pixelformat dstPixelFormat, pntr_color color); PNTR_API pntr_font* pntr_load_font_default(void); PNTR_API void pntr_unload_font(pntr_font* font); PNTR_API pntr_font* pntr_font_copy(pntr_font* font); PNTR_API pntr_font* pntr_font_scale(pntr_font* font, float scaleX, float scaleY, pntr_filter filter); PNTR_API pntr_font* pntr_load_font_bmf(const char* fileName, const char* characters); PNTR_API pntr_font* pntr_load_font_bmf_from_image(pntr_image* image, const char* characters); PNTR_API pntr_font* pntr_load_font_bmf_from_memory(const unsigned char* fileData, unsigned int dataSize, const char* characters); PNTR_API int pntr_measure_text(pntr_font* font, const char* text); PNTR_API pntr_vector pntr_measure_text_ex(pntr_font* font, const char* text, int textLength); PNTR_API pntr_image* pntr_gen_image_text(pntr_font* font, const char* text, pntr_color tint, pntr_color backgroundColor); PNTR_API pntr_font* pntr_load_font_tty(const char* fileName, int glyphWidth, int glyphHeight, const char* characters); PNTR_API pntr_font* pntr_load_font_tty_from_memory(const unsigned char* fileData, unsigned int dataSize, int glyphWidth, int glyphHeight, const char* characters); PNTR_API pntr_font* pntr_load_font_tty_from_image(pntr_image* image, int glyphWidth, int glyphHeight, const char* characters); PNTR_API unsigned char* pntr_load_file(const char <em>fileName, unsigned int *bytesRead); PNTR_API void pntr_unload_file(unsigned char fileData); PNTR_API const char* pntr_load_file_text(const char <em>fileName); PNTR_API void pntr_unload_file_text(const char text); PNTR_API pntr_font* pntr_load_font_ttf(const char* fileName, int fontSize); PNTR_API pntr_font* pntr_load_font_ttf_from_memory(const unsigned char* fileData, unsigned int dataSize, int fontSize); PNTR_API pntr_color pntr_color_invert(pntr_color color); PNTR_API void pntr_image_color_invert(pntr_image* image); PNTR_API pntr_color pntr_color_alpha_blend(pntr_color dst, pntr_color src); PNTR_API pntr_rectangle pntr_image_alpha_border(pntr_image* image, float threshold); PNTR_API bool pntr_image_crop(pntr_image* image, int x, int y, int width, int height); PNTR_API void pntr_image_alpha_crop(pntr_image* image, float threshold); PNTR_API void pntr_image_color_brightness(pntr_image* image, float factor); PNTR_API void pntr_image_flip(pntr_image* image, bool horizontal, bool vertical); PNTR_API pntr_color pntr_color_contrast(pntr_color color, float contrast); PNTR_API void pntr_image_color_contrast(pntr_image* image, float contrast); PNTR_API void pntr_image_alpha_mask(pntr_image* image, pntr_image* alphaMask, int posX, int posY); PNTR_API bool pntr_image_resize_canvas(pntr_image* image, int newWidth, int newHeight, int offsetX, int offsetY, pntr_color fill); PNTR_API pntr_image* pntr_image_rotate(pntr_image* image, float degrees, pntr_filter filter); PNTR_API pntr_image* pntr_gen_image_gradient(int width, int height, pntr_color topLeft, pntr_color topRight, pntr_color bottomLeft, pntr_color bottomRight); PNTR_API pntr_color pntr_color_bilinear_interpolate(pntr_color color00, pntr_color color01, pntr_color color10, pntr_color color11, float coordinateX, float coordinateY); PNTR_API void* pntr_load_memory(size_t size); PNTR_API void pntr_unload_memory(void* pointer); PNTR_API void* pntr_memory_copy(void* destination, void* source, size_t size); PNTR_API pntr_image_type pntr_get_file_image_type(const char* filePath);

PNTR_API void pntr_draw_line_thick(pntr_image* dst, int startPosX, int startPosY, int endPosX, int endPosY, int thickness, pntr_color color); PNTR_API void pntr_draw_line_thick_vec(pntr_image* dst, pntr_vector start, pntr_vector end, int thickness, pntr_color color); PNTR_API void pntr_draw_rectangle_thick(pntr_image* dst, int posX, int posY, int width, int height, int thickness, pntr_color color); PNTR_API void pntr_draw_rectangle_thick_rec(pntr_image* dst, pntr_rectangle rect, int thickness, pntr_color color); PNTR_API void pntr_draw_triangle_thick(pntr_image* dst, int x1, int y1, int x2, int y2, int x3, int y3, int thickness, pntr_color color); PNTR_API void pntr_draw_triangle_thick_vec(pntr_image* dst, pntr_vector point1, pntr_vector point2, pntr_vector point3, int thickness, pntr_color color); PNTR_API void pntr_draw_ellipse_thick(pntr_image* dst, int centerX, int centerY, int radiusX, int radiusY, int thickness, pntr_color color); PNTR_API void pntr_draw_circle_thick(pntr_image* dst, int centerX, int centerY, int radius, int thickness, pntr_color color); PNTR_API void pntr_draw_polygon_thick(pntr_image* dst, pntr_vector* points, int numPoints, int thickness, pntr_color color); PNTR_API void pntr_draw_polyline_thick(pntr_image* dst, pntr_vector* points, int numPoints, int thickness, pntr_color color); PNTR_API void pntr_draw_arc_thick(pntr_image* dst, int centerX, int centerY, float radius, float startAngle, float endAngle, int segments, int thickness, pntr_color color); PNTR_API void pntr_draw_rectangle_thick_rounded(pntr_image* dst, int x, int y, int width, int height, int topLeftRadius, int topRightRadius, int bottomLeftRadius, int bottomRightRadius, int thickness, pntr_color color); PNTR_API void pntr_draw_line_vertical_thick(pntr_image* dst, int posX, int posY, int height, int thickness, pntr_color color); PNTR_API void pntr_draw_line_horizontal_thick(pntr_image* dst, int posX, int posY, int width, int thickness, pntr_color color); PNTR_API void pntr_draw_line_curve_thick(pntr_image* dst, pntr_vector point1, pntr_vector point2, pntr_vector point3, pntr_vector point4, int segments, int thickness, pntr_color color);

// Internal PNTR_API void pntr_put_horizontal_line_unsafe(pntr_image* dst, int posX, int posY, int width, pntr_color color); PNTR_API void pntr_draw_point_unsafe(pntr_image* dst, int x, int y, pntr_color color);

#ifdef __cplusplus } #endif

/**

/

#ifndef PNTR_LIGHTGRAY /** Light gray. / #define PNTR_LIGHTGRAY pntr_new_color(200, 200, 200, 255) #endif #ifndef PNTR_GRAY /** Gray. / #define PNTR_GRAY pntr_new_color(130, 130, 130, 255) #endif #ifndef PNTR_DARKGRAY /** Dark gray. / #define PNTR_DARKGRAY pntr_new_color(80, 80, 80, 255) #endif #ifndef PNTR_YELLOW /** Yellow. / #define PNTR_YELLOW pntr_new_color(253, 249, 0, 255) #endif #ifndef PNTR_GOLD /** Gold. / #define PNTR_GOLD pntr_new_color(255, 203, 0, 255) #endif #ifndef PNTR_ORANGE /** Orange. / #define PNTR_ORANGE pntr_new_color(255, 161, 0, 255) #endif #ifndef PNTR_PINK /** Pink. / #define PNTR_PINK pntr_new_color(255, 109, 194, 255) #endif #ifndef PNTR_RED /** Red. / #define PNTR_RED pntr_new_color(230, 41, 55, 255) #endif #ifndef PNTR_MAROON /** Maroon. / #define PNTR_MAROON pntr_new_color(190, 33, 55, 255) #endif #ifndef PNTR_GREEN /** Green. / #define PNTR_GREEN pntr_new_color(0, 228, 48, 255) #endif #ifndef PNTR_LIME /** Lime. / #define PNTR_LIME pntr_new_color(0, 158, 47, 255) #endif #ifndef PNTR_DARKGREEN /** Dark green. / #define PNTR_DARKGREEN pntr_new_color(0, 117, 44, 255) #endif #ifndef PNTR_SKYBLUE /** Sky blue. / #define PNTR_SKYBLUE pntr_new_color(102, 191, 255, 255) #endif #ifndef PNTR_BLUE /** Blue. / #define PNTR_BLUE pntr_new_color(0, 121, 241, 255) #endif #ifndef PNTR_DARKBLUE /** Dark blue. / #define PNTR_DARKBLUE pntr_new_color(0, 82, 172, 255) #endif #ifndef PNTR_PURPLE /** Purple. / #define PNTR_PURPLE pntr_new_color(200, 122, 255, 255) #endif #ifndef PNTR_VIOLET /** Violet. / #define PNTR_VIOLET pntr_new_color(135, 60, 190, 255) #endif #ifndef PNTR_DARKPURPLE /** Dark purple. / #define PNTR_DARKPURPLE pntr_new_color(112, 31, 126, 255) #endif #ifndef PNTR_BEIGE /** Beige. / #define PNTR_BEIGE pntr_new_color(211, 176, 131, 255) #endif #ifndef PNTR_BROWN /** Brown. / #define PNTR_BROWN pntr_new_color(127, 106, 79, 255) #endif #ifndef PNTR_DARKBROWN /** Dark brown. / #define PNTR_DARKBROWN pntr_new_color(76, 63, 47, 255) #endif #ifndef PNTR_WHITE /** White. / #define PNTR_WHITE pntr_new_color(255, 255, 255, 255) #endif

#ifndef PNTR_WHITE_VALUE /** The integer representation of PNTR_WHITE.

Note
This is the same as PNTR_WHITE.value .

Macro Definition Documentation

◆ PNTR_CEILF

#define PNTR_CEILF (   x)    _pntr_ceilf(x)

Computes the smallest integer value not less than arg.

Parameters
xFloating-point value
Returns
The smallest integer value not less than arg, that is ⌈arg⌉, is returned.
See also
https://en.cppreference.com/w/c/numeric/math/ceil

◆ PNTR_COSF

#define PNTR_COSF (   value)    _pntr_cosf(value)

Calculates cosine of the given value.

Parameters
valueFloating-point value representing angle in radians
Returns
The cosine of the given value.
See also
https://en.cppreference.com/w/c/numeric/math/cos
https://github.com/Immediate-Mode-UI/Nuklear/blob/master/nuklear.h

◆ PNTR_FABSF

#define PNTR_FABSF (   x)    (((x) < 0) ? -(x) : (x))

Computes the absolute value of a floating point value.

Parameters
xFloating point value
Returns
The absolute value of the given value.
See also
https://en.cppreference.com/w/c/numeric/math/fabs

◆ PNTR_FLOORF

#define PNTR_FLOORF (   x)    (float)(((int)(x)) - (((x) < 0.0f) ? 1 : 0))

Computes the largest integer value not greater than arg.

Parameters
xFloating point value.
Returns
The largest integer value not greater than arg.
See also
https://en.cppreference.com/w/c/numeric/math/floor

◆ PNTR_FMODF

#define PNTR_FMODF (   dividend,
  divisor 
)    ((divisor) == 0.0f ? 0.0f : (dividend) - ((int)((dividend) / (divisor))) * (divisor))

Computes the floating-point remainder of the division operation x/y.

Parameters
dividendfloating point value
divisorfloating point value
Returns
The modulus of the division operation.
See also
https://en.cppreference.com/w/c/numeric/math/fmod

◆ PNTR_MAX

#define PNTR_MAX (   a,
 
)    ((a) > (b) ? (a) : (b))

Return the largest value of the two given values.

Parameters
aThe first value to compare.
bThe second value to compare.
Returns
Which value is larger.

◆ PNTR_MIN

#define PNTR_MIN (   a,
 
)    ((a) < (b) ? (a) : (b))

Return the smallest value of the two given values.

Parameters
aThe first value to compare.
bThe second value to compare.
Returns
Which value is smaller.

◆ PNTR_SINF

#define PNTR_SINF (   value)    _pntr_sinf(value)

Calculates sine of the given value in radians.

Parameters
valueThe input value of sinf()
Returns
The sine of the given value.
See also
https://en.cppreference.com/w/c/numeric/math/sin
https://github.com/Immediate-Mode-UI/Nuklear/blob/master/nuklear.h