Rev 1 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 1 | Rev 8 | ||
---|---|---|---|
Line 1... | Line 1... | ||
1 | /* |
1 | /* |
2 | Simple DirectMedia Layer |
2 | Simple DirectMedia Layer |
3 | Copyright (C) 1997- |
3 | Copyright (C) 1997-2018 Sam Lantinga <slouken@libsdl.org> |
4 | 4 | ||
5 | This software is provided 'as-is', without any express or implied |
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 |
6 | warranty. In no event will the authors be held liable for any damages |
7 | arising from the use of this software. |
7 | arising from the use of this software. |
8 | 8 | ||
Line 94... | Line 94... | ||
94 | /** |
94 | /** |
95 | * \brief The type of function used for surface blitting functions. |
95 | * \brief The type of function used for surface blitting functions. |
96 | */ |
96 | */ |
97 | typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, |
97 | typedef int (SDLCALL *SDL_blit) (struct SDL_Surface * src, SDL_Rect * srcrect, |
98 | struct SDL_Surface * dst, SDL_Rect * dstrect); |
98 | struct SDL_Surface * dst, SDL_Rect * dstrect); |
- | 99 | ||
- | 100 | /** |
|
- | 101 | * \brief The formula used for converting between YUV and RGB |
|
- | 102 | */ |
|
- | 103 | typedef enum |
|
- | 104 | { |
|
- | 105 | SDL_YUV_CONVERSION_JPEG, /**< Full range JPEG */ |
|
- | 106 | SDL_YUV_CONVERSION_BT601, /**< BT.601 (the default) */ |
|
- | 107 | SDL_YUV_CONVERSION_BT709, /**< BT.709 */ |
|
- | 108 | SDL_YUV_CONVERSION_AUTOMATIC /**< BT.601 for SD content, BT.709 for HD content */ |
|
- | 109 | } SDL_YUV_CONVERSION_MODE; |
|
99 | 110 | ||
100 | /** |
111 | /** |
101 | * Allocate and free an RGB surface. |
112 | * Allocate and free an RGB surface. |
102 | * |
113 | * |
103 | * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. |
114 | * If the depth is 4 or 8 bits, an empty palette is allocated for the surface. |
Line 198... | Line 209... | ||
198 | * not supported. |
209 | * not supported. |
199 | * |
210 | * |
200 | * If \c freedst is non-zero, the stream will be closed after being written. |
211 | * If \c freedst is non-zero, the stream will be closed after being written. |
201 | * |
212 | * |
202 | * \return 0 if successful or -1 if there was an error. |
213 | * \return 0 if successful or -1 if there was an error. |
203 | */ |
214 | */ |
204 | extern DECLSPEC int SDLCALL SDL_SaveBMP_RW |
215 | extern DECLSPEC int SDLCALL SDL_SaveBMP_RW |
205 | (SDL_Surface * surface, SDL_RWops * dst, int freedst); |
216 | (SDL_Surface * surface, SDL_RWops * dst, int freedst); |
206 | 217 | ||
207 | /** |
218 | /** |
208 | * Save a surface to a file. |
219 | * Save a surface to a file. |
Line 223... | Line 234... | ||
223 | extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, |
234 | extern DECLSPEC int SDLCALL SDL_SetSurfaceRLE(SDL_Surface * surface, |
224 | int flag); |
235 | int flag); |
225 | 236 | ||
226 | /** |
237 | /** |
227 | * \brief Sets the color key (transparent pixel) in a blittable surface. |
238 | * \brief Sets the color key (transparent pixel) in a blittable surface. |
228 | * |
239 | * |
229 | * \param surface The surface to update |
240 | * \param surface The surface to update |
230 | * \param flag Non-zero to enable colorkey and 0 to disable colorkey |
241 | * \param flag Non-zero to enable colorkey and 0 to disable colorkey |
231 | * \param key The transparent pixel in the native surface format |
242 | * \param key The transparent pixel in the native surface format |
232 | * |
243 | * |
233 | * \return 0 on success, or -1 if the surface is not valid |
244 | * \return 0 on success, or -1 if the surface is not valid |
234 | * |
245 | * |
235 | * You can pass SDL_RLEACCEL to enable RLE accelerated blits. |
246 | * You can pass SDL_RLEACCEL to enable RLE accelerated blits. |
236 | */ |
247 | */ |
237 | extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, |
248 | extern DECLSPEC int SDLCALL SDL_SetColorKey(SDL_Surface * surface, |
238 | int flag, Uint32 key); |
249 | int flag, Uint32 key); |
- | 250 | ||
- | 251 | /** |
|
- | 252 | * \brief Returns whether the surface has a color key |
|
- | 253 | * |
|
- | 254 | * \return SDL_TRUE if the surface has a color key, or SDL_FALSE if the surface is NULL or has no color key |
|
- | 255 | */ |
|
- | 256 | extern DECLSPEC SDL_bool SDLCALL SDL_HasColorKey(SDL_Surface * surface); |
|
239 | 257 | ||
240 | /** |
258 | /** |
241 | * \brief Gets the color key (transparent pixel) in a blittable surface. |
259 | * \brief Gets the color key (transparent pixel) in a blittable surface. |
242 | * |
260 | * |
243 | * \param surface The surface to update |
261 | * \param surface The surface to update |
244 | * \param key A pointer filled in with the transparent pixel in the native |
262 | * \param key A pointer filled in with the transparent pixel in the native |
245 | * surface format |
263 | * surface format |
246 | * |
264 | * |
247 | * \return 0 on success, or -1 if the surface is not valid or colorkey is not |
265 | * \return 0 on success, or -1 if the surface is not valid or colorkey is not |
Line 250... | Line 268... | ||
250 | extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, |
268 | extern DECLSPEC int SDLCALL SDL_GetColorKey(SDL_Surface * surface, |
251 | Uint32 * key); |
269 | Uint32 * key); |
252 | 270 | ||
253 | /** |
271 | /** |
254 | * \brief Set an additional color value used in blit operations. |
272 | * \brief Set an additional color value used in blit operations. |
255 | * |
273 | * |
256 | * \param surface The surface to update. |
274 | * \param surface The surface to update. |
257 | * \param r The red color value multiplied into blit operations. |
275 | * \param r The red color value multiplied into blit operations. |
258 | * \param g The green color value multiplied into blit operations. |
276 | * \param g The green color value multiplied into blit operations. |
259 | * \param b The blue color value multiplied into blit operations. |
277 | * \param b The blue color value multiplied into blit operations. |
260 | * |
278 | * |
Line 507... | Line 525... | ||
507 | */ |
525 | */ |
508 | extern DECLSPEC int SDLCALL SDL_LowerBlitScaled |
526 | extern DECLSPEC int SDLCALL SDL_LowerBlitScaled |
509 | (SDL_Surface * src, SDL_Rect * srcrect, |
527 | (SDL_Surface * src, SDL_Rect * srcrect, |
510 | SDL_Surface * dst, SDL_Rect * dstrect); |
528 | SDL_Surface * dst, SDL_Rect * dstrect); |
511 | 529 | ||
- | 530 | /** |
|
- | 531 | * \brief Set the YUV conversion mode |
|
- | 532 | */ |
|
- | 533 | extern DECLSPEC void SDLCALL SDL_SetYUVConversionMode(SDL_YUV_CONVERSION_MODE mode); |
|
- | 534 | ||
- | 535 | /** |
|
- | 536 | * \brief Get the YUV conversion mode |
|
- | 537 | */ |
|
- | 538 | extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionMode(void); |
|
- | 539 | ||
- | 540 | /** |
|
- | 541 | * \brief Get the YUV conversion mode, returning the correct mode for the resolution when the current conversion mode is SDL_YUV_CONVERSION_AUTOMATIC |
|
- | 542 | */ |
|
- | 543 | extern DECLSPEC SDL_YUV_CONVERSION_MODE SDLCALL SDL_GetYUVConversionModeForResolution(int width, int height); |
|
512 | 544 | ||
513 | /* Ends C function definitions when using C++ */ |
545 | /* Ends C function definitions when using C++ */ |
514 | #ifdef __cplusplus |
546 | #ifdef __cplusplus |
515 | } |
547 | } |
516 | #endif |
548 | #endif |