www.pudn.com > imgproc.zip > IMGDRAW.H


// **************************************************************** 
//  Image process tool box 
//     by Yang Yudong 
// 
// File : imgdraw.h 
// Description:  graphics and image block routines  
// Create Date:  1996. 12. 18 
// Modification(date/where):  
// 
// **************************************************************** 
 
#ifndef _IMGDRAW_INC 
#define _IMGDRAW_INC 
 
#ifndef imagedes 
  #include "image.h" 
#endif 
 
#ifndef _IDRAW_DEFINE 
extern int _id_draw_mode; 
extern int _id_red_color; 
extern int _id_green_color; 
extern int _id_blue_color; 
#endif 
 
#define IDRAW_OVERWRITE   0 
#define IDRAW_XOR	  1 
#define IDRAW_AND	  2 
#define IDRAW_OR	  3 
 
 
// imgdraw.c 
 
// Set draw color 
void img_draw_color(int r,int g,int b); 
 
// Retrive a most fit color index 
int img_draw_fitcolor(imagedes img, int r, int g, int b); 
 
// Set draw mode 
void img_draw_mode(int m); 
 
// draw pixel at img(x,y) 
void img_draw_pixel(imagedes img, int x, int y); 
 
 
// id_line.c 
/**************************************************************************** 
* 
* Function:     img_draw_line 
* Parameters:   img         - image to draw the line on 
*               x1,y1       - First endpoint of line 
*               x2,y2       - Second endpoint of line 
* Description:  Scan convert a line segment using the MidPoint Digital 
*               Differential Analyser algorithm. 
* 
****************************************************************************/ 
void img_draw_line(imagedes img, int x1,int y1,int x2,int y2); 
 
// id_rect.c 
/**************************************************************************** 
* 
* Function:     img_draw_rect 
* Parameters:   img         - image to draw the line on 
*               x1,y1       - Upper Left corner of rect 
*               x2,y2       - Down Right corner of rect 
*               BOOL solid 
* Description:  draw rectanglar on image 
* 
****************************************************************************/ 
void img_draw_rect(imagedes img, int x1,int y1,int x2,int y2, BOOL solid); 
 
 
// ibitbilt.c 
//   do bitbilt (rectangle block copy) of src to des 
//   des must be allocated and must be the same type as src 
//   where (xs,ys) is the start point of source image block (can be negtive) 
//         (x, y) is the size of source image block 
//         (dx, dy) is the destination location (can be negtive) 
// return TRUE if successful 
BOOL img_bitbilt(imagedes des, imagedes src,  
                  int xs, int ys, int x, int y, int dx, int dy); 
BOOL img_bitbilt_alpha(imagedes des, imagedes src, BYTE *alpha, 
                  int xs, int ys, int x, int y, int dx, int dy); 
 
//   do transparent bitbilt (rectangle block copy) of src to des 
//   des must be allocated and must be the same type as src 
//   where (xs,ys) is the start point of source image block (can be negtive) 
//         (x, y) is the size of source image block 
//         (dx, dy) is the destination location (can be negtive) 
//         (tr, tg, tb) is the color that is transparent,  
//            only tr is used when image is not RGB true color. 
// return TRUE if successful 
BOOL img_bitbilt_transparent(imagedes des, imagedes src, 
                  int xs, int ys, int x, int y, int dx, int dy, BYTE tr, BYTE tg, BYTE tb); 
BOOL img_bitbilt_transparent_alpha(imagedes des, imagedes src, BYTE *alpha,  
                  int xs, int ys, int x, int y, int dx, int dy, BYTE tr, BYTE tg, BYTE tb); 
 
 
// imgshade.c 
// Draw shadow using current color on img  
BOOL img_draw_shadow(imagedes img, int xst, int yst, int xsz, int ysz, int radius); 
 
#endif // _IMGDRAW_INC