synfig-studio  1.0.3
surface.hpp
Go to the documentation of this file.
1 /* brushlib - The MyPaint Brush Library
2  * Copyright (C) 2008 Martin Renold <martinxyz@gmx.ch>
3  *
4  * Permission to use, copy, modify, and/or distribute this software for any
5  * purpose with or without fee is hereby granted, provided that the above
6  * copyright notice and this permission notice appear in all copies.
7  *
8  * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9  * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10  * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
11  * ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12  * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
13  * ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
14  * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15  */
16 
17 namespace brushlib {
18 
19 // surface interface required by brush.hpp
20 class Surface {
21 public:
22 
23  virtual ~Surface() {}
24 
25  virtual bool draw_dab (float x, float y,
26  float radius,
27  float color_r, float color_g, float color_b,
28  float opaque, float hardness = 0.5,
29  float alpha_eraser = 1.0,
30  float aspect_ratio = 1.0, float angle = 0.0,
31  float lock_alpha = 0.0
32  ) = 0;
33 
34  virtual void get_color (float x, float y,
35  float radius,
36  float * color_r, float * color_g, float * color_b, float * color_a
37  ) = 0;
38 };
39 
40 }