1
/* vim:expandtab:ts=2 sw=2:
3
/* Grafx2 - The Ultimate 256-color bitmap paint program
5
Copyright 2007-2008 Adrien Destugues
6
Copyright 1996-2001 Sunset Design (Guillaume Dorme & Karl Maritaud)
8
Grafx2 is free software; you can redistribute it and/or
9
modify it under the terms of the GNU General Public License
10
as published by the Free Software Foundation; version 2
13
Grafx2 is distributed in the hope that it will be useful,
14
but WITHOUT ANY WARRANTY; without even the implied warranty of
15
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16
GNU General Public License for more details.
18
You should have received a copy of the GNU General Public License
19
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
22
//////////////////////////////////////////////////////////////////////////////
24
/// Actions on the brush.
25
//////////////////////////////////////////////////////////////////////////////
33
Gets the brush from the picture.
34
@param start_x left edge coordinate in the picture
35
@param start_y upper edge coordinate in the picture
36
@param end_x right edge coordinate in the picture
37
@param end_y bottom edge coordinate in the picture
38
@param clear If 1, the area is also cleared from the picture.
40
void Capture_brush(short start_x,short start_y,short end_x,short end_y,short clear);
43
Rotates the brush to the right.
45
void Rotate_90_deg(void);
48
Stretch the brush to fit the given rectangle.
50
void Stretch_brush(short x1, short y1, short x2, short y2);
53
Stretch the brush to fit the given rectangle.
54
Uses fast approximation for the preview while drawing the rectangle on screen.
56
void Stretch_brush_preview(short x1, short y1, short x2, short y2);
59
Rotates the brush to the right from the given angle.
61
void Rotate_brush(float angle);
64
Stretch the brush to fit the given rectangle.
65
Uses fast approximation for the preview while changing the angle.
67
void Rotate_brush_preview(float angle);
70
Remap the brush palette to the nearest color in the picture one.
71
Used when switching to the spare page.
75
Distort the brush on the screen.
77
void Distort_brush_preview(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4);
80
Replace the brush by a distorted version of itself.
82
void Distort_brush(short x1, short y1, short x2, short y2, short x3, short y3, short x4, short y4);
85
void Remap_brush(void);
88
Get color indexes used by the brush.
90
void Get_colors_from_brush(void);
93
Outline the brush, add 1 foreground-colored pixel on the edges.
94
Edges are detected considering the backcolor as transparent.
96
void Outline_brush(void);
99
Nibble the brush, remove 1 pixel on the edges and make it transparent (ie filled with back color).
100
Edges are detected considering the backcolor as transparent.
102
void Nibble_brush(void);
105
Get brush from picture according to a freehand form.
106
@param vertices number of points in the freehand form
107
@param points array of points coordinates
108
@param clear If set to 1, the captured area is also cleared from the picture.
110
void Capture_brush_with_lasso(int vertices, short * points,short clear);
114
/// Changes the Brush size, discarding its previous content.
115
/// @return 0 OK, 1 Failed
116
byte Realloc_brush(word new_brush_width, word new_brush_height);