egra: cosmetix
[iv.d.git] / sdl2 / image.d
blob75011e8846aafd7f3038b41e4828ccf2a193e239
1 /*
3 Boost Software License - Version 1.0 - August 17th, 2003
5 Permission is hereby granted, free of charge, to any person or organization
6 obtaining a copy of the software and accompanying documentation covered by
7 this license (the "Software") to use, reproduce, display, distribute,
8 execute, and transmit the Software, and to prepare derivative works of the
9 Software, and to permit third-parties to whom the Software is furnished to
10 do so, all subject to the following:
12 The copyright notices in the Software and this entire statement, including
13 the above license grant, this restriction and the following disclaimer,
14 must be included in all copies of the Software, in whole or in part, and
15 all derivative works of the Software, unless such copies or derivative
16 works are solely in the form of machine-executable object code generated by
17 a source language processor.
19 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
20 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 FITNESS FOR A PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT
22 SHALL THE COPYRIGHT HOLDERS OR ANYONE DISTRIBUTING THE SOFTWARE BE LIABLE
23 FOR ANY DAMAGES OR OTHER LIABILITY, WHETHER IN CONTRACT, TORT OR OTHERWISE,
24 ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
25 DEALINGS IN THE SOFTWARE.
28 module iv.sdl2.image /*is aliced*/;
29 pragma(lib, "SDL2_image");
31 import iv.sdl2.sdl;
33 alias IMG_SetError = SDL_SetError;
34 alias IMG_GetError = SDL_GetError;
36 enum : ubyte {
37 SDL_IMAGE_MAJOR_VERSION = 2,
38 SDL_IMAGE_MINOR_VERSION = 0,
39 SDL_IMAGE_PATCHLEVEL = 0,
42 void SDL_IMAGE_VERSION() (ref SDL_version x) {
43 x.major = SDL_IMAGE_MAJOR_VERSION;
44 x.minor = SDL_IMAGE_MINOR_VERSION;
45 x.patch = SDL_IMAGE_PATCHLEVEL;
48 enum {
49 IMG_INIT_JPG = 0x00000001,
50 IMG_INIT_PNG = 0x00000002,
51 IMG_INIT_TIF = 0x00000004,
52 IMG_INIT_WEBP = 0x00000008,
55 extern(C) @nogc nothrow {
56 int IMG_Init (int);
57 int IMG_Quit ();
58 const(SDL_version)* IMG_Linked_Version ();
59 SDL_Surface* IMG_LoadTyped_RW (SDL_RWops*, int, const(char)*);
60 SDL_Surface* IMG_Load (const( char )*);
61 SDL_Surface* IMG_Load_RW (SDL_RWops*, int);
63 SDL_Texture* IMG_LoadTexture (SDL_Renderer*, const(char)*);
64 SDL_Texture* IMG_LoadTexture_RW (SDL_Renderer*, SDL_RWops*, int);
65 SDL_Texture* IMG_LoadTextureTyped_RW (SDL_Renderer*, SDL_RWops*, int, const(char)*);
67 int IMG_isICO (SDL_RWops*);
68 int IMG_isCUR (SDL_RWops*);
69 int IMG_isBMP (SDL_RWops*);
70 int IMG_isGIF (SDL_RWops*);
71 int IMG_isJPG (SDL_RWops*);
72 int IMG_isLBM (SDL_RWops*);
73 int IMG_isPCX (SDL_RWops*);
74 int IMG_isPNG (SDL_RWops*);
75 int IMG_isPNM (SDL_RWops*);
76 int IMG_isTIF (SDL_RWops*);
77 int IMG_isXCF (SDL_RWops*);
78 int IMG_isXPM (SDL_RWops*);
79 int IMG_isXV (SDL_RWops*);
80 int IMG_isWEBP (SDL_RWops*);
82 SDL_Surface* IMG_LoadICO_RW (SDL_RWops*);
83 SDL_Surface* IMG_LoadCUR_RW (SDL_RWops*);
84 SDL_Surface* IMG_LoadBMP_RW (SDL_RWops*);
85 SDL_Surface* IMG_LoadGIF_RW (SDL_RWops*);
86 SDL_Surface* IMG_LoadJPG_RW (SDL_RWops*);
87 SDL_Surface* IMG_LoadLBM_RW (SDL_RWops*);
88 SDL_Surface* IMG_LoadPCX_RW (SDL_RWops*);
89 SDL_Surface* IMG_LoadPNG_RW (SDL_RWops*);
90 SDL_Surface* IMG_LoadPNM_RW (SDL_RWops*);
91 SDL_Surface* IMG_LoadTGA_RW (SDL_RWops*);
92 SDL_Surface* IMG_LoadTIF_RW (SDL_RWops*);
93 SDL_Surface* IMG_LoadXCF_RW (SDL_RWops*);
94 SDL_Surface* IMG_LoadXPM_RW (SDL_RWops*);
95 SDL_Surface* IMG_LoadXV_RW (SDL_RWops*);
96 SDL_Surface* IMG_LoadWEBP_RW (SDL_RWops*);
98 SDL_Surface* IMG_ReadXPMFromArray (char**);
100 int IMG_SavePNG (SDL_Surface*, const(char)*);
101 int IMG_SavePNG_RW (SDL_Surface*, SDL_RWops*, int);