17117f1b4Smrg/*
27117f1b4Smrg * Mesa 3-D graphics library
37117f1b4Smrg *
47117f1b4Smrg * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
57117f1b4Smrg *
67117f1b4Smrg * Permission is hereby granted, free of charge, to any person obtaining a
77117f1b4Smrg * copy of this software and associated documentation files (the "Software"),
87117f1b4Smrg * to deal in the Software without restriction, including without limitation
97117f1b4Smrg * the rights to use, copy, modify, merge, publish, distribute, sublicense,
107117f1b4Smrg * and/or sell copies of the Software, and to permit persons to whom the
117117f1b4Smrg * Software is furnished to do so, subject to the following conditions:
127117f1b4Smrg *
137117f1b4Smrg * The above copyright notice and this permission notice shall be included
147117f1b4Smrg * in all copies or substantial portions of the Software.
157117f1b4Smrg *
167117f1b4Smrg * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
177117f1b4Smrg * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
187117f1b4Smrg * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
19af69d88dSmrg * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20af69d88dSmrg * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21af69d88dSmrg * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22af69d88dSmrg * OTHER DEALINGS IN THE SOFTWARE.
237117f1b4Smrg */
247117f1b4Smrg
257117f1b4Smrg
267117f1b4Smrg#ifndef MIPMAP_H
277117f1b4Smrg#define MIPMAP_H
287117f1b4Smrg
2901e04c3fSmrg#include "glheader.h"
307117f1b4Smrg
3101e04c3fSmrgstruct gl_context;
3201e04c3fSmrgstruct gl_texture_object;
3301e04c3fSmrg
3401e04c3fSmrgunsigned
3501e04c3fSmrg_mesa_compute_num_levels(struct gl_context *ctx,
3601e04c3fSmrg                         struct gl_texture_object *texObj,
3701e04c3fSmrg                         GLenum target);
38c1f859d4Smrg
39c1f859d4Smrgextern void
40c1f859d4Smrg_mesa_generate_mipmap_level(GLenum target,
41c1f859d4Smrg                            GLenum datatype, GLuint comps,
42c1f859d4Smrg                            GLint border,
43c1f859d4Smrg                            GLint srcWidth, GLint srcHeight, GLint srcDepth,
44af69d88dSmrg                            const GLubyte **srcData,
45c1f859d4Smrg                            GLint srcRowStride,
46c1f859d4Smrg                            GLint dstWidth, GLint dstHeight, GLint dstDepth,
47af69d88dSmrg                            GLubyte **dstData,
48c1f859d4Smrg                            GLint dstRowStride);
49c1f859d4Smrg
5001e04c3fSmrgvoid
5101e04c3fSmrg_mesa_prepare_mipmap_levels(struct gl_context *ctx,
5201e04c3fSmrg                            struct gl_texture_object *texObj,
5301e04c3fSmrg                            unsigned baseLevel, unsigned maxLevel);
54af69d88dSmrg
557117f1b4Smrgextern void
563464ebd5Sriastradh_mesa_generate_mipmap(struct gl_context *ctx, GLenum target,
577117f1b4Smrg                      struct gl_texture_object *texObj);
587117f1b4Smrg
59af69d88dSmrgextern GLboolean
60af69d88dSmrg_mesa_next_mipmap_level_size(GLenum target, GLint border,
61af69d88dSmrg                       GLint srcWidth, GLint srcHeight, GLint srcDepth,
62af69d88dSmrg                       GLint *dstWidth, GLint *dstHeight, GLint *dstDepth);
637117f1b4Smrg
647117f1b4Smrg#endif /* MIPMAP_H */
65