u_tile.h

Go to the documentation of this file.
00001 /**************************************************************************
00002  * 
00003  * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
00004  * All Rights Reserved.
00005  * 
00006  * Permission is hereby granted, free of charge, to any person obtaining a
00007  * copy of this software and associated documentation files (the
00008  * "Software"), to deal in the Software without restriction, including
00009  * without limitation the rights to use, copy, modify, merge, publish,
00010  * distribute, sub license, and/or sell copies of the Software, and to
00011  * permit persons to whom the Software is furnished to do so, subject to
00012  * the following conditions:
00013  * 
00014  * The above copyright notice and this permission notice (including the
00015  * next paragraph) shall be included in all copies or substantial portions
00016  * of the Software.
00017  * 
00018  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
00019  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
00020  * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
00021  * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
00022  * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
00023  * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
00024  * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
00025  * 
00026  **************************************************************************/
00027 
00028 #ifndef P_TILE_H
00029 #define P_TILE_H
00030 
00031 #include "pipe/p_compiler.h"
00032 
00033 struct pipe_surface;
00034 
00035 
00040 static INLINE boolean
00041 pipe_clip_tile(uint x, uint y, uint *w, uint *h, const struct pipe_surface *ps)
00042 {
00043    if (x >= ps->width)
00044       return TRUE;
00045    if (y >= ps->height)
00046       return TRUE;
00047    if (x + *w > ps->width)
00048       *w = ps->width - x;
00049    if (y + *h > ps->height)
00050       *h = ps->height - y;
00051    return FALSE;
00052 }
00053 
00054 #ifdef __cplusplus
00055 extern "C" {
00056 #endif
00057 
00058 void
00059 pipe_get_tile_raw(struct pipe_surface *ps,
00060                   uint x, uint y, uint w, uint h,
00061                   void *p, int dst_stride);
00062 
00063 void
00064 pipe_put_tile_raw(struct pipe_surface *ps,
00065                   uint x, uint y, uint w, uint h,
00066                   const void *p, int src_stride);
00067 
00068 
00069 void
00070 pipe_get_tile_rgba(struct pipe_surface *ps,
00071                    uint x, uint y, uint w, uint h,
00072                    float *p);
00073 
00074 void
00075 pipe_put_tile_rgba(struct pipe_surface *ps,
00076                    uint x, uint y, uint w, uint h,
00077                    const float *p);
00078 
00079 
00080 void
00081 pipe_get_tile_z(struct pipe_surface *ps,
00082                 uint x, uint y, uint w, uint h,
00083                 uint *z);
00084 
00085 void
00086 pipe_put_tile_z(struct pipe_surface *ps,
00087                 uint x, uint y, uint w, uint h,
00088                 const uint *z);
00089 
00090 void
00091 pipe_tile_raw_to_rgba(enum pipe_format format,
00092                       void *src,
00093                       uint w, uint h,
00094                       float *dst, unsigned dst_stride);
00095 
00096 
00097 #ifdef __cplusplus
00098 }
00099 #endif
00100 
00101 #endif

Generated on Tue Sep 29 06:25:15 2009 for Gallium3D by  doxygen 1.5.4