zenilib  0.5.3.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
SDL_surface.h
Go to the documentation of this file.
1 /*
2  Simple DirectMedia Layer
3  Copyright (C) 1997-2013 Sam Lantinga <slouken@libsdl.org>
4 
5  This software is provided 'as-is', without any express or implied
6  warranty. In no event will the authors be held liable for any damages
7  arising from the use of this software.
8 
9  Permission is granted to anyone to use this software for any purpose,
10  including commercial applications, and to alter it and redistribute it
11  freely, subject to the following restrictions:
12 
13  1. The origin of this software must not be misrepresented; you must not
14  claim that you wrote the original software. If you use this software
15  in a product, an acknowledgment in the product documentation would be
16  appreciated but is not required.
17  2. Altered source versions must be plainly marked as such, and must not be
18  misrepresented as being the original software.
19  3. This notice may not be removed or altered from any source distribution.
20 */
21 
28 #ifndef _SDL_surface_h
29 #define _SDL_surface_h
30 
31 #include "SDL_stdinc.h"
32 #include "SDL_pixels.h"
33 #include "SDL_rect.h"
34 #include "SDL_blendmode.h"
35 #include "SDL_rwops.h"
36 
37 #include "begin_code.h"
38 /* Set up for C function definitions, even when using C++ */
39 #ifdef __cplusplus
40 extern "C" {
41 #endif
42 
51 /* @{ */
52 #define SDL_SWSURFACE 0
53 #define SDL_PREALLOC 0x00000001
54 #define SDL_RLEACCEL 0x00000002
55 #define SDL_DONTFREE 0x00000004
56 /* @} *//* Surface flags */
57 
61 #define SDL_MUSTLOCK(S) (((S)->flags & SDL_RLEACCEL) != 0)
62 
69 typedef struct SDL_Surface
70 {
73  int w, h;
74  int pitch;
75  void *pixels;
78  void *userdata;
81  int locked;
82  void *lock_data;
88  struct SDL_BlitMap *map;
91  int refcount;
92 } SDL_Surface;
93 
97 typedef int (*SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect,
98  struct SDL_Surface * dst, SDL_Rect * dstrect);
99 
119  (Uint32 flags, int width, int height, int depth,
120  Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask);
122  int width,
123  int height,
124  int depth,
125  int pitch,
126  Uint32 Rmask,
127  Uint32 Gmask,
128  Uint32 Bmask,
129  Uint32 Amask);
131 
140  SDL_Palette * palette);
141 
164 
175  int freesrc);
176 
182 #define SDL_LoadBMP(file) SDL_LoadBMP_RW(SDL_RWFromFile(file, "rb"), 1)
183 
192  (SDL_Surface * surface, SDL_RWops * dst, int freedst);
193 
199 #define SDL_SaveBMP(surface, file) \
200  SDL_SaveBMP_RW(surface, SDL_RWFromFile(file, "wb"), 1)
201 
211  int flag);
212 
225  int flag, Uint32 key);
226 
238  Uint32 * key);
239 
253  Uint8 r, Uint8 g, Uint8 b);
254 
255 
269  Uint8 * r, Uint8 * g,
270  Uint8 * b);
271 
283  Uint8 alpha);
284 
296  Uint8 * alpha);
297 
309  SDL_BlendMode blendMode);
310 
322  SDL_BlendMode *blendMode);
323 
338  const SDL_Rect * rect);
339 
347  SDL_Rect * rect);
348 
360  (SDL_Surface * src, const SDL_PixelFormat * fmt, Uint32 flags);
362  (SDL_Surface * src, Uint32 pixel_format, Uint32 flags);
363 
369 extern DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height,
370  Uint32 src_format,
371  const void * src, int src_pitch,
372  Uint32 dst_format,
373  void * dst, int dst_pitch);
374 
385 extern DECLSPEC int SDLCALL SDL_FillRect
386  (SDL_Surface * dst, const SDL_Rect * rect, Uint32 color);
387 extern DECLSPEC int SDLCALL SDL_FillRects
388  (SDL_Surface * dst, const SDL_Rect * rects, int count, Uint32 color);
389 
447 #define SDL_BlitSurface SDL_UpperBlit
448 
453 extern DECLSPEC int SDLCALL SDL_UpperBlit
454  (SDL_Surface * src, const SDL_Rect * srcrect,
455  SDL_Surface * dst, SDL_Rect * dstrect);
456 
461 extern DECLSPEC int SDLCALL SDL_LowerBlit
462  (SDL_Surface * src, SDL_Rect * srcrect,
463  SDL_Surface * dst, SDL_Rect * dstrect);
464 
472  const SDL_Rect * srcrect,
473  SDL_Surface * dst,
474  const SDL_Rect * dstrect);
475 
476 #define SDL_BlitScaled SDL_UpperBlitScaled
477 
483  (SDL_Surface * src, const SDL_Rect * srcrect,
484  SDL_Surface * dst, SDL_Rect * dstrect);
485 
491  (SDL_Surface * src, SDL_Rect * srcrect,
492  SDL_Surface * dst, SDL_Rect * dstrect);
493 
494 
495 /* Ends C function definitions when using C++ */
496 #ifdef __cplusplus
497 }
498 #endif
499 #include "close_code.h"
500 
501 #endif /* _SDL_surface_h */
502 
503 /* vi: set ts=4 sw=4 expandtab: */
DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface)
Definition: SDL_surface.c:1053
DECLSPEC int SDLCALL SDL_SetSurfaceColorMod(SDL_Surface *surface, Uint8 r, Uint8 g, Uint8 b)
Set an additional color value used in blit operations.
Definition: SDL_surface.c:306
DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurface(Uint32 flags, int width, int height, int depth, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
Definition: SDL_surface.c:35
DECLSPEC int SDLCALL SDL_SetSurfaceAlphaMod(SDL_Surface *surface, Uint8 alpha)
Set an additional alpha value used in blit operations.
Definition: SDL_surface.c:351
GLuint color
Definition: glew.h:7185
SDL_BlendMode
The blend mode used in SDL_RenderCopy() and drawing operations.
Definition: SDL_blendmode.h:40
DECLSPEC int SDLCALL SDL_ConvertPixels(int width, int height, Uint32 src_format, const void *src, int src_pitch, Uint32 dst_format, void *dst, int dst_pitch)
Copy a block of pixels of one format to another format.
Definition: SDL_surface.c:984
GLboolean GLboolean g
Definition: glew.h:8736
SDL_bool
Definition: SDL_stdinc.h:116
DECLSPEC int SDLCALL SDL_SetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode blendMode)
Set the blend mode used for blit operations.
Definition: SDL_surface.c:387
struct SDL_Surface SDL_Surface
A collection of pixels used in software blitting.
EGLSurface surface
Definition: eglext.h:74
A collection of pixels used in software blitting.
Definition: SDL_surface.h:69
DECLSPEC int SDLCALL SDL_SaveBMP_RW(SDL_Surface *surface, SDL_RWops *dst, int freedst)
Definition: SDL_bmp.c:411
DECLSPEC SDL_bool SDLCALL SDL_SetClipRect(SDL_Surface *surface, const SDL_Rect *rect)
Definition: SDL_surface.c:453
DECLSPEC int SDLCALL SDL_SetSurfacePalette(SDL_Surface *surface, SDL_Palette *palette)
Set the palette used by a surface.
Definition: SDL_surface.c:143
EGLSurface EGLint EGLint EGLint EGLint height
Definition: eglext.h:293
#define DECLSPEC
Definition: begin_code.h:62
#define SDLCALL
Definition: begin_code.h:72
DECLSPEC int SDLCALL SDL_UpperBlit(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
Definition: SDL_surface.c:519
DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface *surface, Uint32 *key)
Gets the color key (transparent pixel) in a blittable surface.
Definition: SDL_surface.c:218
DECLSPEC void SDLCALL SDL_GetClipRect(SDL_Surface *surface, SDL_Rect *rect)
Definition: SDL_surface.c:477
DECLSPEC int SDLCALL SDL_FillRect(SDL_Surface *dst, const SDL_Rect *rect, Uint32 color)
Definition: SDL_fillrect.c:332
Uint32 flags
Definition: SDL_surface.h:71
DECLSPEC SDL_Surface *SDLCALL SDL_LoadBMP_RW(SDL_RWops *src, int freesrc)
Definition: SDL_bmp.c:80
uint32_t Uint32
An unsigned 32-bit integer type.
Definition: SDL_stdinc.h:145
DECLSPEC void SDLCALL SDL_UnlockSurface(SDL_Surface *surface)
Definition: SDL_surface.c:786
struct SDL_BlitMap * map
Definition: SDL_surface.h:88
GLenum GLenum dst
Definition: glew.h:2396
int
Definition: SDL_systhread.c:37
void * pixels
Definition: SDL_surface.h:75
EGLSurface EGLint EGLint EGLint width
Definition: eglext.h:293
DECLSPEC int SDLCALL SDL_GetSurfaceColorMod(SDL_Surface *surface, Uint8 *r, Uint8 *g, Uint8 *b)
Get the additional color value used in blit operations.
Definition: SDL_surface.c:332
GLint GLsizei count
Definition: gl2ext.h:1011
GLint GLenum GLsizei GLsizei GLsizei depth
Definition: gl2ext.h:845
DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurface(SDL_Surface *src, const SDL_PixelFormat *fmt, Uint32 flags)
Definition: SDL_surface.c:804
GLclampf GLclampf GLclampf alpha
Definition: glew.h:1506
DECLSPEC SDL_Surface *SDLCALL SDL_CreateRGBSurfaceFrom(void *pixels, int width, int height, int depth, int pitch, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
Definition: SDL_surface.c:122
SDL_Rect clip_rect
Definition: SDL_surface.h:85
DECLSPEC int SDLCALL SDL_UpperBlitScaled(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
Definition: SDL_surface.c:612
DECLSPEC SDL_Surface *SDLCALL SDL_ConvertSurfaceFormat(SDL_Surface *src, Uint32 pixel_format, Uint32 flags)
Definition: SDL_surface.c:928
DECLSPEC int SDLCALL SDL_LowerBlit(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
Definition: SDL_surface.c:496
DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface *surface, int flag, Uint32 key)
Sets the color key (transparent pixel) in a blittable surface.
Definition: SDL_surface.c:173
SDL_PixelFormat * format
Definition: SDL_surface.h:72
GLint GLenum GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl2ext.h:845
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
Definition: glew.h:2767
uint8_t Uint8
An unsigned 8-bit integer type.
Definition: SDL_stdinc.h:129
int(* SDL_blit)(struct SDL_Surface *src, SDL_Rect *srcrect, struct SDL_Surface *dst, SDL_Rect *dstrect)
The type of function used for surface blitting functions.
Definition: SDL_surface.h:97
DECLSPEC int SDLCALL SDL_LowerBlitScaled(SDL_Surface *src, SDL_Rect *srcrect, SDL_Surface *dst, SDL_Rect *dstrect)
Definition: SDL_surface.c:704
GLdouble GLdouble GLdouble r
Definition: glew.h:1392
GLdouble GLdouble GLdouble b
Definition: glew.h:8383
DECLSPEC int SDLCALL SDL_GetSurfaceAlphaMod(SDL_Surface *surface, Uint8 *alpha)
Get the additional alpha value used in blit operations.
Definition: SDL_surface.c:374
GLenum src
Definition: glew.h:2396
DECLSPEC int SDLCALL SDL_FillRects(SDL_Surface *dst, const SDL_Rect *rects, int count, Uint32 color)
Definition: SDL_fillrect.c:436
void * lock_data
Definition: SDL_surface.h:82
DECLSPEC int SDLCALL SDL_LockSurface(SDL_Surface *surface)
Sets up a surface for directly accessing the pixels.
Definition: SDL_surface.c:765
void * userdata
Definition: SDL_surface.h:78
A rectangle, with the origin at the upper left.
Definition: SDL_rect.h:63
DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface *surface, int flag)
Sets the RLE acceleration hint for a surface.
Definition: SDL_surface.c:152
DECLSPEC int SDLCALL SDL_SoftStretch(SDL_Surface *src, const SDL_Rect *srcrect, SDL_Surface *dst, const SDL_Rect *dstrect)
Perform a fast, low quality, stretch blit between two surfaces of the same pixel format.
Definition: SDL_stretch.c:203
DECLSPEC int SDLCALL SDL_GetSurfaceBlendMode(SDL_Surface *surface, SDL_BlendMode *blendMode)
Get the blend mode used for blit operations.
Definition: SDL_surface.c:424