]> de.git.xonotic.org Git - xonotic/darkplaces.git/blob - image.h
now clears stencil to 128 instead of 0, this avoids problems with arbitrary incr...
[xonotic/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(const qbyte *in, qbyte *out, int pixels, const qbyte *gammar, const qbyte *gammag, const qbyte *gammab);
7
8 // converts 8bit image data to RGBA, in can not be the same as out
9 void Image_Copy8bitRGBA(const qbyte *in, qbyte *out, int pixels, const unsigned int *pal);
10
11 // makes a RGBA mask from RGBA input, in can be the same as out
12 int image_makemask (const qbyte *in, qbyte *out, int size);
13
14 // loads a texture, as pixel data
15 qbyte *loadimagepixels (const char *filename, qboolean complain, int matchwidth, int matchheight);
16
17 // loads a texture, as a texture
18 rtexture_t *loadtextureimage (rtexturepool_t *pool, const char *filename, int matchwidth, int matchheight, qboolean complain, int flags);
19
20 // loads a texture's alpha mask, as pixel data
21 qbyte *loadimagepixelsmask (const 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, const char *filename, int matchwidth, int matchheight, qboolean complain, int flags);
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 *image_nmaptex;
29 rtexture_t *loadtextureimagewithmask (rtexturepool_t *pool, const char *filename, int matchwidth, int matchheight, qboolean complain, int flags);
30 rtexture_t *loadtextureimagewithmaskandnmap (rtexturepool_t *pool, const char *filename, int matchwidth, int matchheight, qboolean complain, int flags, float bumpscale);
31
32 // writes a RGB TGA that is already upside down (which TGA wants)
33 qboolean Image_WriteTGARGB_preflipped (const char *filename, int width, int height, const qbyte *data);
34
35 // writes a RGB TGA
36 void Image_WriteTGARGB (const char *filename, int width, int height, const qbyte *data);
37
38 // writes a RGBA TGA
39 void Image_WriteTGARGBA (const char *filename, int width, int height, const qbyte *data);
40
41 // returns true if the image has some translucent pixels
42 qboolean Image_CheckAlpha(const qbyte *data, int size, qboolean rgba);
43
44 // resizes the image (in can not be the same as out)
45 void Image_Resample (const void *indata, int inwidth, int inheight, int indepth, void *outdata, int outwidth, int outheight, int outdepth, int bytesperpixel, int quality);
46
47 // scales the image down by a power of 2 (in can be the same as out)
48 void Image_MipReduce(const qbyte *in, qbyte *out, int *width, int *height, int *depth, int destwidth, int destheight, int destdepth, int bytesperpixel);
49
50 // only used by menuplyr coloring
51 qbyte *LoadLMPAs8Bit (const qbyte *f, int matchwidth, int matchheight);
52
53 void Image_HeightmapToNormalmap(const unsigned char *inpixels, unsigned char *outpixels, int width, int height, int clamp, float bumpscale);
54
55 #endif
56