]> icculus.org git repositories - divverent/darkplaces.git/blob - image.h
fixed.
[divverent/darkplaces.git] / image.h
1
2 #ifndef IMAGE_H
3 #define IMAGE_H
4
5 // applies gamma correction to RGB pixels, in can be the same as out
6 void Image_GammaRemapRGB(qbyte *in, qbyte *out, int pixels, qbyte *gammar, qbyte *gammag, qbyte *gammab);
7
8 // converts 8bit image data to RGBA, in can not be the same as out
9 void Image_Copy8bitRGBA(qbyte *in, qbyte *out, int pixels, int *pal);
10
11 // makes a RGBA mask from RGBA input, in can be the same as out
12 int image_makemask (qbyte *in, qbyte *out, int size);
13
14 // loads a texture, as pixel data
15 qbyte *loadimagepixels (char* filename, qboolean complain, int matchwidth, int matchheight);
16
17 // loads a texture, as a texture
18 rtexture_t *loadtextureimage (rtexturepool_t *pool, char* filename, int matchwidth, int matchheight, qboolean complain, qboolean mipmap, qboolean precache);
19
20 // loads a texture's alpha mask, as pixel data
21 qbyte *loadimagepixelsmask (char* filename, qboolean complain, int matchwidth, int matchheight);
22
23 // loads a texture's alpha mask, as a texture
24 rtexture_t *loadtextureimagemask (rtexturepool_t *pool, char* filename, int matchwidth, int matchheight, qboolean complain, qboolean mipmap, qboolean precache);
25
26 // loads a texture and it's alpha mask at once (NULL if it has no translucent pixels)
27 rtexture_t *image_masktex;
28 rtexture_t *loadtextureimagewithmask (rtexturepool_t *pool, char* filename, int matchwidth, int matchheight, qboolean complain, qboolean mipmap, qboolean precache);
29
30 // writes a RGB TGA that is already upside down (which TGA wants)
31 qboolean Image_WriteTGARGB_preflipped (char *filename, int width, int height, qbyte *data);
32
33 // writes a RGB TGA
34 void Image_WriteTGARGB (char *filename, int width, int height, qbyte *data);
35
36 // writes a RGBA TGA
37 void Image_WriteTGARGBA (char *filename, int width, int height, qbyte *data);
38
39 // returns true if the image has some translucent pixels
40 qboolean Image_CheckAlpha(qbyte *data, int size, qboolean rgba);
41
42 // resizes the image (in can not be the same as out)
43 void Image_Resample (void *indata, int inwidth, int inheight, void *outdata, int outwidth, int outheight, int bytesperpixel, int quality);
44
45 // scales the image down by a power of 2 (in can be the same as out)
46 void Image_MipReduce(qbyte *in, qbyte *out, int *width, int *height, int destwidth, int destheight, int bytesperpixel);
47
48 // only used by menuplyr coloring
49 qbyte *LoadLMPAs8Bit (qbyte *f, int matchwidth, int matchheight);
50
51 #endif
52