This is the doxygen documentation for gtkboard.

.
Main Page   Data Structures   File List   Data Fields   Globals  

aaball.c File Reference

routines for generating antialiased images, primarily balls. More...

#include <stdio.h>
#include <math.h>
#include <glib.h>
#include <string.h>
#include "aaball.h"

Go to the source code of this file.

Functions

int pixmap_get_color (int fg, int bg, float ratio)
char* pixmap_get_hex_color (int fg, int bg, float ratio)
char** pixmap_ball_gen (int len, char *pixbuf, int fg, int bg, float rad, float grad)
 Generates a ball. More...

void rgbmap_ball_gen_real (int len, unsigned char *rgbbuf, int fg, float rad, float grad, float midx, float midy)
void rgbmap_square_gen (int len, unsigned char *rgbbuf, int fg, int bg, float side)
void rgbmap_ball_gen (int len, unsigned char *rgbbuf, int fg, int bg, float rad, float grad)
void rgbmap_ball_gen_nobg (int len, unsigned char *rgbbuf, int fg, int bg, float rad, float grad)
 Same as rgbmap_ball_gen but don't generate the background - i.e, overlay the ball on the existing image.

void rgbmap_ball_shadow_gen (int len, unsigned char *rgbbuf, int fg, int bg, float rad, float grad, int shadowlen)
char** pixmap_header_gen (int len, char *pixbuf, int fg, int bg)
 Used if you already have the pixmap and only want to generate the header (i.e, same shape, different color).

char** pixmap_die_gen (int len, char *pixbuf, int fg, int bg, float rad, float grad, int num)
 Generates dice. More...


Variables

char hex [16]
char* pixmap_map [256]


Detailed Description

routines for generating antialiased images, primarily balls.

Definition in file aaball.c.


Function Documentation

char ** pixmap_ball_gen ( int len,
char * pixbuf,
int fg,
int bg,
float rad,
float grad )
 

Generates a ball.

Parameters:
len   = size of ball
pixbuf   = buffer to store the pixmap in
fg   = foreground color (color of the ball)
bg   = background color (color of the square)
rad   = radius of the ball
grad   = gradient with which the ball merges into the backgound (larger gradient indicates sharper boundary)

Definition at line 103 of file aaball.c.

char ** pixmap_die_gen ( int len,
char * pixbuf,
int fg,
int bg,
float rad,
float grad,
int num )
 

Generates dice.

Args same as pixmap_ball_gen() except num which is the number on the die

Definition at line 243 of file aaball.c.

int pixmap_get_color ( int fg,
int bg,
float ratio ) [static]
 

Definition at line 35 of file aaball.c.

Referenced by pixmap_get_hex_color(), and rgbmap_ball_gen_real().

char* pixmap_get_hex_color ( int fg,
int bg,
float ratio ) [static]
 

Definition at line 76 of file aaball.c.

Referenced by pixmap_ball_gen(), pixmap_die_gen(), and pixmap_header_gen().

char ** pixmap_header_gen ( int len,
char * pixbuf,
int fg,
int bg )
 

Used if you already have the pixmap and only want to generate the header (i.e, same shape, different color).

Definition at line 221 of file aaball.c.

void rgbmap_ball_gen ( int len,
unsigned char * rgbbuf,
int fg,
int bg,
float rad,
float grad )
 

Definition at line 170 of file aaball.c.

void rgbmap_ball_gen_nobg ( int len,
unsigned char * rgbbuf,
int fg,
int bg,
float rad,
float grad )
 

Same as rgbmap_ball_gen but don't generate the background - i.e, overlay the ball on the existing image.

Definition at line 185 of file aaball.c.

void rgbmap_ball_gen_real ( int len,
unsigned char * rgbbuf,
int fg,
float rad,
float grad,
float midx,
float midy ) [static]
 

Definition at line 135 of file aaball.c.

Referenced by rgbmap_ball_gen(), rgbmap_ball_gen_nobg(), and rgbmap_ball_shadow_gen().

void rgbmap_ball_shadow_gen ( int len,
unsigned char * rgbbuf,
int fg,
int bg,
float rad,
float grad,
int shadowlen )
 

Definition at line 190 of file aaball.c.

void rgbmap_square_gen ( int len,
unsigned char * rgbbuf,
int fg,
int bg,
float side )
 

Definition at line 152 of file aaball.c.


Variable Documentation

char hex[16] [static]
 

Initial value:

 {'0', '1', '2', '3', '4', '5', '6', '7', '8' ,
                                        '9', 'A', 'B', 'C', 'D', 'E', 'F'}

Definition at line 31 of file aaball.c.

char* pixmap_map[256] [static]
 

Definition at line 93 of file aaball.c.