ReactOS Fundraising Campaign 2012
 
€ 4,410 / € 30,000

Information | Donate

Home | Info | Community | Development | myReactOS | Contact Us

  1. Home
  2. Community
  3. Development
  4. myReactOS
  5. Fundraiser 2012

  1. Main Page
  2. Alphabetical List
  3. Data Structures
  4. Directories
  5. File List
  6. Data Fields
  7. Globals
  8. Related Pages

ReactOS Development > Doxygen

wrapper.c
Go to the documentation of this file.
00001 /*
00002  * Texture compression
00003  * Version:  1.0
00004  *
00005  * Copyright (C) 2004  Daniel Borca   All Rights Reserved.
00006  *
00007  * this is free software; you can redistribute it and/or modify
00008  * it under the terms of the GNU General Public License as published by
00009  * the Free Software Foundation; either version 2, or (at your option)
00010  * any later version.
00011  *
00012  * this is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with GNU Make; see the file COPYING.  If not, write to
00019  * the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.    
00020  */
00021 
00022 
00023 #include <assert.h>
00024 
00025 #include "types.h"
00026 #include "internal.h"
00027 #include "dxtn.h"
00028 
00029 
00030 #define GL_COMPRESSED_RGB_S3TC_DXT1_EXT   0x83F0
00031 #define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT  0x83F1
00032 #define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT  0x83F2
00033 #define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT  0x83F3
00034 
00035 
00036 TAPI void TAPIENTRY
00037 fetch_2d_texel_rgb_dxt1 (int texImage_RowStride,
00038              const byte *texImage_Data,
00039              int i, int j,
00040              byte *texel)
00041 {
00042     dxt1_rgb_decode_1(texImage_Data, texImage_RowStride, i, j, texel);
00043 }
00044 
00045 
00046 TAPI void TAPIENTRY
00047 fetch_2d_texel_rgba_dxt1 (int texImage_RowStride,
00048               const byte *texImage_Data,
00049               int i, int j,
00050               byte *texel)
00051 {
00052     dxt1_rgba_decode_1(texImage_Data, texImage_RowStride, i, j, texel);
00053 }
00054 
00055 
00056 TAPI void TAPIENTRY
00057 fetch_2d_texel_rgba_dxt3 (int texImage_RowStride,
00058               const byte *texImage_Data,
00059               int i, int j,
00060               byte *texel)
00061 {
00062     dxt3_rgba_decode_1(texImage_Data, texImage_RowStride, i, j, texel);
00063 }
00064 
00065 
00066 TAPI void TAPIENTRY
00067 fetch_2d_texel_rgba_dxt5 (int texImage_RowStride,
00068               const byte *texImage_Data,
00069               int i, int j,
00070               byte *texel)
00071 {
00072     dxt5_rgba_decode_1(texImage_Data, texImage_RowStride, i, j, texel);
00073 }
00074 
00075 
00076 TAPI void TAPIENTRY
00077 tx_compress_dxtn (int srccomps, int width, int height,
00078           const byte *source, int destformat, byte *dest,
00079           int destRowStride)
00080 {
00081     int srcRowStride = width * srccomps;
00082     int rv;
00083 
00084     switch (destformat) {
00085     case GL_COMPRESSED_RGB_S3TC_DXT1_EXT:
00086         rv = dxt1_rgb_encode(width, height, srccomps,
00087                  source, srcRowStride,
00088                  dest, destRowStride);
00089         break;
00090     case GL_COMPRESSED_RGBA_S3TC_DXT1_EXT:
00091         rv = dxt1_rgba_encode(width, height, srccomps,
00092                   source, srcRowStride,
00093                   dest, destRowStride);
00094         break;
00095     case GL_COMPRESSED_RGBA_S3TC_DXT3_EXT:
00096         rv = dxt3_rgba_encode(width, height, srccomps,
00097                   source, srcRowStride,
00098                   dest, destRowStride);
00099         break;
00100     case GL_COMPRESSED_RGBA_S3TC_DXT5_EXT:
00101         rv = dxt5_rgba_encode(width, height, srccomps,
00102                   source, srcRowStride,
00103                   dest, destRowStride);
00104         break;
00105     default:
00106         assert(0);
00107     }
00108 
00109     /*return rv;*/
00110 }

Generated on Mon May 28 2012 04:19:07 for ReactOS by doxygen 1.7.6.1

ReactOS is a registered trademark or a trademark of ReactOS Foundation in the United States and other countries.