]> icculus.org git repositories - divverent/darkplaces.git/blob - image.h
I guess those glLoadIdentity calls were more important than expected
[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(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 rtexture_t *loadtextureimagebumpasnmap (rtexturepool_t *pool, const char *filename, int matchwidth, int matchheight, qboolean complain, int flags, float bumpscale);
32
33 // writes a RGB TGA that is already upside down (which TGA wants)
34 qboolean Image_WriteTGARGB_preflipped (const char *filename, int width, int height, const qbyte *data);
35
36 // writes a RGB TGA
37 void Image_WriteTGARGB (const char *filename, int width, int height, const qbyte *data);
38
39 // writes a RGBA TGA
40 void Image_WriteTGARGBA (const char *filename, int width, int height, const qbyte *data);
41
42 // returns true if the image has some translucent pixels
43 qboolean Image_CheckAlpha(const qbyte *data, int size, qboolean rgba);
44
45 // resizes the image (in can not be the same as out)
46 void Image_Resample (const void *indata, int inwidth, int inheight, int indepth, void *outdata, int outwidth, int outheight, int outdepth, int bytesperpixel, int quality);
47
48 // scales the image down by a power of 2 (in can be the same as out)
49 void Image_MipReduce(const qbyte *in, qbyte *out, int *width, int *height, int *depth, int destwidth, int destheight, int destdepth, int bytesperpixel);
50
51 // only used by menuplyr coloring
52 qbyte *LoadLMPAs8Bit (const qbyte *f, int matchwidth, int matchheight);
53
54 void Image_HeightmapToNormalmap(const unsigned char *inpixels, unsigned char *outpixels, int width, int height, int clamp, float bumpscale);
55
56 #endif
57