39 # define R_MASK 0x00ff0000 40 # define G_MASK 0x0000ff00 41 # define B_MASK 0x000000ff 42 # define A_MASK 0xff000000 44 # define R_MASK 0x000000ff 45 # define G_MASK 0x0000ff00 46 # define B_MASK 0x00ff0000 47 # define A_MASK 0xff000000 49 #define BYTES_PER_PIXEL 4 128 void set_mask (
bool m);
149 void set_alpha (
u_int8 a,
const bool & alpha_channel =
false);
157 return alpha_channel_;
170 void set_scale (
const u_int8 & scale);
194 draw (x, y, 0, 0, length (), height (), da_opt, target);
216 surface * target = NULL)
const;
229 draw (x, y, sx, sy, sl, sh, da_opt, target);
281 void unlock ()
const;
315 #ifdef __BIG_ENDIAN__ 316 put_pix (x, y, map_color(b, SDL_ALPHA_OPAQUE, g, r));
318 put_pix (x, y, map_color(r, g, b, SDL_ALPHA_OPAQUE));
330 put_pix (x, y, r, g, b);
365 #ifdef __BIG_ENDIAN__ 366 unmap_color(col, g, r, a, b);
368 unmap_color(col, r, g, b, a);
380 get_pix (x, y, r, g, b);
424 u_int8 bytes_per_pixel = BYTES_PER_PIXEL,
428 void * get_data (
u_int8 bytes_per_pixel,
434 SDL_Surface *to_sw_surface(SDL_Rect *rect = NULL)
const;
437 void lock (SDL_Rect *rect)
const;
470 static SDL_Rect srcrect, dstrect;
void get_pix(u_int16 x, u_int16 y, u_int8 &r, u_int8 &g, u_int8 &b) const
Gets a pixel from a surface.
bool has_alpha_channel() const
Returns whether the surface has an alpha channel.
SDL_Texture * Surface
the surface
#define u_int16
16 bits long unsigned integer
u_int32 BytesPerPixel
number of bytes used to represent the format
void put_pix_rgb(u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b)
Synonym of put_pix () to guarantee its access from Python.
Class where drawables can actually be drawn to.
u_int8 scale_
current scale
u_int8 scale() const
Get the surfaces current scaling factor.
#define u_int32
32 bits long unsigned integer
void put_pix(u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b)
Puts a pixel of a given color.
#define u_int8
8 bits long unsigned integer
int Pitch
the pitch of the locked Surface
Declares the drawable class.
Implements "drawing zones" for drawing operations.
void * Pixels
the pixel data of the locked Surface
void get_pix_rgb(u_int16 x, u_int16 y, u_int8 r, u_int8 g, u_int8 b) const
Synonym of get_pix () to guarantee its access from Python.
Screen access is made through this class.
#define s_int16
16 bits long signed integer
s_int16 offset_x_
sub-pixel offset
bool is_masked() const
Returns whether a surface is masked or not.
u_int32 Format
the format of the surface
Abstract class for drawable objects manipulation.
void draw_part(s_int16 x, s_int16 y, s_int16 sx, s_int16 sy, u_int16 sl, u_int16 sh, const drawing_area *da_opt=NULL, surface *target=NULL) const
Synonym of draw () to guarantee its access from Python.
void lock() const
Locks the surface.
u_int8 alpha() const
Returns the alpha value of the surface.
void draw(s_int16 x, s_int16 y, const drawing_area *da_opt=NULL, surface *target=NULL) const
Draw the surface.
void copy(const surface &src)
Synonym of operator = to guarantee its access from Python.