From fc82c5b342f199a4adf25ec2f1e5e8eda2ac4605 Mon Sep 17 00:00:00 2001 From: DJRobX Date: Fri, 9 Nov 2007 01:40:27 +0000 Subject: [PATCH] Move dependencies into new dependencies folder for cleanliness Remove blargg audio core but leave interpolation --- VBA.sln | 20 +- VBA.vcproj | 22 +- src/GBAinline.h | 9 +- src/Gb_Apu/Blip_Buffer.cpp | 2 +- src/Gb_Apu/Gb_Oscs.cpp | 4 +- src/Sound.cpp | 846 ++- src/Sound.h | 20 +- src/gb/GB.cpp | 11 +- src/gb/gbSound.cpp | 604 +- src/gb/gbSound.h | 4 - src/win32/MainWnd.cpp | 2 +- src/win32/dependencies/cximage/cximage.vcproj | 367 - src/win32/dependencies/cximage/license.txt | 48 - src/win32/dependencies/cximage/tif_xfile.cpp | 208 - src/win32/dependencies/cximage/xfile.h | 76 - src/win32/dependencies/cximage/ximabmp.cpp | 361 - src/win32/dependencies/cximage/ximabmp.h | 79 - src/win32/dependencies/cximage/ximacfg.h | 52 - src/win32/dependencies/cximage/ximadef.h | 197 - src/win32/dependencies/cximage/ximadsp.cpp | 2370 ------ src/win32/dependencies/cximage/ximaenc.cpp | 920 --- src/win32/dependencies/cximage/ximaexif.cpp | 873 --- src/win32/dependencies/cximage/ximage.cpp | 498 -- src/win32/dependencies/cximage/ximage.h | 648 -- src/win32/dependencies/cximage/ximagif.cpp | 1564 ---- src/win32/dependencies/cximage/ximagif.h | 248 - src/win32/dependencies/cximage/ximahist.cpp | 649 -- src/win32/dependencies/cximage/ximaico.cpp | 299 - src/win32/dependencies/cximage/ximaico.h | 52 - src/win32/dependencies/cximage/ximainfo.cpp | 388 - src/win32/dependencies/cximage/ximaint.cpp | 1030 --- src/win32/dependencies/cximage/ximaiter.h | 252 - src/win32/dependencies/cximage/ximaj2k.cpp | 250 - src/win32/dependencies/cximage/ximaj2k.h | 46 - src/win32/dependencies/cximage/ximajas.cpp | 265 - src/win32/dependencies/cximage/ximajas.h | 84 - src/win32/dependencies/cximage/ximajbg.cpp | 162 - src/win32/dependencies/cximage/ximajbg.h | 44 - src/win32/dependencies/cximage/ximajpg.cpp | 454 -- src/win32/dependencies/cximage/ximajpg.h | 315 - src/win32/dependencies/cximage/ximalpha.cpp | 321 - src/win32/dependencies/cximage/ximalyr.cpp | 105 - src/win32/dependencies/cximage/ximamng.cpp | 366 - src/win32/dependencies/cximage/ximamng.h | 86 - src/win32/dependencies/cximage/ximapal.cpp | 707 -- src/win32/dependencies/cximage/ximapcx.cpp | 445 -- src/win32/dependencies/cximage/ximapcx.h | 63 - src/win32/dependencies/cximage/ximapng.cpp | 507 -- src/win32/dependencies/cximage/ximapng.h | 73 - src/win32/dependencies/cximage/ximasel.cpp | 469 -- src/win32/dependencies/cximage/ximatga.cpp | 300 - src/win32/dependencies/cximage/ximatga.h | 60 - src/win32/dependencies/cximage/ximath.cpp | 97 - src/win32/dependencies/cximage/ximath.h | 39 - src/win32/dependencies/cximage/ximatif.cpp | 763 -- src/win32/dependencies/cximage/ximatif.h | 60 - src/win32/dependencies/cximage/ximatran.cpp | 2439 ------- src/win32/dependencies/cximage/ximawbmp.cpp | 85 - src/win32/dependencies/cximage/ximawbmp.h | 44 - src/win32/dependencies/cximage/ximawmf.cpp | 458 -- src/win32/dependencies/cximage/ximawmf.h | 154 - src/win32/dependencies/cximage/ximawnd.cpp | 1110 --- src/win32/dependencies/cximage/xiofile.h | 112 - src/win32/dependencies/cximage/xmemfile.cpp | 173 - src/win32/dependencies/cximage/xmemfile.h | 39 - src/win32/dependencies/glext.h | 6498 ----------------- src/win32/dependencies/info.txt | 1 - 67 files changed, 1047 insertions(+), 28870 deletions(-) delete mode 100644 src/win32/dependencies/cximage/cximage.vcproj delete mode 100644 src/win32/dependencies/cximage/license.txt delete mode 100644 src/win32/dependencies/cximage/tif_xfile.cpp delete mode 100644 src/win32/dependencies/cximage/xfile.h delete mode 100644 src/win32/dependencies/cximage/ximabmp.cpp delete mode 100644 src/win32/dependencies/cximage/ximabmp.h delete mode 100644 src/win32/dependencies/cximage/ximacfg.h delete mode 100644 src/win32/dependencies/cximage/ximadef.h delete mode 100644 src/win32/dependencies/cximage/ximadsp.cpp delete mode 100644 src/win32/dependencies/cximage/ximaenc.cpp delete mode 100644 src/win32/dependencies/cximage/ximaexif.cpp delete mode 100644 src/win32/dependencies/cximage/ximage.cpp delete mode 100644 src/win32/dependencies/cximage/ximage.h delete mode 100644 src/win32/dependencies/cximage/ximagif.cpp delete mode 100644 src/win32/dependencies/cximage/ximagif.h delete mode 100644 src/win32/dependencies/cximage/ximahist.cpp delete mode 100644 src/win32/dependencies/cximage/ximaico.cpp delete mode 100644 src/win32/dependencies/cximage/ximaico.h delete mode 100644 src/win32/dependencies/cximage/ximainfo.cpp delete mode 100644 src/win32/dependencies/cximage/ximaint.cpp delete mode 100644 src/win32/dependencies/cximage/ximaiter.h delete mode 100644 src/win32/dependencies/cximage/ximaj2k.cpp delete mode 100644 src/win32/dependencies/cximage/ximaj2k.h delete mode 100644 src/win32/dependencies/cximage/ximajas.cpp delete mode 100644 src/win32/dependencies/cximage/ximajas.h delete mode 100644 src/win32/dependencies/cximage/ximajbg.cpp delete mode 100644 src/win32/dependencies/cximage/ximajbg.h delete mode 100644 src/win32/dependencies/cximage/ximajpg.cpp delete mode 100644 src/win32/dependencies/cximage/ximajpg.h delete mode 100644 src/win32/dependencies/cximage/ximalpha.cpp delete mode 100644 src/win32/dependencies/cximage/ximalyr.cpp delete mode 100644 src/win32/dependencies/cximage/ximamng.cpp delete mode 100644 src/win32/dependencies/cximage/ximamng.h delete mode 100644 src/win32/dependencies/cximage/ximapal.cpp delete mode 100644 src/win32/dependencies/cximage/ximapcx.cpp delete mode 100644 src/win32/dependencies/cximage/ximapcx.h delete mode 100644 src/win32/dependencies/cximage/ximapng.cpp delete mode 100644 src/win32/dependencies/cximage/ximapng.h delete mode 100644 src/win32/dependencies/cximage/ximasel.cpp delete mode 100644 src/win32/dependencies/cximage/ximatga.cpp delete mode 100644 src/win32/dependencies/cximage/ximatga.h delete mode 100644 src/win32/dependencies/cximage/ximath.cpp delete mode 100644 src/win32/dependencies/cximage/ximath.h delete mode 100644 src/win32/dependencies/cximage/ximatif.cpp delete mode 100644 src/win32/dependencies/cximage/ximatif.h delete mode 100644 src/win32/dependencies/cximage/ximatran.cpp delete mode 100644 src/win32/dependencies/cximage/ximawbmp.cpp delete mode 100644 src/win32/dependencies/cximage/ximawbmp.h delete mode 100644 src/win32/dependencies/cximage/ximawmf.cpp delete mode 100644 src/win32/dependencies/cximage/ximawmf.h delete mode 100644 src/win32/dependencies/cximage/ximawnd.cpp delete mode 100644 src/win32/dependencies/cximage/xiofile.h delete mode 100644 src/win32/dependencies/cximage/xmemfile.cpp delete mode 100644 src/win32/dependencies/cximage/xmemfile.h delete mode 100644 src/win32/dependencies/glext.h delete mode 100644 src/win32/dependencies/info.txt diff --git a/VBA.sln b/VBA.sln index 86673eb4..33c21974 100644 --- a/VBA.sln +++ b/VBA.sln @@ -2,10 +2,16 @@ Microsoft Visual Studio Solution File, Format Version 9.00 # Visual Studio 2005 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "VisualBoyAdvance", "VBA.vcproj", "{6D4C5EC8-933F-4C05-A1BF-498E658576DF}" ProjectSection(ProjectDependencies) = postProject + {B938FBD9-C7F9-4BF7-8C27-68865D1FA092} = {B938FBD9-C7F9-4BF7-8C27-68865D1FA092} {DB5C12E9-BCD3-4517-8708-475C0D1D88CE} = {DB5C12E9-BCD3-4517-8708-475C0D1D88CE} + {96E945F7-0377-48DA-A5F8-1C192DE9F25F} = {96E945F7-0377-48DA-A5F8-1C192DE9F25F} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "src\win32\dependencies\cximage\cximage.vcproj", "{DB5C12E9-BCD3-4517-8708-475C0D1D88CE}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "zlib", "..\dependencies\zlib\zlib.vcproj", "{B938FBD9-C7F9-4BF7-8C27-68865D1FA092}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libpng", "..\dependencies\libpng\libpng.vcproj", "{96E945F7-0377-48DA-A5F8-1C192DE9F25F}" +EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cximage", "..\dependencies\cximage\cximage.vcproj", "{DB5C12E9-BCD3-4517-8708-475C0D1D88CE}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -20,6 +26,18 @@ Global {6D4C5EC8-933F-4C05-A1BF-498E658576DF}.Optimized|Win32.Build.0 = Optimized|Win32 {6D4C5EC8-933F-4C05-A1BF-498E658576DF}.Release|Win32.ActiveCfg = Release|Win32 {6D4C5EC8-933F-4C05-A1BF-498E658576DF}.Release|Win32.Build.0 = Release|Win32 + {B938FBD9-C7F9-4BF7-8C27-68865D1FA092}.Debug|Win32.ActiveCfg = Debug|Win32 + {B938FBD9-C7F9-4BF7-8C27-68865D1FA092}.Debug|Win32.Build.0 = Debug|Win32 + {B938FBD9-C7F9-4BF7-8C27-68865D1FA092}.Optimized|Win32.ActiveCfg = Release|Win32 + {B938FBD9-C7F9-4BF7-8C27-68865D1FA092}.Optimized|Win32.Build.0 = Release|Win32 + {B938FBD9-C7F9-4BF7-8C27-68865D1FA092}.Release|Win32.ActiveCfg = Release|Win32 + {B938FBD9-C7F9-4BF7-8C27-68865D1FA092}.Release|Win32.Build.0 = Release|Win32 + {96E945F7-0377-48DA-A5F8-1C192DE9F25F}.Debug|Win32.ActiveCfg = Debug|Win32 + {96E945F7-0377-48DA-A5F8-1C192DE9F25F}.Debug|Win32.Build.0 = Debug|Win32 + {96E945F7-0377-48DA-A5F8-1C192DE9F25F}.Optimized|Win32.ActiveCfg = Release|Win32 + {96E945F7-0377-48DA-A5F8-1C192DE9F25F}.Optimized|Win32.Build.0 = Release|Win32 + {96E945F7-0377-48DA-A5F8-1C192DE9F25F}.Release|Win32.ActiveCfg = Release|Win32 + {96E945F7-0377-48DA-A5F8-1C192DE9F25F}.Release|Win32.Build.0 = Release|Win32 {DB5C12E9-BCD3-4517-8708-475C0D1D88CE}.Debug|Win32.ActiveCfg = Debug|Win32 {DB5C12E9-BCD3-4517-8708-475C0D1D88CE}.Debug|Win32.Build.0 = Debug|Win32 {DB5C12E9-BCD3-4517-8708-475C0D1D88CE}.Optimized|Win32.ActiveCfg = Release|Win32 diff --git a/VBA.vcproj b/VBA.vcproj index a6573a9e..75b42a91 100644 --- a/VBA.vcproj +++ b/VBA.vcproj @@ -191,7 +191,7 @@ Name="VCLinkerTool" RegisterOutput="false" IgnoreImportLibrary="false" - AdditionalDependencies="nafxcw.lib LIBCMT.lib Vfw32.Lib OpenGL32.Lib dinput8.lib winmm.lib dxguid.lib ddraw.lib d3d9.lib d3dx9.lib Dsound.lib zlib.lib libpng.lib" + AdditionalDependencies="nafxcw.lib LIBCMT.lib Vfw32.Lib OpenGL32.Lib dinput8.lib winmm.lib dxguid.lib ddraw.lib d3d9.lib d3dx9.lib Dsound.lib" ShowProgress="0" OutputFile="$(ProjectDir)VisualBoyAdvance.exe" Version="" @@ -1118,26 +1118,6 @@ > - - - - - - - - - - diff --git a/src/GBAinline.h b/src/GBAinline.h index b268c6e5..aa863e77 100644 --- a/src/GBAinline.h +++ b/src/GBAinline.h @@ -23,7 +23,6 @@ #include "System.h" #include "Port.h" #include "RTC.h" -#include "Sound.h" extern bool cpuSramEnabled; extern bool cpuFlashEnabled; @@ -98,9 +97,9 @@ static inline u32 CPUReadMemory(u32 address) LinkSStop(); if((address < 0x4000400) && ioReadable[address & 0x3fc]) { if(ioReadable[(address & 0x3fc) + 2]) - value = soundRead32(address & 0x3fC); + value = READ32LE(((u32 *)&ioMem[address & 0x3fC])); else - value = soundRead16(address & 0x3fc); + value = READ16LE(((u16 *)&ioMem[address & 0x3fc])); } else goto unreadable; break; case 5: @@ -223,7 +222,7 @@ if((address>=0x4000120||address<=0x4000126)&&lspeed) LinkSStop(); if((address < 0x4000400) && ioReadable[address & 0x3fe]) { - value = soundRead16(address & 0x3fe); + value = READ16LE(((u16 *)&ioMem[address & 0x3fe])); if (((address & 0x3fe)>0xFF) && ((address & 0x3fe)<0x10E)) { if (((address & 0x3fe) == 0x100) && timer0On) @@ -337,7 +336,7 @@ static inline u8 CPUReadByte(u32 address) if((address>=0x4000120||address<=0x4000126)&&lspeed) LinkSStop(); if((address < 0x4000400) && ioReadable[address & 0x3ff]) - return soundRead(address & 0x3ff); + return ioMem[address & 0x3ff]; else goto unreadable; case 5: return paletteRAM[address & 0x3ff]; diff --git a/src/Gb_Apu/Blip_Buffer.cpp b/src/Gb_Apu/Blip_Buffer.cpp index 4e106ed8..81da8362 100644 --- a/src/Gb_Apu/Blip_Buffer.cpp +++ b/src/Gb_Apu/Blip_Buffer.cpp @@ -320,7 +320,7 @@ void Blip_Synth_::volume_unit( double new_unit ) factor *= 2.0; } - // if ( shift ) + if ( shift ) { kernel_unit >>= shift; assert( kernel_unit > 0 ); // fails if volume unit is too low diff --git a/src/Gb_Apu/Gb_Oscs.cpp b/src/Gb_Apu/Gb_Oscs.cpp index 4bf97407..da3b8f04 100644 --- a/src/Gb_Apu/Gb_Oscs.cpp +++ b/src/Gb_Apu/Gb_Oscs.cpp @@ -198,7 +198,7 @@ void Gb_Noise::run( gb_time_t time, gb_time_t end_time, int playing ) const blip_resampled_time_t resampled_period = output->resampled_duration( period ); blip_resampled_time_t resampled_time = output->resampled_time( time ); -// unsigned bits = this->bits; + unsigned bits = this->bits; int delta = amp * 2; do @@ -216,7 +216,7 @@ void Gb_Noise::run( gb_time_t time, gb_time_t end_time, int playing ) } while ( time < end_time ); - //this->bits = bits; + this->bits = bits; last_amp = delta >> 1; } delay = time - end_time; diff --git a/src/Sound.cpp b/src/Sound.cpp index 498ff286..8177ad5e 100644 --- a/src/Sound.cpp +++ b/src/Sound.cpp @@ -1,6 +1,7 @@ // VisualBoyAdvance - Nintendo Gameboy/GameboyAdvance (TM) emulator. // Copyright (C) 1999-2003 Forgotten // Copyright (C) 2004 Forgotten and the VBA development team +// Copyright (C) 2004-2006 VBA development team // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by @@ -18,27 +19,22 @@ #include +#include "Sound.h" + #include "GBA.h" #include "Globals.h" -#include "Sound.h" #include "Util.h" #include "snd_interp.h" -#include "Gb_Apu/Multi_Buffer.h" -#include "Gb_Apu/Gb_Apu.h" -#ifdef _WIN32 -#include -#endif #define USE_TICKS_AS 380 #define SOUND_MAGIC 0x60000000 #define SOUND_MAGIC_2 0x30000000 -#define NOISE_MAGIC 5 +#define NOISE_MAGIC 5 extern bool stopState; -extern bool cpuDmaHack2; u8 soundWavePattern[4][32] = { {0x01,0x01,0x01,0x01, @@ -121,10 +117,6 @@ int soundTicks = soundQuality * USE_TICKS_AS; int SOUND_CLOCK_TICKS = soundQuality * USE_TICKS_AS; u32 soundNextPosition = 0; -Multi_Buffer * apu_out = NULL; -Gb_Apu * apu = NULL; -bool apu_saved = false; - int soundLevel1 = 0; int soundLevel2 = 0; int soundBalance = 0; @@ -395,69 +387,240 @@ inline int interp_pop(int ch) // *** End snd_interp code -static void soundEventGB(u32 address, u8 data) -{ - if ( apu ) - { - int divisor = 4 * soundQuality; - int clock = (SOUND_CLOCK_TICKS - soundTicks + (divisor >> 1)) / divisor; - apu->write_register(clock, address, data); - } - else - ioMem[address] = data; -} -u8 soundRead(u32 address) -{ - if (address < NR10 || address > 0x9F || !apu) return ioMem[address]; - if (address == NR51) return soundBalance; - int divisor = 4 * soundQuality; - int clock = (SOUND_CLOCK_TICKS - soundTicks + (divisor >> 1)) / divisor; - switch (address) - { + +void soundEvent(u32 address, u8 data) +{ + int freq = 0; + + switch(address) { case NR10: - return apu->read_register(clock, 0xFF10); + data &= 0x7f; + sound1SweepATL = sound1SweepATLReload = 344 * ((data >> 4) & 7); + sound1SweepSteps = data & 7; + sound1SweepUpDown = data & 0x08; + sound1SweepStep = 0; + ioMem[address] = data; + break; case NR11: - return apu->read_register(clock, 0xFF11); + sound1Wave = soundWavePattern[data >> 6]; + sound1ATL = 172 * (64 - (data & 0x3f)); + ioMem[address] = data; + break; case NR12: - return apu->read_register(clock, 0xFF12); + sound1EnvelopeUpDown = data & 0x08; + sound1EnvelopeATLReload = 689 * (data & 7); + if((data & 0xF8) == 0) + sound1EnvelopeVolume = 0; + ioMem[address] = data; + break; case NR13: - return apu->read_register(clock, 0xFF13); + freq = (((int)(ioMem[NR14] & 7)) << 8) | data; + sound1ATL = 172 * (64 - (ioMem[NR11] & 0x3f)); + freq = 2048 - freq; + if(freq) { + sound1Skip = SOUND_MAGIC / freq; + } else + sound1Skip = 0; + ioMem[address] = data; + break; case NR14: - return apu->read_register(clock, 0xFF14); + data &= 0xC7; + freq = (((int)(data&7) << 8) | ioMem[NR13]); + freq = 2048 - freq; + sound1ATL = 172 * (64 - (ioMem[NR11] & 0x3f)); + sound1Continue = data & 0x40; + if(freq) { + sound1Skip = SOUND_MAGIC / freq; + } else + sound1Skip = 0; + if(data & 0x80) { + ioMem[NR52] |= 1; + sound1EnvelopeVolume = ioMem[NR12] >> 4; + sound1EnvelopeUpDown = ioMem[NR12] & 0x08; + sound1ATL = 172 * (64 - (ioMem[NR11] & 0x3f)); + sound1EnvelopeATLReload = sound1EnvelopeATL = 689 * (ioMem[NR12] & 7); + sound1SweepATL = sound1SweepATLReload = 344 * ((ioMem[NR10] >> 4) & 7); + sound1SweepSteps = ioMem[NR10] & 7; + sound1SweepUpDown = ioMem[NR10] & 0x08; + sound1SweepStep = 0; + + sound1Index = 0; + sound1On = 1; + } + ioMem[address] = data; + break; case NR21: - return apu->read_register(clock, 0xFF16); + sound2Wave = soundWavePattern[data >> 6]; + sound2ATL = 172 * (64 - (data & 0x3f)); + ioMem[address] = data; + break; case NR22: - return apu->read_register(clock, 0xFF17); + sound2EnvelopeUpDown = data & 0x08; + sound2EnvelopeATLReload = 689 * (data & 7); + if((data & 0xF8) == 0) + sound2EnvelopeVolume = 0; + ioMem[address] = data; + break; case NR23: - return apu->read_register(clock, 0xFF18); + freq = (((int)(ioMem[NR24] & 7)) << 8) | data; + sound2ATL = 172 * (64 - (ioMem[NR21] & 0x3f)); + freq = 2048 - freq; + if(freq) { + sound2Skip = SOUND_MAGIC / freq; + } else + sound2Skip = 0; + ioMem[address] = data; + break; case NR24: - return apu->read_register(clock, 0xFF19); + data &= 0xC7; + freq = (((int)(data&7) << 8) | ioMem[NR23]); + freq = 2048 - freq; + sound2ATL = 172 * (64 - (ioMem[NR21] & 0x3f)); + sound2Continue = data & 0x40; + if(freq) { + sound2Skip = SOUND_MAGIC / freq; + } else + sound2Skip = 0; + if(data & 0x80) { + ioMem[NR52] |= 2; + sound2EnvelopeVolume = ioMem[NR22] >> 4; + sound2EnvelopeUpDown = ioMem[NR22] & 0x08; + sound2ATL = 172 * (64 - (ioMem[NR21] & 0x3f)); + sound2EnvelopeATLReload = sound2EnvelopeATL = 689 * (ioMem[NR22] & 7); + + sound2Index = 0; + sound2On = 1; + } + ioMem[address] = data; + break; case NR30: - return apu->read_register(clock, 0xFF1A); + data &= 0xe0; + if(!(data & 0x80)) { + ioMem[NR52] &= 0xfb; + sound3On = 0; + } + if(((data >> 6) & 1) != sound3Bank) + memcpy(&ioMem[0x90], &sound3WaveRam[(((data >> 6) & 1) * 0x10)^0x10], + 0x10); + sound3Bank = (data >> 6) & 1; + sound3DataSize = (data >> 5) & 1; + ioMem[address] = data; + break; case NR31: - return apu->read_register(clock, 0xFF1B); + sound3ATL = 172 * (256-data); + ioMem[address] = data; + break; case NR32: - return apu->read_register(clock, 0xFF1C); + data &= 0xe0; + sound3OutputLevel = (data >> 5) & 3; + sound3ForcedOutput = (data >> 7) & 1; + ioMem[address] = data; + break; case NR33: - return apu->read_register(clock, 0xFF1D); + freq = 2048 - (((int)(ioMem[NR34]&7) << 8) | data); + if(freq) { + sound3Skip = SOUND_MAGIC_2 / freq; + } else + sound3Skip = 0; + ioMem[address] = data; + break; case NR34: - return apu->read_register(clock, 0xFF1E); + data &= 0xc7; + freq = 2048 - (((data &7) << 8) | (int)ioMem[NR33]); + if(freq) { + sound3Skip = SOUND_MAGIC_2 / freq; + } else { + sound3Skip = 0; + } + sound3Continue = data & 0x40; + if((data & 0x80) && (ioMem[NR30] & 0x80)) { + ioMem[NR52] |= 4; + sound3ATL = 172 * (256 - ioMem[NR31]); + sound3Index = 0; + sound3On = 1; + } + ioMem[address] = data; + break; case NR41: - return apu->read_register(clock, 0xFF20); + data &= 0x3f; + sound4ATL = 172 * (64 - (data & 0x3f)); + ioMem[address] = data; + break; case NR42: - return apu->read_register(clock, 0xFF21); + sound4EnvelopeUpDown = data & 0x08; + sound4EnvelopeATLReload = 689 * (data & 7); + if((data & 0xF8) == 0) + sound4EnvelopeVolume = 0; + ioMem[address] = data; + break; case NR43: - return apu->read_register(clock, 0xFF22); + freq = soundFreqRatio[data & 7]; + sound4NSteps = data & 0x08; + + sound4Skip = (freq << 8) / NOISE_MAGIC; + + sound4Clock = data >> 4; + + freq = freq / soundShiftClock[sound4Clock]; + + sound4ShiftSkip = (freq << 8) / NOISE_MAGIC; + ioMem[address] = data; + break; case NR44: - return apu->read_register(clock, 0xFF23); + data &= 0xc0; + sound4Continue = data & 0x40; + if(data & 0x80) { + ioMem[NR52] |= 8; + sound4EnvelopeVolume = ioMem[NR42] >> 4; + sound4EnvelopeUpDown = ioMem[NR42] & 0x08; + sound4ATL = 172 * (64 - (ioMem[NR41] & 0x3f)); + sound4EnvelopeATLReload = sound4EnvelopeATL = 689 * (ioMem[NR42] & 7); + + sound4On = 1; + + sound4Index = 0; + sound4ShiftIndex = 0; + + freq = soundFreqRatio[ioMem[NR43] & 7]; + + sound4Skip = (freq << 8) / NOISE_MAGIC; + + sound4NSteps = ioMem[NR43] & 0x08; + + freq = freq / soundShiftClock[ioMem[NR43] >> 4]; + + sound4ShiftSkip = (freq << 8) / NOISE_MAGIC; + if(sound4NSteps) + sound4ShiftRight = 0x7fff; + else + sound4ShiftRight = 0x7f; + } + ioMem[address] = data; + break; case NR50: - return apu->read_register(clock, 0xFF24); + data &= 0x77; + soundLevel1 = data & 7; + soundLevel2 = (data >> 4) & 7; + ioMem[address] = data; + break; case NR51: - return apu->read_register(clock, 0xFF25); + soundBalance = (data & soundEnableFlag); + ioMem[address] = data; + break; case NR52: - return apu->read_register(clock, 0xFF26); + data &= 0x80; + data |= ioMem[NR52] & 15; + soundMasterOn = data & 0x80; + if(!(data & 0x80)) { + sound1On = 0; + sound2On = 0; + sound3On = 0; + sound4On = 0; + } + ioMem[address] = data; + break; case 0x90: case 0x91: case 0x92: @@ -474,108 +637,8 @@ u8 soundRead(u32 address) case 0x9d: case 0x9e: case 0x9f: - return apu->read_register(clock, 0xFF30 - 0x90 + address); - } - - return ioMem[address]; - } - - u16 soundRead16(u32 address) - { - address &= ~1; - u16 temp = soundRead(address); - temp |= soundRead(address + 1) << 8; - return temp; - } - - u32 soundRead32(u32 address) - { - address &= ~3; - u32 temp = soundRead16(address); - temp |= soundRead16(address + 2) << 16; - return temp; - } - - - void soundEvent(u32 address, u8 data) - { - switch(address) { - case NR10: - soundEventGB(0xFF10, data); - break; - case NR11: - soundEventGB(0xFF11, data); - break; - case NR12: - soundEventGB(0xFF12, data); - break; - case NR13: - soundEventGB(0xFF13, data); - break; - case NR14: - soundEventGB(0xFF14, data); - break; - case NR21: - soundEventGB(0xFF16, data); - break; - case NR22: - soundEventGB(0xFF17, data); - break; - case NR23: - soundEventGB(0xFF18, data); - break; - case NR24: - soundEventGB(0xFF19, data); + sound3WaveRam[(sound3Bank*0x10)^0x10+(address&15)] = data; break; - case NR30: - soundEventGB(0xFF1A, data); - break; - case NR31: - soundEventGB(0xFF1B, data); - break; - case NR32: - soundEventGB(0xFF1C, data); - break; - case NR33: - soundEventGB(0xFF1D, data); - break; - case NR34: - soundEventGB(0xFF1E, data); - break; - case NR41: - soundEventGB(0xFF20, data); - break; - case NR42: - soundEventGB(0xFF21, data); - break; - case NR43: - soundEventGB(0xFF22, data); - break; - case NR44: - soundEventGB(0xFF23, data); - break; - case NR50: - soundEventGB(0xFF24, data); - break; - case NR51: - soundBalance = data; - soundEventGB(0xFF25, data & soundEnableFlag); - break; - case NR52: - soundEventGB(0xFF26, data); - break; - - case 0x90: - case 0x92: - case 0x94: - case 0x96: - case 0x98: - case 0x9a: - case 0x9c: - case 0x9e: - soundEventGB(0xFF30 + (address & 14), data); - soundEventGB(0xFF31 + (address & 14), 0); // data >> 8); - break; } } @@ -584,7 +647,7 @@ void soundEvent(u32 address, u16 data) switch(address) { case SGCNT0_H: data &= 0xFF0F; - soundControl = data & 0x770F;; + soundControl = data & 0x770F; if(data & 0x0800) { soundDSFifoAWriteIndex = 0; soundDSFifoAIndex = 0; @@ -603,12 +666,7 @@ void soundEvent(u32 address, u16 data) } soundDSBEnabled = (data & 0x3000) ? true : false; soundDSBTimer = (data & 0x4000) ? 1 : 0; - if (data & 0x8000) - { - interp_reset(0); - interp_reset(1); - } - *((u16 *)&ioMem[address]) = data; + *((u16 *)&ioMem[address]) = soundControl; break; case FIFOA_L: case FIFOA_H: @@ -638,33 +696,260 @@ void soundEvent(u32 address, u16 data) case 0x9a: case 0x9c: case 0x9e: - soundEventGB(0xFF30 + (address & 14), data & 0xff); - soundEventGB(0xFF31 + (address & 14), data >> 8); + *((u16 *)&sound3WaveRam[(sound3Bank*0x10)^0x10+(address&14)]) = data; + *((u16 *)&ioMem[address]) = data; break; } } void soundChannel1() { + int vol = sound1EnvelopeVolume; + + int freq = 0; + int value = 0; + + if(sound1On && (sound1ATL || !sound1Continue)) { + sound1Index += soundQuality*sound1Skip; + sound1Index &= 0x1fffffff; + + value = ((s8)sound1Wave[sound1Index>>24]) * vol; + } + + soundBuffer[0][soundIndex] = value; + + + if(sound1On) { + if(sound1ATL) { + sound1ATL-=soundQuality; + + if(sound1ATL <=0 && sound1Continue) { + ioMem[NR52] &= 0xfe; + sound1On = 0; + } + } + + if(sound1EnvelopeATL) { + sound1EnvelopeATL-=soundQuality; + + if(sound1EnvelopeATL<=0) { + if(sound1EnvelopeUpDown) { + if(sound1EnvelopeVolume < 15) + sound1EnvelopeVolume++; + } else { + if(sound1EnvelopeVolume) + sound1EnvelopeVolume--; + } + + sound1EnvelopeATL += sound1EnvelopeATLReload; + } + } + + if(sound1SweepATL) { + sound1SweepATL-=soundQuality; + + if(sound1SweepATL<=0) { + freq = (((int)(ioMem[NR14]&7) << 8) | ioMem[NR13]); + + int updown = 1; + + if(sound1SweepUpDown) + updown = -1; + + int newfreq = 0; + if(sound1SweepSteps) { + newfreq = freq + updown * freq / (1 << sound1SweepSteps); + if(newfreq == freq) + newfreq = 0; + } else + newfreq = freq; + + if(newfreq < 0) { + sound1SweepATL += sound1SweepATLReload; + } else if(newfreq > 2047) { + sound1SweepATL = 0; + sound1On = 0; + ioMem[NR52] &= 0xfe; + } else { + sound1SweepATL += sound1SweepATLReload; + sound1Skip = SOUND_MAGIC/(2048 - newfreq); + + ioMem[NR13] = newfreq & 0xff; + ioMem[NR14] = (ioMem[NR14] & 0xf8) |((newfreq >> 8) & 7); + } + } + } + } } void soundChannel2() { + // int freq = 0; + int vol = sound2EnvelopeVolume; + + int value = 0; + + if(sound2On && (sound2ATL || !sound2Continue)) { + sound2Index += soundQuality*sound2Skip; + sound2Index &= 0x1fffffff; + + value = ((s8)sound2Wave[sound2Index>>24]) * vol; + } + + soundBuffer[1][soundIndex] = value; + + if(sound2On) { + if(sound2ATL) { + sound2ATL-=soundQuality; + + if(sound2ATL <= 0 && sound2Continue) { + ioMem[NR52] &= 0xfd; + sound2On = 0; + } + } + + if(sound2EnvelopeATL) { + sound2EnvelopeATL-=soundQuality; + + if(sound2EnvelopeATL <= 0) { + if(sound2EnvelopeUpDown) { + if(sound2EnvelopeVolume < 15) + sound2EnvelopeVolume++; + } else { + if(sound2EnvelopeVolume) + sound2EnvelopeVolume--; + } + sound2EnvelopeATL += sound2EnvelopeATLReload; + } + } + } } void soundChannel3() { + int value = sound3Last; + + if(sound3On && (sound3ATL || !sound3Continue)) { + sound3Index += soundQuality*sound3Skip; + if(sound3DataSize) { + sound3Index &= 0x3fffffff; + value = sound3WaveRam[sound3Index>>25]; + } else { + sound3Index &= 0x1fffffff; + value = sound3WaveRam[sound3Bank*0x10 + (sound3Index>>25)]; + } + + if( (sound3Index & 0x01000000)) { + value &= 0x0f; + } else { + value >>= 4; + } + + value -= 8; + value *= 2; + + if(sound3ForcedOutput) { + value = ((value >> 1) + value) >> 1; + } else { + switch(sound3OutputLevel) { + case 0: + value = 0; + break; + case 1: + break; + case 2: + value = (value >> 1); + break; + case 3: + value = (value >> 2); + break; + } + } + sound3Last = value; + } + + soundBuffer[2][soundIndex] = value; + + if(sound3On) { + if(sound3ATL) { + sound3ATL-=soundQuality; + + if(sound3ATL <= 0 && sound3Continue) { + ioMem[NR52] &= 0xfb; + sound3On = 0; + } + } + } } void soundChannel4() { + int vol = sound4EnvelopeVolume; + + int value = 0; + + if(sound4Clock <= 0x0c) { + if(sound4On && (sound4ATL || !sound4Continue)) { + sound4Index += soundQuality*sound4Skip; + sound4ShiftIndex += soundQuality*sound4ShiftSkip; + + if(sound4NSteps) { + while(sound4ShiftIndex > 0x1fffff) { + sound4ShiftRight = (((sound4ShiftRight << 6) ^ + (sound4ShiftRight << 5)) & 0x40) | + (sound4ShiftRight >> 1); + sound4ShiftIndex -= 0x200000; + } + } else { + while(sound4ShiftIndex > 0x1fffff) { + sound4ShiftRight = (((sound4ShiftRight << 14) ^ + (sound4ShiftRight << 13)) & 0x4000) | + (sound4ShiftRight >> 1); + + sound4ShiftIndex -= 0x200000; + } + } + + sound4Index &= 0x1fffff; + sound4ShiftIndex &= 0x1fffff; + + value = ((sound4ShiftRight & 1)*2-1) * vol; + } else { + value = 0; + } + } + + soundBuffer[3][soundIndex] = value; + + if(sound4On) { + if(sound4ATL) { + sound4ATL-=soundQuality; + + if(sound4ATL <= 0 && sound4Continue) { + ioMem[NR52] &= 0xfd; + sound4On = 0; + } + } + + if(sound4EnvelopeATL) { + sound4EnvelopeATL-=soundQuality; + + if(sound4EnvelopeATL <= 0) { + if(sound4EnvelopeUpDown) { + if(sound4EnvelopeVolume < 15) + sound4EnvelopeVolume++; + } else { + if(sound4EnvelopeVolume) + sound4EnvelopeVolume--; + } + sound4EnvelopeATL += sound4EnvelopeATLReload; + } + } + } } -inline void soundDirectSoundA() -{ - directBuffer[0][soundIndex] = interp_pop(0); //soundDSAValue; -} +extern bool cpuDmaHack2; void soundDirectSoundATimer() { @@ -690,7 +975,12 @@ void soundDirectSoundATimer() soundDSAValue = 0; } -inline void soundDirectSoundB() +void soundDirectSoundA() +{ + directBuffer[0][soundIndex] = interp_pop(0); //soundDSAValue; +} + +void soundDirectSoundB() { directBuffer[1][soundIndex] = interp_pop(1); //soundDSBValue; } @@ -742,19 +1032,19 @@ void soundMix() int ratio = ioMem[0x82] & 3; int dsaRatio = ioMem[0x82] & 4; int dsbRatio = ioMem[0x82] & 8; - - blip_sample_t out[2] = {0, 0}; - - if ( ! apu_out ) return; - - while (!apu_out->read_samples(&out[0], 2)) - { - int ticks = SOUND_CLOCK_TICKS / (4 * soundQuality); - bool was_stereo = apu->end_frame( ticks ); - apu_out->end_frame( ticks, was_stereo ); + + if(soundBalance & 16) { + cgbRes = ((s8)soundBuffer[0][soundIndex]); + } + if(soundBalance & 32) { + cgbRes += ((s8)soundBuffer[1][soundIndex]); + } + if(soundBalance & 64) { + cgbRes += ((s8)soundBuffer[2][soundIndex]); + } + if(soundBalance & 128) { + cgbRes += ((s8)soundBuffer[3][soundIndex]); } - - cgbRes = out[0]; if((soundControl & 0x0200) && (soundEnableFlag & 0x100)){ if(!dsaRatio) @@ -771,7 +1061,7 @@ void soundMix() } res = (res * 170) >> 8; - cgbRes = (cgbRes * 52 * 7) >> 8; + cgbRes = (cgbRes * 52 * soundLevel1); switch(ratio) { case 0: @@ -830,9 +1120,22 @@ void soundMix() soundFinalWave[soundBufferIndex++] = res; res = 0; - cgbRes = out[1]; + cgbRes = 0; - if((soundControl & 0x0100) && (soundEnableFlag & 0x100)){ + if(soundBalance & 1) { + cgbRes = ((s8)soundBuffer[0][soundIndex]); + } + if(soundBalance & 2) { + cgbRes += ((s8)soundBuffer[1][soundIndex]); + } + if(soundBalance & 4) { + cgbRes += ((s8)soundBuffer[2][soundIndex]); + } + if(soundBalance & 8) { + cgbRes += ((s8)soundBuffer[3][soundIndex]); + } + + if((soundControl & 0x0100) && (soundEnableFlag & 0x100)){ if(!dsaRatio) res = ((s16)directBuffer[0][soundIndex])>>1; else @@ -847,7 +1150,7 @@ void soundMix() } res = (res * 170) >> 8; - cgbRes = (cgbRes * 52 * 7) >> 8; + cgbRes = (cgbRes * 52 * soundLevel1); switch(ratio) { case 0: @@ -916,6 +1219,10 @@ void soundMix() void normalsoundTick() { + soundChannel1(); + soundChannel2(); + soundChannel3(); + soundChannel4(); soundDirectSoundA(); soundDirectSoundB(); soundMix(); @@ -934,6 +1241,10 @@ void soundTick() { if(systemSoundOn) { if(soundMasterOn && !stopState) { + soundChannel1(); + soundChannel2(); + soundChannel3(); + soundChannel4(); soundDirectSoundA(); soundDirectSoundB(); soundMix(); @@ -997,23 +1308,6 @@ void setsoundMasterOn(bool value) void soundShutdown() { systemSoundShutdown(); - - int i; - u8 j; - - if (apu) - { - j = soundRead(NR30); - if (!(j & 0x40)) soundEvent(NR30, u8(j | 0x40)); - for (i = 0; i < 16; i++) sound3WaveRam[i] = soundRead(i + 0x90); - soundEvent(NR30, u8(j & ~0x40)); - for (i = 16; i < 32; i++) sound3WaveRam[i] = soundRead(i - 16 + 0x90); - if (j & 0x40) soundEvent(NR30, j); - apu_saved = true; - - delete apu; apu = NULL; - } - if (apu_out) { delete apu_out; apu_out = NULL; } } void soundPause() @@ -1033,8 +1327,8 @@ void soundEnable(int channels) int c = channels & 0x0f; soundEnableFlag |= ((channels & 0x30f) |c | (c << 4)); - if(apu) - soundEventGB(0xFF25, soundBalance & soundEnableFlag); + if(ioMem) + soundBalance = (ioMem[NR51] & soundEnableFlag); } void soundDisable(int channels) @@ -1042,8 +1336,8 @@ void soundDisable(int channels) int c = channels & 0x0f; soundEnableFlag &= (~((channels & 0x30f)|c|(c<<4))); - if(apu) - soundEventGB(0xFF25, soundBalance & soundEnableFlag); + if(ioMem) + soundBalance = (ioMem[NR51] & soundEnableFlag); } int soundGetEnable() @@ -1051,20 +1345,6 @@ int soundGetEnable() return (soundEnableFlag & 0x30f); } -const BOOST::uint8_t sound_data [Gb_Apu::register_count] = { - 0x80, 0xbf, 0x00, 0x00, 0xbf, // square 1 - 0x00, 0x3f, 0x00, 0x00, 0xbf, // square 2 - 0x40, 0xff, 0x9f, 0x00, 0xbf, // wave - 0x00, 0xff, 0x00, 0x00, 0xbf, // noise - - 0x77, 0xf3, 0xf1, // vin/volume, status, power mode - - 0, 0, 0, 0, 0, 0, 0, 0, 0, // unused - - 0xac, 0xdd, 0xda, 0x48, 0x36, 0x02, 0xcf, 0x16, // waveform data - 0x2c, 0x04, 0xe5, 0x2c, 0xac, 0xdd, 0xda, 0x48 -}; - void soundReset() { systemSoundReset(); @@ -1079,8 +1359,7 @@ void soundReset() soundBufferIndex = 0; soundLevel1 = 7; soundLevel2 = 7; - - /* + sound1On = 0; sound1ATL = 0; sound1Skip = 0; @@ -1137,38 +1416,8 @@ void soundReset() sound2On = 0; sound3On = 0; sound4On = 0; - */ - - apu_out->clear(); - apu->reset(true); - - int addr = 0; - while (addr < 0x30) { - switch (addr) - { - case 4: - case 9: - case 14: - case 19: - apu->write_register( 0, 0xFF10 + addr, 0 ); - break; - - default: - apu->write_register( 0, 0xFF10 + addr, sound_data [ addr ] ); - break; - } - addr++; - } - apu->write_register( 0, 0xFF1A, 0 ); - - addr = 0x20; - while (addr < 0x30) { - apu->write_register( 0, 0xFF10 + addr, sound_data [ addr ] ); - addr++; - } - - /*addr = 0x90; + int addr = 0x90; while(addr < 0xA0) { ioMem[addr++] = 0x00; @@ -1180,7 +1429,6 @@ void soundReset() sound3WaveRam[addr++] = 0x00; sound3WaveRam[addr++] = 0xff; } - */ memset(soundFinalWave, 0, soundBufferLen); @@ -1188,69 +1436,17 @@ void soundReset() soundEchoIndex = 0; } -bool soundInit(bool gba) +bool soundInit() { if(systemSoundInit()) { - memset(soundBuffer[0], 0, 735); - memset(soundBuffer[1], 0, 735); - memset(soundBuffer[2], 0, 735); - memset(soundBuffer[3], 0, 735); + memset(soundBuffer[0], 0, 735*2); + memset(soundBuffer[1], 0, 735*2); + memset(soundBuffer[2], 0, 735*2); + memset(soundBuffer[3], 0, 735*2); memset(soundFinalWave, 0, soundBufferLen); - -#if defined(_WIN32) && 0 - _fpreset(); // FUCKO, Direct3D display code does something dirty to FPU -#endif - Stereo_Buffer * buf = new Stereo_Buffer; - apu = new Gb_Apu; - - buf->clock_rate( 4194304 ); - buf->set_sample_rate( 44100 / soundQuality , 1000 / 20 ); - buf->bass_freq( 120 ); - buf->set_channel_count(Gb_Apu::osc_count); - buf->clear(); - - apu_out = buf; - - apu->treble_eq( blip_eq_t( -1.0, 0, 44100 / soundQuality ) ); - apu->reset( gba ); - apu->volume( 1.0 ); - - for ( int i = apu->osc_count; i--; ) - { - Multi_Buffer::channel_t ch = apu_out->channel( i ); - apu->osc_output( i, ch.center, ch.left, ch.right ); - } - - int addr = 0; - - while (addr < 0x30) { - apu->write_register( 0, 0xFF10 + addr, sound_data [ addr ] ); - addr++; - } - - if (apu_saved) - { - int i; - apu->write_register( 0, 0xFF1A, 0x40); - for (i = 0; i < 16; i++) apu->write_register( 0, 0xFF30 + i, sound3WaveRam[i]); - apu->write_register( 0, 0xFF1A, 0); - for (i = 16; i < 32; i++) apu->write_register( 0, 0xFF30 - 16 + i, sound3WaveRam[i]); - apu->write_register( 0, 0xFF1A, 0x40); - } - else - { - apu->write_register( 0, 0xFF1A, 0 ); - - addr = 0x20; - while (addr < 0x30) { - apu->write_register( 0, 0xFF10 + addr, sound_data [ addr ] ); - addr++; - } - } - - setsoundPaused(true); + soundPaused = true; return true; } return false; @@ -1278,16 +1474,6 @@ void soundSetQuality(int quality) void soundSaveGame(gzFile gzFile) { - int i; - u8 j; - - j = soundRead(NR30); - if (!(j & 0x40)) soundEvent(NR30, u8(j | 0x40)); - for (i = 0; i < 16; i++) sound3WaveRam[i] = soundRead(i + 0x90); - soundEvent(NR30, u8(j & ~0x40)); - for (i = 16; i < 32; i++) sound3WaveRam[i] = soundRead(i - 16 + 0x90); - if (j & 0x40) soundEvent(NR30, j); - utilWriteData(gzFile, soundSaveStruct); utilWriteData(gzFile, soundSaveStructV2); @@ -1300,9 +1486,9 @@ void soundReadGame(gzFile gzFile, int version) if(version >= SAVE_GAME_VERSION_3) { utilReadData(gzFile, soundSaveStructV2); } else { -/* sound3Bank = (ioMem[NR30] >> 6) & 1; + sound3Bank = (ioMem[NR30] >> 6) & 1; sound3DataSize = (ioMem[NR30] >> 5) & 1; - sound3ForcedOutput = (ioMem[NR32] >> 7) & 1;*/ + sound3ForcedOutput = (ioMem[NR32] >> 7) & 1; // nothing better to do here... memcpy(&sound3WaveRam[0x00], &ioMem[0x90], 0x10); memcpy(&sound3WaveRam[0x10], &ioMem[0x90], 0x10); @@ -1312,17 +1498,7 @@ void soundReadGame(gzFile gzFile, int version) int quality = 1; utilGzRead(gzFile, &quality, sizeof(int)); soundSetQuality(quality); - apu->reset(true); - - int i; - u8 j = ioMem[NR30]; - for (i = NR10; i <= NR52; i++) soundEvent(i, ioMem[i]); - if (!(j & 0x40)) soundEventGB(0xFF1A, j | 0x40); - for (i = 0; i < 16; i++) soundEventGB(0xFF30 + i, sound3WaveRam[i]); - soundEventGB(0xFF1A, j & ~0x40); - for (i = 16; i < 32; i++) soundEventGB(0xFF30 - 16 + i, sound3WaveRam[i]); - if (j & 0x40) soundEventGB(0xFF1A, j); - //sound1Wave = soundWavePattern[ioMem[NR11] >> 6]; - //sound2Wave = soundWavePattern[ioMem[NR21] >> 6]; -} \ No newline at end of file + sound1Wave = soundWavePattern[ioMem[NR11] >> 6]; + sound2Wave = soundWavePattern[ioMem[NR21] >> 6]; +} diff --git a/src/Sound.h b/src/Sound.h index ee808a34..43d633b4 100644 --- a/src/Sound.h +++ b/src/Sound.h @@ -21,6 +21,8 @@ #ifndef VBA_SOUND_H #define VBA_SOUND_H +#include "System.h" + #define NR10 0x60 #define NR11 0x62 #define NR12 0x63 @@ -51,7 +53,7 @@ extern void setSoundFn(); extern void (*psoundTickfn)(); extern void soundShutdown(); -extern bool soundInit(bool gba=true); +extern bool soundInit(); extern void soundPause(); extern void soundResume(); extern void soundEnable(int); @@ -67,13 +69,9 @@ extern void soundSetQuality(int); extern void setsystemSoundOn(bool value); extern void setsoundPaused(bool value); extern void setsoundMasterOn(bool value); +extern void interp_rate(); - -//extern int SOUND_TICKS; extern int SOUND_CLOCK_TICKS; -extern u8 soundRead(u32); -extern u16 soundRead16(u32); -extern u32 soundRead32(u32); extern int soundTicks; extern bool soundOffFlag; extern bool soundPaused; @@ -89,14 +87,4 @@ extern bool soundEcho; extern bool soundLowPass; extern bool soundReverse; -#include "Gb_Apu/Multi_Buffer.h" -#include "Gb_Apu/Gb_Apu.h" - -extern Multi_Buffer * apu_out; -extern Gb_Apu * apu; - -extern const BOOST::uint8_t sound_data [Gb_Apu::register_count]; -extern void interp_rate(); - - #endif // VBA_SOUND_H diff --git a/src/gb/GB.cpp b/src/gb/GB.cpp index b81d332a..4536c2db 100644 --- a/src/gb/GB.cpp +++ b/src/gb/GB.cpp @@ -998,7 +998,7 @@ void gbWriteMemory(register u16 address, register u8 value) case 0x3d: case 0x3e: case 0x3f: { - SOUND_EVENT(address,value); + gbMemory[address] = value; return; } @@ -1783,11 +1783,6 @@ u8 gbReadMemory(register u16 address) } if(address >= 0xff00) { - - if (address >= 0xFF10 && address <= 0xFF3F) { - return gbSoundRead(address); - } - switch(address & 0x00ff) { case 0x00: { @@ -3532,8 +3527,6 @@ static bool gbWriteSaveState(gzFile gzFile) utilGzWrite(gzFile, &gbDataMMM01, sizeof(gbDataMMM01)); utilGzWrite(gzFile, gbPalette, 128 * sizeof(u16)); - - for (int i = 0xFF10; i <= 0xFF3F; i++) gbMemory[i] = gbReadMemory(i); utilGzWrite(gzFile, &gbMemory[0x8000], 0x8000); @@ -3725,8 +3718,6 @@ static bool gbReadSaveState(gzFile gzFile) utilGzRead(gzFile, &gbMemory[0x8000], 0x8000); - for (int i = 0xFF10; i <= 0xFF3F; i++) gbSoundEvent(i, gbMemory[i]); - if(gbRamSize && gbRam) { if (version < 11) utilGzRead(gzFile, gbRam, gbRamSize); diff --git a/src/gb/gbSound.cpp b/src/gb/gbSound.cpp index 6e981fc6..e0f192fd 100644 --- a/src/gb/gbSound.cpp +++ b/src/gb/gbSound.cpp @@ -23,9 +23,6 @@ #include "gbGlobals.h" #include "gbSound.h" -#include "../Gb_Apu/Multi_Buffer.h" -#include "../Gb_Apu/Gb_Apu.h" - extern u8 soundBuffer[6][735]; extern u16 soundFinalWave[1470]; extern int soundVolume; @@ -59,9 +56,6 @@ extern int soundBufferIndex; int soundVIN = 0; extern int soundDebug; -extern Multi_Buffer * apu_out; -extern Gb_Apu * apu; - extern int sound1On; extern int sound1ATL; int sound1ATLreload; @@ -138,45 +132,7 @@ extern bool soundLowPass; extern bool soundReverse; extern bool soundOffFlag; -u8 gbSoundRead(u16 address) -{ - if (address < NR10 || address > 0xFF3F || !apu) return gbMemory[address]; - if (address == NR51) return soundBalance; - - int clock = (SOUND_CLOCK_TICKS - soundTicks) * 95 / (24 * (gbSpeed ? 2 : 1)); - - int ret = apu->read_register(clock, address); - - switch ( address ) - { - case NR10: - ret |= 0x80; break; - - case NR11: - case NR21: - ret |= 0x3F; break; - - case NR13: - case NR23: - case NR31: - case NR33: - ret = 0xFF; break; - - case NR14: - case NR24: - case NR34: - case NR44: - ret |= 0xBF; break; - - case NR30: - ret |= 0x7F; break; - - case NR32: - ret |= 0x9F; break; - } - - return ret; -} +bool gbDigitalSound = false; void gbSoundEvent(register u16 address, register int data) { @@ -190,58 +146,481 @@ void gbSoundEvent(register u16 address, register int data) log("Sound event: %08lx %02x\n", address, data); } #endif - if (apu && address >= NR10 && address <= 0xFF3F) - { - int clock = (SOUND_CLOCK_TICKS - soundTicks) * 95 / (24 * (gbSpeed ? 2 : 1)); - if (address == NR50) - { - apu->write_register(clock, address, data); + switch(address) { + case NR10: + gbMemory[address] = data | 0x80; + sound1SweepATL = sound1SweepATLReload = 344 * ((data >> 4) & 7); + sound1SweepSteps = data & 7; + sound1SweepUpDown = data & 0x08; + sound1SweepStep = 0; + break; + case NR11: + gbMemory[address] = data | 0x3f; + sound1Wave = soundWavePattern[data >> 6]; + sound1ATL = sound1ATLreload = 172 * (64 - (data & 0x3f)); + break; + case NR12: + sound1EnvelopeVolume = data >> 4; + sound1EnvelopeUpDown = data & 0x08; + sound1EnvelopeATLReload = sound1EnvelopeATL = 689 * (data & 7); + break; + case NR13: + gbMemory[address] = 0xff; + freq1low = data; + freq = ((((int)(freq1high & 7)) << 8) | freq1low); + sound1ATL = sound1ATLreload; + freq = 2048 - freq; + if(freq) { + sound1Skip = SOUND_MAGIC / freq; + } else + sound1Skip = 0; + break; + case NR14: + gbMemory[address] = data | 0xbf; + freq1high = data; + freq = ((((int)(freq1high & 7)) << 8) | freq1low); + freq = 2048 - freq; + sound1ATL = sound1ATLreload; + sound1Continue = data & 0x40; + if(freq) { + sound1Skip = SOUND_MAGIC / freq; + } else + sound1Skip = 0; + if(data & 0x80) { + gbMemory[NR52] |= 1; + sound1EnvelopeVolume = gbMemory[NR12] >> 4; + sound1EnvelopeUpDown = gbMemory[NR12] & 0x08; + sound1EnvelopeATLReload = sound1EnvelopeATL = 689 * (gbMemory[NR12] & 7); + sound1SweepATL = sound1SweepATLReload = 344 * ((gbMemory[NR10] >> 4) & 7); + sound1SweepSteps = gbMemory[NR10] & 7; + sound1SweepUpDown = gbMemory[NR10] & 0x08; + sound1SweepStep = 0; + + sound1Index = 0; + sound1On = 1; } - else if (address == NR51) - { - soundBalance = data; - apu->write_register(clock, address, data & soundEnableFlag); + break; + case NR21: + gbMemory[address] = data | 0x3f; + sound2Wave = soundWavePattern[data >> 6]; + sound2ATL = sound2ATLreload = 172 * (64 - (data & 0x3f)); + break; + case NR22: + sound2EnvelopeVolume = data >> 4; + sound2EnvelopeUpDown = data & 0x08; + sound2EnvelopeATLReload = sound2EnvelopeATL = 689 * (data & 7); + break; + case NR23: + gbMemory[address] = 0xff; + freq2low = data; + freq = (((int)(freq2high & 7)) << 8) | freq2low; + sound2ATL = sound2ATLreload; + freq = 2048 - freq; + if(freq) { + sound2Skip = SOUND_MAGIC / freq; + } else + sound2Skip = 0; + break; + case NR24: + gbMemory[address] = data | 0xbf; + freq2high = data; + freq = (((int)(freq2high & 7)) << 8) | freq2low; + freq = 2048 - freq; + sound2ATL = sound2ATLreload; + sound2Continue = data & 0x40; + if(freq) { + sound2Skip = SOUND_MAGIC / freq; + } else + sound2Skip = 0; + if(data & 0x80) { + gbMemory[NR52] |= 2; + sound2EnvelopeVolume = gbMemory[NR22] >> 4; + sound2EnvelopeUpDown = gbMemory[NR22] & 0x08; + sound2ATL = sound2ATLreload; + sound2EnvelopeATLReload = sound2EnvelopeATL = 689 * (gbMemory[NR22] & 7); + + sound2Index = 0; + sound2On = 1; } - else - apu->write_register(clock, address, data); + break; + case NR30: + gbMemory[address] = data | 0x7f; + if(!(data & 0x80)) { + gbMemory[NR52] &= 0xfb; + sound3On = 0; + } + break; + case NR31: + gbMemory[address] = 0xff; + sound3ATL = sound3ATLreload = 172 * (256-data); + break; + case NR32: + gbMemory[address] = data | 0x9f; + sound3OutputLevel = (data >> 5) & 3; + break; + case NR33: + gbMemory[address] = 0xff; + freq3low = data; + freq = 2048 - (((int)(freq3high&7) << 8) | freq3low); + if(freq) { + sound3Skip = SOUND_MAGIC_2 / freq; + } else + sound3Skip = 0; + break; + case NR34: + gbMemory[address] = data | 0xbf; + freq3high = data; + freq = 2048 - (((int)(freq3high&7) << 8) | freq3low); + if(freq) { + sound3Skip = SOUND_MAGIC_2 / freq; + } else { + sound3Skip = 0; + } + sound3Continue = data & 0x40; + if((data & 0x80) && (gbMemory[NR30] & 0x80)) { + gbMemory[NR52] |= 4; + sound3ATL = sound3ATLreload; + sound3Index = 0; + sound3On = 1; + } + break; + case NR41: + sound4ATL = sound4ATLreload = 172 * (64 - (data & 0x3f)); + break; + case NR42: + sound4EnvelopeVolume = data >> 4; + sound4EnvelopeUpDown = data & 0x08; + sound4EnvelopeATLReload = sound4EnvelopeATL = 689 * (data & 7); + break; + case NR43: + freq = freq4 = soundFreqRatio[data & 7]; + sound4NSteps = data & 0x08; + + sound4Skip = (freq << 8) / NOISE_MAGIC; + + sound4Clock = data >> 4; + + freq = freq / soundShiftClock[sound4Clock]; + + sound4ShiftSkip = (freq << 8) / NOISE_MAGIC; + + break; + case NR44: + gbMemory[address] = data | 0xbf; + sound4Continue = data & 0x40; + if(data & 0x80) { + gbMemory[NR52] |= 8; + sound4EnvelopeVolume = gbMemory[NR42] >> 4; + sound4EnvelopeUpDown = gbMemory[NR42] & 0x08; + sound4ATL = sound4ATLreload; + sound4EnvelopeATLReload = sound4EnvelopeATL = 689 * (gbMemory[NR42] & 7); + + sound4On = 1; + + sound4Index = 0; + sound4ShiftIndex = 0; + + if(sound4NSteps) + sound4ShiftRight = 0x7fff; + else + sound4ShiftRight = 0x7f; + } + break; + case NR50: + soundVIN = data & 0x88; + soundLevel1 = data & 7; + soundLevel2 = (data >> 4) & 7; + break; + case NR51: + soundBalance = (data & soundEnableFlag); + break; + case NR52: + soundMasterOn = data & 0x80; + if(!(data & 0x80)) { + sound1On = 0; + sound2On = 0; + sound3On = 0; + sound4On = 0; + gbMemory[address] &= 0xf0; + } + gbMemory[address] = data & 0x80 | 0x70 | (gbMemory[address] & 0xf); + break; } + + gbDigitalSound = true; + + if(sound1On && sound1EnvelopeVolume != 0) + gbDigitalSound = false; + if(sound2On && sound2EnvelopeVolume != 0) + gbDigitalSound = false; + if(sound3On && sound3OutputLevel != 0) + gbDigitalSound = false; + if(sound4On && sound4EnvelopeVolume != 0) + gbDigitalSound = false; } void gbSoundChannel1() { + int vol = sound1EnvelopeVolume; + + int freq = 0; + + int value = 0; + + if(sound1On && (sound1ATL || !sound1Continue)) { + sound1Index += soundQuality*sound1Skip; + sound1Index &= 0x1fffffff; + + value = ((s8)sound1Wave[sound1Index>>24]) * vol; + } + + soundBuffer[0][soundIndex] = value; + + + if(sound1On) { + if(sound1ATL) { + sound1ATL-=soundQuality; + + if(sound1ATL <=0 && sound1Continue) { + gbMemory[NR52] &= 0xfe; + sound1On = 0; + } + } + + if(sound1EnvelopeATL) { + sound1EnvelopeATL-=soundQuality; + + if(sound1EnvelopeATL<=0) { + if(sound1EnvelopeUpDown) { + if(sound1EnvelopeVolume < 15) + sound1EnvelopeVolume++; + } else { + if(sound1EnvelopeVolume) + sound1EnvelopeVolume--; + } + + sound1EnvelopeATL += sound1EnvelopeATLReload; + } + } + + if(sound1SweepATL) { + sound1SweepATL-=soundQuality; + + if(sound1SweepATL<=0) { + freq = (((int)(freq1high & 7)) << 8) | freq1low; + + int updown = 1; + + if(sound1SweepUpDown) + updown = -1; + + int newfreq = 0; + if(sound1SweepSteps) { + newfreq = freq + updown * freq / (1 << sound1SweepSteps); + if(newfreq == freq) + newfreq = 0; + } else + newfreq = freq; + + if(newfreq < 0) { + sound1SweepATL += sound1SweepATLReload; + } else if(newfreq > 2047) { + sound1SweepATL = 0; + sound1On = 0; + gbMemory[NR52] &= 0xfe; + } else { + sound1SweepATL += sound1SweepATLReload; + sound1Skip = SOUND_MAGIC/(2048 - newfreq); + + freq1low = newfreq & 0xff; + freq1high = (freq1high & 0xf8) |((newfreq >> 8) & 7); + } + } + } + } } void gbSoundChannel2() { + // int freq = 0; + int vol = sound2EnvelopeVolume; + + int value = 0; + + if(sound2On && (sound2ATL || !sound2Continue)) { + sound2Index += soundQuality*sound2Skip; + sound2Index &= 0x1fffffff; + + value = ((s8)sound2Wave[sound2Index>>24]) * vol; + } + + soundBuffer[1][soundIndex] = value; + + if(sound2On) { + if(sound2ATL) { + sound2ATL-=soundQuality; + + if(sound2ATL <= 0 && sound2Continue) { + gbMemory[NR52] &= 0xfd; + sound2On = 0; + } + } + + if(sound2EnvelopeATL) { + sound2EnvelopeATL-=soundQuality; + + if(sound2EnvelopeATL <= 0) { + if(sound2EnvelopeUpDown) { + if(sound2EnvelopeVolume < 15) + sound2EnvelopeVolume++; + } else { + if(sound2EnvelopeVolume) + sound2EnvelopeVolume--; + } + sound2EnvelopeATL += sound2EnvelopeATLReload; + } + } + } } void gbSoundChannel3() { + int value = 0; + + if(sound3On && (sound3ATL || !sound3Continue)) { + + value = sound3Last; + + sound3Index += soundQuality*sound3Skip; + sound3Index &= 0x1fffffff; + + value = gbMemory[0xff30 + (sound3Index>>25)]; + + if( (sound3Index & 0x01000000)) { + value &= 0x0f; + } else { + value >>= 4; + } + + value -= 8; + + switch(sound3OutputLevel) { + case 0: + value = 0; + break; + case 1: + break; + case 2: + value = (value >> 1); + break; + case 3: + value = (value >> 2); + break; + } + sound3Last = value; + } + + soundBuffer[2][soundIndex] = value; + + if(sound3On) { + if(sound3ATL) { + sound3ATL-=soundQuality; + + if(sound3ATL <= 0 && sound3Continue) { + gbMemory[NR52] &= 0xfb; + sound3On = 0; + } + } + } } void gbSoundChannel4() { + int vol = sound4EnvelopeVolume; + + int value = 0; + + if(sound4Clock <= 0x0c) { + if(sound4On && (sound4ATL || !sound4Continue)) { + sound4Index += soundQuality*sound4Skip; + sound4ShiftIndex += soundQuality*sound4ShiftSkip; + + if(sound4NSteps) { + while(sound4ShiftIndex > 0x1fffff) { + sound4ShiftRight = (((sound4ShiftRight << 6) ^ + (sound4ShiftRight << 5)) & 0x40) | + (sound4ShiftRight >> 1); + sound4ShiftIndex -= 0x200000; + } + } else { + while(sound4ShiftIndex > 0x1fffff) { + sound4ShiftRight = (((sound4ShiftRight << 14) ^ + (sound4ShiftRight << 13)) & 0x4000) | + (sound4ShiftRight >> 1); + + sound4ShiftIndex -= 0x200000; + } + } + + sound4Index &= 0x1fffff; + sound4ShiftIndex &= 0x1fffff; + + value = ((sound4ShiftRight & 1)*2-1) * vol; + } else { + value = 0; + } + } + + soundBuffer[3][soundIndex] = value; + + if(sound4On) { + if(sound4ATL) { + sound4ATL-=soundQuality; + + if(sound4ATL <= 0 && sound4Continue) { + gbMemory[NR52] &= 0xf7; + sound4On = 0; + } + } + + if(sound4EnvelopeATL) { + sound4EnvelopeATL-=soundQuality; + + if(sound4EnvelopeATL <= 0) { + if(sound4EnvelopeUpDown) { + if(sound4EnvelopeVolume < 15) + sound4EnvelopeVolume++; + } else { + if(sound4EnvelopeVolume) + sound4EnvelopeVolume--; + } + sound4EnvelopeATL += sound4EnvelopeATLReload; + } + } + } } void gbSoundMix() { int res = 0; - - blip_sample_t out[2] = {0, 0}; - - if ( ! apu_out ) return; - - while (!apu_out->read_samples(&out[0], 2)) - { - int ticks = SOUND_CLOCK_TICKS * 95 / (24 * (gbSpeed ? 2 : 1)); - bool was_stereo = apu->end_frame( ticks ); - apu_out->end_frame( ticks, was_stereo ); + if(soundBalance & 16) { + res += ((s8)soundBuffer[0][soundIndex]); + } + if(soundBalance & 32) { + res += ((s8)soundBuffer[1][soundIndex]); + } + if(soundBalance & 64) { + res += ((s8)soundBuffer[2][soundIndex]); + } + if(soundBalance & 128) { + res += ((s8)soundBuffer[3][soundIndex]); } - res = out[0]; - - //res = (res * 7 * 60) >> 8; + if(gbDigitalSound) + res *= soundLevel1*256; + else + res *= soundLevel1*60; if(soundEcho) { res *= 2; @@ -285,7 +664,25 @@ void gbSoundMix() else soundFinalWave[soundBufferIndex++] = res; - res = out[1]; + res = 0; + + if(soundBalance & 1) { + res += ((s8)soundBuffer[0][soundIndex]); + } + if(soundBalance & 2) { + res += ((s8)soundBuffer[1][soundIndex]); + } + if(soundBalance & 4) { + res += ((s8)soundBuffer[2][soundIndex]); + } + if(soundBalance & 8) { + res += ((s8)soundBuffer[3][soundIndex]); + } + + if(gbDigitalSound) + res *= soundLevel2*256; + else + res *= soundLevel2*60; if(soundEcho) { res *= 2; @@ -337,10 +734,10 @@ void gbSoundTick() { if(systemSoundOn) { if(soundMasterOn) { - /*gbSoundChannel1(); + gbSoundChannel1(); gbSoundChannel2(); gbSoundChannel3(); - gbSoundChannel4();*/ + gbSoundChannel4(); gbSoundMix(); } else { @@ -366,7 +763,7 @@ void gbSoundTick() void gbSoundReset() { - soundPaused = true; + soundPaused = 1; soundPlay = 0; SOUND_CLOCK_TICKS = soundQuality * 24; soundTicks = SOUND_CLOCK_TICKS; @@ -378,7 +775,7 @@ void gbSoundReset() soundLevel2 = 7; soundVIN = 0; - /*sound1On = 0; + sound1On = 0; sound1ATL = 0; sound1Skip = 0; sound1Index = 0; @@ -424,48 +821,53 @@ void gbSoundReset() sound4EnvelopeVolume = 0; sound4EnvelopeATL = 0; sound4EnvelopeUpDown = 0; - sound4EnvelopeATLReload = 0;*/ + sound4EnvelopeATLReload = 0; // don't translate if(soundDebug) { log("*** Sound Init ***\n"); } + + gbSoundEvent(0xff10, 0x80); + gbSoundEvent(0xff11, 0xbf); + gbSoundEvent(0xff12, 0xf3); + gbSoundEvent(0xff14, 0xbf); + gbSoundEvent(0xff16, 0x3f); + gbSoundEvent(0xff17, 0x00); + gbSoundEvent(0xff19, 0xbf); - if (apu_out) - { - apu_out->clear(); - apu->reset(false); + gbSoundEvent(0xff1a, 0x7f); + gbSoundEvent(0xff1b, 0xff); + gbSoundEvent(0xff1c, 0xbf); + gbSoundEvent(0xff1e, 0xbf); - extern const BOOST::uint8_t sound_data[Gb_Apu::end_addr - Gb_Apu::start_addr + 1]; + gbSoundEvent(0xff20, 0xff); + gbSoundEvent(0xff21, 0x00); + gbSoundEvent(0xff22, 0x00); + gbSoundEvent(0xff23, 0xbf); + gbSoundEvent(0xff24, 0x77); + gbSoundEvent(0xff25, 0xf3); - int addr = 0; - - while (addr < 0x30) { - apu->write_register( 0, 0xFF10 + addr, sound_data [ addr ] ); - addr++; - } - } + if (gbHardware & 0x4) + gbSoundEvent(0xff26, 0xf0); + else + gbSoundEvent(0xff26, 0xf1); // don't translate if(soundDebug) { log("*** Sound Init Complete ***\n"); } - /*sound1On = 0; + sound1On = 0; sound2On = 0; sound3On = 0; - sound4On = 0;*/ + sound4On = 0; - if (apu) - { - int addr = 0xff30; + int addr = 0xff30; - while(addr < 0xff40) { - /*gbMemory[addr++] = 0x00; - gbMemory[addr++] = 0xff;*/ - gbSoundEvent(addr++, 0x00); - gbSoundEvent(addr++, 0xFF); - } + while(addr < 0xff40) { + gbMemory[addr++] = 0x00; + gbMemory[addr++] = 0xff; } memset(soundFinalWave, 0x00, soundBufferLen); @@ -475,7 +877,7 @@ void gbSoundReset() soundEchoIndex = 0; } -extern bool soundInit(bool gb); +extern bool soundInit(); extern void soundShutdown(); void gbSoundSetQuality(int quality) @@ -486,7 +888,7 @@ void gbSoundSetQuality(int quality) soundQuality = quality; soundNextPosition = 0; if(!soundOffFlag) - soundInit(false); + soundInit(); SOUND_CLOCK_TICKS = (gbSpeed ? 2 : 1) * 24 * soundQuality; soundIndex = 0; soundBufferIndex = 0; diff --git a/src/gb/gbSound.h b/src/gb/gbSound.h index 27dd0a5b..50658b24 100644 --- a/src/gb/gbSound.h +++ b/src/gb/gbSound.h @@ -22,7 +22,6 @@ #define NR12 0xff12 #define NR13 0xff13 #define NR14 0xff14 -#define NR20 0xff15 #define NR21 0xff16 #define NR22 0xff17 #define NR23 0xff18 @@ -32,7 +31,6 @@ #define NR32 0xff1c #define NR33 0xff1d #define NR34 0xff1e -#define NR40 0xff1f #define NR41 0xff20 #define NR42 0xff21 #define NR43 0xff22 @@ -56,8 +54,6 @@ extern void gbSoundReadGame(int,gzFile); extern void gbSoundEvent(register u16, register int); extern void gbSoundSetQuality(int); -extern u8 gbSoundRead(u16 address); - extern int soundTicks; extern int soundQuality; extern int SOUND_CLOCK_TICKS; diff --git a/src/win32/MainWnd.cpp b/src/win32/MainWnd.cpp index 195c2622..e4c6093c 100644 --- a/src/win32/MainWnd.cpp +++ b/src/win32/MainWnd.cpp @@ -620,7 +620,7 @@ bool MainWnd::FileRun() soundReset(); } else { if(!soundOffFlag) - soundInit(!(theApp.cartridgeType==1)); + soundInit(); theApp.soundInitialized = true; } diff --git a/src/win32/dependencies/cximage/cximage.vcproj b/src/win32/dependencies/cximage/cximage.vcproj deleted file mode 100644 index 9799829a..00000000 --- a/src/win32/dependencies/cximage/cximage.vcproj +++ /dev/null @@ -1,367 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/win32/dependencies/cximage/license.txt b/src/win32/dependencies/cximage/license.txt deleted file mode 100644 index 755e2c41..00000000 --- a/src/win32/dependencies/cximage/license.txt +++ /dev/null @@ -1,48 +0,0 @@ -This copy of the CxImage notices is provided for your convenience. In case of -any discrepancy between this copy and the notices in the file ximage.h that is -included in the CxImage distribution, the latter shall prevail. - -If you modify CxImage you may insert additional notices immediately following -this sentence. - --------------------------------------------------------------------------------- - -COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - -CxImage version 5.99c 17/Oct/2004 - -CxImage : Copyright (C) 2001 - 2004, Davide Pizzolato - -Original CImage and CImageIterator implementation are: -Copyright (C) 1995, Alejandro Aguilar Sierra (asierra(at)servidor(dot)unam(dot)mx) - -Covered code is provided under this license on an "as is" basis, without warranty -of any kind, either expressed or implied, including, without limitation, warranties -that the covered code is free of defects, merchantable, fit for a particular purpose -or non-infringing. The entire risk as to the quality and performance of the covered -code is with you. Should any covered code prove defective in any respect, you (not -the initial developer or any other contributor) assume the cost of any necessary -servicing, repair or correction. This disclaimer of warranty constitutes an essential -part of this license. No use of any covered code is authorized hereunder except under -this disclaimer. - -Permission is hereby granted to use, copy, modify, and distribute this -source code, or portions hereof, for any purpose, including commercial applications, -freely and without fee, subject to the following restrictions: - -1. The origin of this software must not be misrepresented; you must not -claim that you wrote the original software. If you use this software -in a product, an acknowledgment in the product documentation would be -appreciated but is not required. - -2. Altered source versions must be plainly marked as such, and must not be -misrepresented as being the original software. - -3. This notice may not be removed or altered from any source distribution. - --------------------------------------------------------------------------------- - -Other information: about CxImage, and the latest version, can be found at the -CxImage home page: http://www.xdp.it - --------------------------------------------------------------------------------- diff --git a/src/win32/dependencies/cximage/tif_xfile.cpp b/src/win32/dependencies/cximage/tif_xfile.cpp deleted file mode 100644 index edfc943e..00000000 --- a/src/win32/dependencies/cximage/tif_xfile.cpp +++ /dev/null @@ -1,208 +0,0 @@ -/* - * TIFF file IO, using CxFile. - */ - -#ifdef WIN32 - #include -#endif -#include - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_TIF - -#include "../tiff/tiffiop.h" - -#include "xfile.h" - -static tsize_t -_tiffReadProcEx(thandle_t fd, tdata_t buf, tsize_t size) -{ - return ((CxFile*)fd)->Read(buf, 1, size); -} - -static tsize_t -_tiffWriteProcEx(thandle_t fd, tdata_t buf, tsize_t size) -{ - return ((CxFile*)fd)->Write(buf, 1, size); -} - -static toff_t -_tiffSeekProcEx(thandle_t fd, toff_t off, int whence) -{ - if ( off == 0xFFFFFFFF ) - return 0xFFFFFFFF; - if (!((CxFile*)fd)->Seek(off, whence)) - return 0xFFFFFFFF; - if (whence == SEEK_SET) - return off; - - return (toff_t)((CxFile*)fd)->Tell(); -} - -// Return nonzero if error -static int -_tiffCloseProcEx(thandle_t fd) -{ -// return !((CxFile*)fd)->Close(); // "//" needed for memory files - return 0; -} - -#include - -static toff_t -_tiffSizeProcEx(thandle_t fd) -{ - return ((CxFile*)fd)->Size(); -} - -static int -_tiffMapProcEx(thandle_t fd, tdata_t* pbase, toff_t* psize) -{ - return (0); -} - -static void -_tiffUnmapProcEx(thandle_t fd, tdata_t base, toff_t size) -{ -} - -// Open a TIFF file descriptor for read/writing. -/* -TIFF* -TIFFOpen(const char* name, const char* mode) -{ - static const char module[] = "TIFFOpen"; - FILE* stream = fopen(name, mode); - if (stream == NULL) - { - TIFFError(module, "%s: Cannot open", name); - return NULL; - } - return (TIFFFdOpen((int)stream, name, mode)); -} -*/ - -TIFF* -_TIFFFdOpen(int fd, const char* name, const char* mode) -{ - TIFF* tif; - - tif = TIFFClientOpen(name, mode, - (thandle_t) fd, - _tiffReadProcEx, _tiffWriteProcEx, _tiffSeekProcEx, _tiffCloseProcEx, - _tiffSizeProcEx, _tiffMapProcEx, _tiffUnmapProcEx); - if (tif) - tif->tif_fd = fd; - return (tif); -} - -extern "C" TIFF* _TIFFOpenEx(CxFile* stream, const char* mode) -{ - return (_TIFFFdOpen((int)stream, "TIFF IMAGE", mode)); -} - -#ifdef __GNUC__ -extern char* malloc(); -extern char* realloc(); -#else -#include -#endif - -tdata_t -_TIFFmalloc(tsize_t s) -{ - return (malloc((size_t) s)); -} - -void -_TIFFfree(tdata_t p) -{ - free(p); -} - -tdata_t -_TIFFrealloc(tdata_t p, tsize_t s) -{ - return (realloc(p, (size_t) s)); -} - -void -_TIFFmemset(tdata_t p, int v, tsize_t c) -{ - memset(p, v, (size_t) c); -} - -void -_TIFFmemcpy(tdata_t d, const tdata_t s, tsize_t c) -{ - memcpy(d, s, (size_t) c); -} - -int -_TIFFmemcmp(const tdata_t p1, const tdata_t p2, tsize_t c) -{ - return (memcmp(p1, p2, (size_t) c)); -} - -static void -Win32WarningHandler(const char* module, const char* fmt, va_list ap) -{ -#ifdef _DEBUG -#if (!defined(_CONSOLE) && defined(WIN32)) - LPTSTR szTitle; - LPTSTR szTmp; - LPCTSTR szTitleText = "%s Warning"; - LPCTSTR szDefaultModule = "TIFFLIB"; - szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module; - if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (lstrlen(szTmp) + - lstrlen(szTitleText) + lstrlen(fmt) + 128)*sizeof(TCHAR))) == NULL) - return; - wsprintf(szTitle, szTitleText, szTmp); - szTmp = szTitle + (lstrlen(szTitle)+2)*sizeof(TCHAR); - wvsprintf(szTmp, fmt, ap); - MessageBox(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONINFORMATION); - LocalFree(szTitle); - return; -#else - if (module != NULL) - fprintf(stderr, "%s: ", module); - fprintf(stderr, "Warning, "); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -#endif -#endif -} -TIFFErrorHandler _TIFFwarningHandler = Win32WarningHandler; - -static void -Win32ErrorHandler(const char* module, const char* fmt, va_list ap) -{ -#ifdef _DEBUG -#if (!defined(_CONSOLE) && defined(WIN32)) - LPTSTR szTitle; - LPTSTR szTmp; - LPCTSTR szTitleText = "%s Error"; - LPCTSTR szDefaultModule = "TIFFLIB"; - szTmp = (module == NULL) ? (LPTSTR)szDefaultModule : (LPTSTR)module; - if ((szTitle = (LPTSTR)LocalAlloc(LMEM_FIXED, (lstrlen(szTmp) + - lstrlen(szTitleText) + lstrlen(fmt) + 128)*sizeof(TCHAR))) == NULL) - return; - wsprintf(szTitle, szTitleText, szTmp); - szTmp = szTitle + (lstrlen(szTitle)+2)*sizeof(TCHAR); - wvsprintf(szTmp, fmt, ap); - MessageBox(GetFocus(), szTmp, szTitle, MB_OK | MB_ICONEXCLAMATION); - LocalFree(szTitle); - return; -#else - if (module != NULL) - fprintf(stderr, "%s: ", module); - vfprintf(stderr, fmt, ap); - fprintf(stderr, ".\n"); -#endif -#endif -} -TIFFErrorHandler _TIFFerrorHandler = Win32ErrorHandler; - -#endif - diff --git a/src/win32/dependencies/cximage/xfile.h b/src/win32/dependencies/cximage/xfile.h deleted file mode 100644 index af10b031..00000000 --- a/src/win32/dependencies/cximage/xfile.h +++ /dev/null @@ -1,76 +0,0 @@ -/* - * File: xfile.h - * Purpose: General Purpose File Class - */ -/* - -------------------------------------------------------------------------------- - - COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - - CxFile (c) 11/May/2002 Davide Pizzolato - www.xdp.it - CxFile version 2.00 23/Aug/2002 - - Special thanks to Chris Shearer Cooper for new features, enhancements and bugfixes - - Covered code is provided under this license on an "as is" basis, without warranty - of any kind, either expressed or implied, including, without limitation, warranties - that the covered code is free of defects, merchantable, fit for a particular purpose - or non-infringing. The entire risk as to the quality and performance of the covered - code is with you. Should any covered code prove defective in any respect, you (not - the initial developer or any other contributor) assume the cost of any necessary - servicing, repair or correction. This disclaimer of warranty constitutes an essential - part of this license. No use of any covered code is authorized hereunder except under - this disclaimer. - - Permission is hereby granted to use, copy, modify, and distribute this - source code, or portions hereof, for any purpose, including commercial applications, - freely and without fee, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source distribution. - -------------------------------------------------------------------------------- - */ -#if !defined(__xfile_h) -#define __xfile_h - -#ifdef WIN32 - #include -#endif - -#include -#include - -#include "ximadef.h" - -class DLL_EXP CxFile -{ -public: - CxFile(void) { }; - virtual ~CxFile() { }; - - virtual bool Close() = 0; - virtual size_t Read(void *buffer, size_t size, size_t count) = 0; - virtual size_t Write(const void *buffer, size_t size, size_t count) = 0; - virtual bool Seek(long offset, int origin) = 0; - virtual long Tell() = 0; - virtual long Size() = 0; - virtual bool Flush() = 0; - virtual bool Eof() = 0; - virtual long Error() = 0; - virtual bool PutC(unsigned char c) - { - // Default implementation - size_t nWrote = Write(&c, 1, 1); - return (bool)(nWrote == 1); - } - virtual long GetC() = 0; -}; - -#endif //__xfile_h diff --git a/src/win32/dependencies/cximage/ximabmp.cpp b/src/win32/dependencies/cximage/ximabmp.cpp deleted file mode 100644 index f723ded2..00000000 --- a/src/win32/dependencies/cximage/ximabmp.cpp +++ /dev/null @@ -1,361 +0,0 @@ -/* - * File: ximabmp.cpp - * Purpose: Platform Independent BMP Image Class Loader and Writer - * 07/Aug/2001 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximabmp.h" - -#if CXIMAGE_SUPPORT_BMP - -#include "ximaiter.h" - -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageBMP::Encode(CxFile * hFile) -{ - - if (EncodeSafeCheck(hFile)) return false; - - BITMAPFILEHEADER hdr; - - hdr.bfType = 0x4d42; // 'BM' WINDOWS_BITMAP_SIGNATURE - hdr.bfSize = GetSize() + 14 /*sizeof(BITMAPFILEHEADER)*/; - hdr.bfReserved1 = hdr.bfReserved2 = 0; - hdr.bfOffBits = 14 /*sizeof(BITMAPFILEHEADER)*/ + head.biSize + GetPaletteSize(); - - //copy attributes - memcpy(pDib,&head,sizeof(BITMAPINFOHEADER)); - // Write the file header - hFile->Write(&hdr,min(14,sizeof(BITMAPFILEHEADER)),1); - // Write the DIB header and the pixels - hFile->Write(pDib,GetSize(),1); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_DECODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageBMP::Decode(CxFile * hFile) -{ - if (hFile == NULL) return false; - - BITMAPFILEHEADER bf; - DWORD off = hFile->Tell(); // - try { - if (hFile->Read(&bf,min(14,sizeof(bf)),1)==0) throw "Not a BMP"; - if (bf.bfType != BFT_BITMAP) { //do we have a RC HEADER? - bf.bfOffBits = 0L; - hFile->Seek(off,SEEK_SET); - } - - BITMAPINFOHEADER bmpHeader; - if (!DibReadBitmapInfo(hFile,&bmpHeader)) throw "Error reading BMP info"; - DWORD dwCompression=bmpHeader.biCompression; - DWORD dwBitCount=bmpHeader.biBitCount; //preserve for BI_BITFIELDS compression - bool bIsOldBmp = bmpHeader.biSize == sizeof(BITMAPCOREHEADER); - - bool bTopDownDib = bmpHeader.biHeight<0; // check if it's a top-down bitmap - if (bTopDownDib) bmpHeader.biHeight=-bmpHeader.biHeight; - - if (info.nEscape == -1) { - // Return output dimensions only - head.biWidth = bmpHeader.biWidth; - head.biHeight = bmpHeader.biHeight; - throw "output dimensions returned"; - } - - if (!Create(bmpHeader.biWidth,bmpHeader.biHeight,bmpHeader.biBitCount,CXIMAGE_FORMAT_BMP)) - throw "Can't allocate memory"; - - head.biXPelsPerMeter = bmpHeader.biXPelsPerMeter; - head.biYPelsPerMeter = bmpHeader.biYPelsPerMeter; - info.xDPI = (long) floor(bmpHeader.biXPelsPerMeter * 254.0 / 10000.0 + 0.5); - info.yDPI = (long) floor(bmpHeader.biYPelsPerMeter * 254.0 / 10000.0 + 0.5); - - if (info.nEscape) throw "Cancelled"; // - cancel decoding - - RGBQUAD *pRgb = GetPalette(); - if (pRgb){ - if (bIsOldBmp){ - // convert a old color table (3 byte entries) to a new - // color table (4 byte entries) - hFile->Read((void*)pRgb,DibNumColors(&bmpHeader) * sizeof(RGBTRIPLE),1); - for (int i=DibNumColors(&head)-1; i>=0; i--){ - pRgb[i].rgbRed = ((RGBTRIPLE *)pRgb)[i].rgbtRed; - pRgb[i].rgbBlue = ((RGBTRIPLE *)pRgb)[i].rgbtBlue; - pRgb[i].rgbGreen = ((RGBTRIPLE *)pRgb)[i].rgbtGreen; - pRgb[i].rgbReserved = (BYTE)0; - } - } else { - hFile->Read((void*)pRgb,DibNumColors(&bmpHeader) * sizeof(RGBQUAD),1); - //force rgbReserved=0, to avoid problems with some WinXp bitmaps - for (unsigned int i=0; i - cancel decoding - - switch (dwBitCount) { - case 32 : - if (bf.bfOffBits != 0L) hFile->Seek(off + bf.bfOffBits,SEEK_SET); - if (dwCompression == BI_BITFIELDS || dwCompression == BI_RGB){ - long imagesize=4*head.biHeight*head.biWidth; - BYTE* buff32=(BYTE*)malloc(imagesize); - if (buff32){ - hFile->Read(buff32, imagesize,1); // read in the pixels - Bitfield2RGB(buff32,0,0,0,32); - free(buff32); - } else throw "can't allocate memory"; - } else throw "unknown compression"; - break; - case 24 : - if (bf.bfOffBits != 0L) hFile->Seek(off + bf.bfOffBits,SEEK_SET); - if (dwCompression == BI_RGB){ - hFile->Read(info.pImage, head.biSizeImage,1); // read in the pixels - } else throw "unknown compression"; - break; - case 16 : - { - DWORD bfmask[3]; - if (dwCompression == BI_BITFIELDS) - { - hFile->Read(bfmask, 12, 1); - } else { - bfmask[0]=0x7C00; bfmask[1]=0x3E0; bfmask[2]=0x1F; //RGB555 - } - // bf.bfOffBits required after the bitfield mask - if (bf.bfOffBits != 0L) hFile->Seek(off + bf.bfOffBits,SEEK_SET); - // read in the pixels - hFile->Read(info.pImage, head.biHeight*((head.biWidth+1)/2)*4,1); - // transform into RGB - Bitfield2RGB(info.pImage,(WORD)bfmask[0],(WORD)bfmask[1],(WORD)bfmask[2],16); - break; - } - case 8 : - case 4 : - case 1 : - if (bf.bfOffBits != 0L) hFile->Seek(off + bf.bfOffBits,SEEK_SET); - switch (dwCompression) { - case BI_RGB : - hFile->Read(info.pImage, head.biSizeImage,1); // read in the pixels - break; - case BI_RLE4 : - { - BYTE status_byte = 0; - BYTE second_byte = 0; - int scanline = 0; - int bits = 0; - BOOL low_nibble = FALSE; - CImageIterator iter(this); - - for (BOOL bContinue = TRUE; bContinue;) { - hFile->Read(&status_byte, sizeof(BYTE), 1); - switch (status_byte) { - case RLE_COMMAND : - hFile->Read(&status_byte, sizeof(BYTE), 1); - switch (status_byte) { - case RLE_ENDOFLINE : - bits = 0; - scanline++; - low_nibble = FALSE; - break; - case RLE_ENDOFBITMAP : - bContinue=FALSE; - break; - case RLE_DELTA : - { - // read the delta values - BYTE delta_x; - BYTE delta_y; - hFile->Read(&delta_x, sizeof(BYTE), 1); - hFile->Read(&delta_y, sizeof(BYTE), 1); - // apply them - bits += delta_x / 2; - scanline += delta_y; - break; - } - default : - hFile->Read(&second_byte, sizeof(BYTE), 1); - BYTE *sline = iter.GetRow(scanline); - for (int i = 0; i < status_byte; i++) { - if (low_nibble) { - if ((DWORD)(sline+bits) < (DWORD)(info.pImage+head.biSizeImage)){ - *(sline + bits) |= (second_byte & 0x0F); - } - if (i != status_byte - 1) - hFile->Read(&second_byte, sizeof(BYTE), 1); - bits++; - } else { - if ((DWORD)(sline+bits) < (DWORD)(info.pImage+head.biSizeImage)){ - *(sline + bits) = (BYTE)(second_byte & 0xF0); - } - } - low_nibble = !low_nibble; - } - if ((((status_byte+1) >> 1) & 1 )== 1) - hFile->Read(&second_byte, sizeof(BYTE), 1); - break; - }; - break; - default : - { - BYTE *sline = iter.GetRow(scanline); - hFile->Read(&second_byte, sizeof(BYTE), 1); - for (unsigned i = 0; i < status_byte; i++) { - if (low_nibble) { - if ((DWORD)(sline+bits) < (DWORD)(info.pImage+head.biSizeImage)){ - *(sline + bits) |= (second_byte & 0x0F); - } - bits++; - } else { - if ((DWORD)(sline+bits) < (DWORD)(info.pImage+head.biSizeImage)){ - *(sline + bits) = (BYTE)(second_byte & 0xF0); - } - } - low_nibble = !low_nibble; - } - } - break; - }; - } - break; - } - case BI_RLE8 : - { - BYTE status_byte = 0; - BYTE second_byte = 0; - int scanline = 0; - int bits = 0; - CImageIterator iter(this); - - for (BOOL bContinue = TRUE; bContinue; ) { - hFile->Read(&status_byte, sizeof(BYTE), 1); - switch (status_byte) { - case RLE_COMMAND : - hFile->Read(&status_byte, sizeof(BYTE), 1); - switch (status_byte) { - case RLE_ENDOFLINE : - bits = 0; - scanline++; - break; - case RLE_ENDOFBITMAP : - bContinue=FALSE; - break; - case RLE_DELTA : - { - // read the delta values - BYTE delta_x; - BYTE delta_y; - hFile->Read(&delta_x, sizeof(BYTE), 1); - hFile->Read(&delta_y, sizeof(BYTE), 1); - // apply them - bits += delta_x; - scanline += delta_y; - break; - } - default : - hFile->Read((void *)(iter.GetRow(scanline) + bits), sizeof(BYTE) * status_byte, 1); - // align run length to even number of bytes - if ((status_byte & 1) == 1) - hFile->Read(&second_byte, sizeof(BYTE), 1); - bits += status_byte; - break; - }; - break; - default : - BYTE *sline = iter.GetRow(scanline); - hFile->Read(&second_byte, sizeof(BYTE), 1); - for (unsigned i = 0; i < status_byte; i++) { - if ((DWORD)bits - - } catch (char *message) { - strncpy(info.szLastError,message,255); - if (info.nEscape==-1) return true; - return false; - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/* ReadDibBitmapInfo() - * - * Will read a file in DIB format and return a global HANDLE to its - * BITMAPINFO. This function will work with both "old" and "new" - * bitmap formats, but will always return a "new" BITMAPINFO. - */ -bool CxImageBMP::DibReadBitmapInfo(CxFile* fh, BITMAPINFOHEADER *pdib) -{ - if ((fh==NULL)||(pdib==NULL)) return false; - - if (fh->Read(pdib,sizeof(BITMAPINFOHEADER),1)==0) return false; - - BITMAPCOREHEADER bc; - - switch (pdib->biSize) // what type of bitmap info is this? - { - case sizeof(BITMAPINFOHEADER): - break; - - case 64: //sizeof(OS2_BMP_HEADER): - fh->Seek((long)(64 - sizeof(BITMAPINFOHEADER)),SEEK_CUR); - break; - - case sizeof(BITMAPCOREHEADER): - bc = *(BITMAPCOREHEADER*)pdib; - pdib->biSize = bc.bcSize; - pdib->biWidth = (DWORD)bc.bcWidth; - pdib->biHeight = (DWORD)bc.bcHeight; - pdib->biPlanes = bc.bcPlanes; - pdib->biBitCount = bc.bcBitCount; - pdib->biCompression = BI_RGB; - pdib->biSizeImage = 0; - pdib->biXPelsPerMeter = 0; - pdib->biYPelsPerMeter = 0; - pdib->biClrUsed = 0; - pdib->biClrImportant = 0; - - fh->Seek((long)(sizeof(BITMAPCOREHEADER)-sizeof(BITMAPINFOHEADER)), SEEK_CUR); - - break; - default: - //give a last chance - if (pdib->biSize>(sizeof(BITMAPINFOHEADER))&& - (pdib->biSizeImage==(unsigned long)(pdib->biHeight*((((pdib->biBitCount*pdib->biWidth)+31)/32)*4)))&& - (pdib->biPlanes==1)&&(pdib->biCompression==BI_RGB)&&(pdib->biClrUsed==0)) - { - fh->Seek((long)(pdib->biSize - sizeof(BITMAPINFOHEADER)),SEEK_CUR); - break; - } - return false; - } - - FixBitmapInfo(pdib); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_DECODE -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_BMP -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/win32/dependencies/cximage/ximabmp.h b/src/win32/dependencies/cximage/ximabmp.h deleted file mode 100644 index 2bda4feb..00000000 --- a/src/win32/dependencies/cximage/ximabmp.h +++ /dev/null @@ -1,79 +0,0 @@ -/* - * File: ximabmp.h - * Purpose: BMP Image Class Loader and Writer - */ -/* ========================================================== - * CxImageBMP (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes - * - * original CImageBMP and CImageIterator implementation are: - * Copyright: (c) 1995, Alejandro Aguilar Sierra - * - * ========================================================== - */ - -#if !defined(__ximaBMP_h) -#define __ximaBMP_h - -#include "ximage.h" - -const int RLE_COMMAND = 0; -const int RLE_ENDOFLINE = 0; -const int RLE_ENDOFBITMAP = 1; -const int RLE_DELTA = 2; - -#if !defined(BI_RLE8) - #define BI_RLE8 1L -#endif -#if !defined(BI_RLE4) - #define BI_RLE4 2L -#endif - -#if CXIMAGE_SUPPORT_BMP - -class CxImageBMP: public CxImage -{ -public: - CxImageBMP(): CxImage(CXIMAGE_FORMAT_BMP) {}; - - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE - -protected: - bool DibReadBitmapInfo(CxFile* fh, BITMAPINFOHEADER *pdib); -}; - -#define BFT_ICON 0x4349 /* 'IC' */ -#define BFT_BITMAP 0x4d42 /* 'BM' */ -#define BFT_CURSOR 0x5450 /* 'PT' */ - -#ifndef WIDTHBYTES -#define WIDTHBYTES(i) ((unsigned)((i+31)&(~31))/8) /* ULONG aligned ! */ -#endif - -#endif - -#define DibWidthBytesN(lpbi, n) (UINT)WIDTHBYTES((UINT)(lpbi)->biWidth * (UINT)(n)) -#define DibWidthBytes(lpbi) DibWidthBytesN(lpbi, (lpbi)->biBitCount) - -#define DibSizeImage(lpbi) ((lpbi)->biSizeImage == 0 \ - ? ((DWORD)(UINT)DibWidthBytes(lpbi) * (DWORD)(UINT)(lpbi)->biHeight) \ - : (lpbi)->biSizeImage) - -#define DibNumColors(lpbi) ((lpbi)->biClrUsed == 0 && (lpbi)->biBitCount <= 8 \ - ? (int)(1 << (int)(lpbi)->biBitCount) \ - : (int)(lpbi)->biClrUsed) - -#define FixBitmapInfo(lpbi) if ((lpbi)->biSizeImage == 0) \ - (lpbi)->biSizeImage = DibSizeImage(lpbi); \ - if ((lpbi)->biClrUsed == 0) \ - (lpbi)->biClrUsed = DibNumColors(lpbi); \ - -#endif diff --git a/src/win32/dependencies/cximage/ximacfg.h b/src/win32/dependencies/cximage/ximacfg.h deleted file mode 100644 index a28b35ed..00000000 --- a/src/win32/dependencies/cximage/ximacfg.h +++ /dev/null @@ -1,52 +0,0 @@ -#if !defined(__ximaCFG_h) -#define __ximaCFG_h - -///////////////////////////////////////////////////////////////////////////// -// CxImage supported features -#define CXIMAGE_SUPPORT_ALPHA 1 -#define CXIMAGE_SUPPORT_SELECTION 1 -#define CXIMAGE_SUPPORT_TRANSFORMATION 1 -#define CXIMAGE_SUPPORT_DSP 1 -#define CXIMAGE_SUPPORT_LAYERS 1 -#define CXIMAGE_SUPPORT_INTERPOLATION 1 - -#define CXIMAGE_SUPPORT_DECODE 1 -#define CXIMAGE_SUPPORT_ENCODE 1 // -#define CXIMAGE_SUPPORT_WINDOWS 1 -#define CXIMAGE_SUPPORT_WINCE 0 // - -///////////////////////////////////////////////////////////////////////////// -// CxImage supported formats -#define CXIMAGE_SUPPORT_BMP 1 -#define CXIMAGE_SUPPORT_GIF 1 -#define CXIMAGE_SUPPORT_JPG 0 -#define CXIMAGE_SUPPORT_PNG 0 -#define CXIMAGE_SUPPORT_MNG 0 -#define CXIMAGE_SUPPORT_ICO 1 -#define CXIMAGE_SUPPORT_TIF 0 -#define CXIMAGE_SUPPORT_TGA 1 -#define CXIMAGE_SUPPORT_PCX 1 -#define CXIMAGE_SUPPORT_WBMP 1 -#define CXIMAGE_SUPPORT_WMF 1 -#define CXIMAGE_SUPPORT_J2K 0 // Beta, use JP2 -#define CXIMAGE_SUPPORT_JBG 0 // GPL'd see ../jbig/copying.txt & ../jbig/patents.htm - -#define CXIMAGE_SUPPORT_JP2 0 -#define CXIMAGE_SUPPORT_JPC 0 -#define CXIMAGE_SUPPORT_PGX 0 -#define CXIMAGE_SUPPORT_PNM 0 -#define CXIMAGE_SUPPORT_RAS 0 - - -///////////////////////////////////////////////////////////////////////////// -#define CXIMAGE_MAX_MEMORY 256000000 - -#define CXIMAGE_ERR_NOFILE "null file handler" -#define CXIMAGE_ERR_NOIMAGE "null image!!!" - -///////////////////////////////////////////////////////////////////////////// -//color to grey mapping -//#define RGB2GRAY(r,g,b) (((b)*114 + (g)*587 + (r)*299)/1000) -#define RGB2GRAY(r,g,b) (((b)*117 + (g)*601 + (r)*306) >> 10) - -#endif diff --git a/src/win32/dependencies/cximage/ximadef.h b/src/win32/dependencies/cximage/ximadef.h deleted file mode 100644 index 6f3d10db..00000000 --- a/src/win32/dependencies/cximage/ximadef.h +++ /dev/null @@ -1,197 +0,0 @@ -#if !defined(__ximadefs_h) -#define __ximadefs_h - -#include "ximacfg.h" - -#if defined(_AFXDLL)||defined(_USRDLL) - #define DLL_EXP __declspec(dllexport) -#elif defined(_MSC_VER)&&(_MSC_VER<1200) - #define DLL_EXP __declspec(dllimport) -#else - #define DLL_EXP -#endif - -#if CXIMAGE_SUPPORT_JP2 || CXIMAGE_SUPPORT_JPC || CXIMAGE_SUPPORT_PGX || CXIMAGE_SUPPORT_PNM || CXIMAGE_SUPPORT_RAS - #define CXIMAGE_SUPPORT_JASPER 1 -#else - #define CXIMAGE_SUPPORT_JASPER 0 -#endif - -#if CXIMAGE_SUPPORT_DSP -#undef CXIMAGE_SUPPORT_TRANSFORMATION - #define CXIMAGE_SUPPORT_TRANSFORMATION 1 -#endif - -#if CXIMAGE_SUPPORT_TRANSFORMATION || CXIMAGE_SUPPORT_TIF || CXIMAGE_SUPPORT_TGA || CXIMAGE_SUPPORT_BMP || CXIMAGE_SUPPORT_WINDOWS - #define CXIMAGE_SUPPORT_BASICTRANSFORMATIONS 1 -#endif - -#if CXIMAGE_SUPPORT_DSP || CXIMAGE_SUPPORT_TRANSFORMATION -#undef CXIMAGE_SUPPORT_INTERPOLATION - #define CXIMAGE_SUPPORT_INTERPOLATION 1 -#endif - -#if CXIMAGE_SUPPORT_WINCE - #undef CXIMAGE_SUPPORT_WMF - #define CXIMAGE_SUPPORT_WMF 0 - #undef CXIMAGE_SUPPORT_WINDOWS - #define CXIMAGE_SUPPORT_WINDOWS 0 -#endif - -#ifndef WIN32 - #undef CXIMAGE_SUPPORT_WINDOWS - #define CXIMAGE_SUPPORT_WINDOWS 0 -#endif - -#ifndef min -#define min(a,b) (((a)<(b))?(a):(b)) -#endif -#ifndef max -#define max(a,b) (((a)>(b))?(a):(b)) -#endif - -#ifndef PI - #define PI 3.141592653589793f -#endif - - -#ifdef WIN32 -#include -#include -#endif - -#include -#include - - -#ifdef __BORLANDC__ - -#ifndef _COMPLEX_DEFINED - -typedef struct tagcomplex { - double x,y; -} _complex; - -#endif - -#define _cabs(c) sqrt(c.x*c.x+c.y*c.y) - -#endif - - -#ifndef WIN32 - -#include -#include -#include - -typedef unsigned char BYTE; -typedef unsigned short WORD; -typedef unsigned long DWORD; -typedef unsigned int UINT; - -typedef DWORD COLORREF; -typedef unsigned int HANDLE; -typedef void* HRGN; - -#ifndef BOOL -#define BOOL bool -#endif - -#ifndef TRUE -#define TRUE true -#endif - -#ifndef FALSE -#define FALSE false -#endif - -#ifndef TCHAR -#define TCHAR char -#define _T -#endif - -typedef struct tagRECT -{ - long left; - long top; - long right; - long bottom; -} RECT; - -typedef struct tagPOINT -{ - long x; - long y; -} POINT; - -typedef struct tagRGBQUAD { - BYTE rgbBlue; - BYTE rgbGreen; - BYTE rgbRed; - BYTE rgbReserved; -} RGBQUAD; - -#pragma pack(1) - -typedef struct tagBITMAPINFOHEADER{ - DWORD biSize; - long biWidth; - long biHeight; - WORD biPlanes; - WORD biBitCount; - DWORD biCompression; - DWORD biSizeImage; - long biXPelsPerMeter; - long biYPelsPerMeter; - DWORD biClrUsed; - DWORD biClrImportant; -} BITMAPINFOHEADER; - -typedef struct tagBITMAPFILEHEADER { - WORD bfType; - DWORD bfSize; - WORD bfReserved1; - WORD bfReserved2; - DWORD bfOffBits; -} BITMAPFILEHEADER; - -typedef struct tagBITMAPCOREHEADER { - DWORD bcSize; - WORD bcWidth; - WORD bcHeight; - WORD bcPlanes; - WORD bcBitCount; -} BITMAPCOREHEADER; - -typedef struct tagRGBTRIPLE { - BYTE rgbtBlue; - BYTE rgbtGreen; - BYTE rgbtRed; -} RGBTRIPLE; - -#pragma pack() - -#define BI_RGB 0L -#define BI_RLE8 1L -#define BI_RLE4 2L -#define BI_BITFIELDS 3L - -#define GetRValue(rgb) ((BYTE)(rgb)) -#define GetGValue(rgb) ((BYTE)(((WORD)(rgb)) >> 8)) -#define GetBValue(rgb) ((BYTE)((rgb)>>16)) -#define RGB(r,g,b) ((COLORREF)(((BYTE)(r)|((WORD)((BYTE)(g))<<8))|(((DWORD)(BYTE)(b))<<16))) - -#ifndef _COMPLEX_DEFINED - -typedef struct tagcomplex { - double x,y; -} _complex; - -#endif - -#define _cabs(c) sqrt(c.x*c.x+c.y*c.y) - -#endif - -#endif //__ximadefs diff --git a/src/win32/dependencies/cximage/ximadsp.cpp b/src/win32/dependencies/cximage/ximadsp.cpp deleted file mode 100644 index d6a2ef56..00000000 --- a/src/win32/dependencies/cximage/ximadsp.cpp +++ /dev/null @@ -1,2370 +0,0 @@ -// xImaDsp.cpp : DSP functions -/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -#include "ximaiter.h" - -#if CXIMAGE_SUPPORT_DSP - -//////////////////////////////////////////////////////////////////////////////// -/** - * Converts the image to B&W. - * The Mean() function can be used for calculating the optimal threshold. - * \param level: the lightness threshold. - * \return true if everything is ok - */ -bool CxImage::Threshold(BYTE level) -{ - if (!pDib) return false; - if (head.biBitCount == 1) return true; - - GrayScale(); - - CxImage tmp(head.biWidth,head.biHeight,1); - if (!tmp.IsValid()) return false; - - for (long y=0;ylevel) - tmp.SetPixelIndex(x,y,1); - else - tmp.SetPixelIndex(x,y,0); - } - } - tmp.SetPaletteColor(0,0,0,0); - tmp.SetPaletteColor(1,255,255,255); - Transfer(tmp); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Extract RGB channels from the image. Each channel is an 8 bit grayscale image. - * \param r,g,b: pointers to CxImage objects, to store the splited channels - * \return true if everything is ok - */ -bool CxImage::SplitRGB(CxImage* r,CxImage* g,CxImage* b) -{ - if (!pDib) return false; - if (r==NULL && g==NULL && b==NULL) return false; - - CxImage tmpr(head.biWidth,head.biHeight,8); - CxImage tmpg(head.biWidth,head.biHeight,8); - CxImage tmpb(head.biWidth,head.biHeight,8); - - RGBQUAD color; - for(long y=0; yTransfer(tmpr); - if (g) g->Transfer(tmpg); - if (b) b->Transfer(tmpb); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Extract CMYK channels from the image. Each channel is an 8 bit grayscale image. - * \param c,m,y,k: pointers to CxImage objects, to store the splited channels - * \return true if everything is ok - */ -bool CxImage::SplitCMYK(CxImage* c,CxImage* m,CxImage* y,CxImage* k) -{ - if (!pDib) return false; - if (c==NULL && m==NULL && y==NULL && k==NULL) return false; - - CxImage tmpc(head.biWidth,head.biHeight,8); - CxImage tmpm(head.biWidth,head.biHeight,8); - CxImage tmpy(head.biWidth,head.biHeight,8); - CxImage tmpk(head.biWidth,head.biHeight,8); - - RGBQUAD color; - for(long yy=0; yyTransfer(tmpc); - if (m) m->Transfer(tmpm); - if (y) y->Transfer(tmpy); - if (k) k->Transfer(tmpk); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Extract YUV channels from the image. Each channel is an 8 bit grayscale image. - * \param y,u,v: pointers to CxImage objects, to store the splited channels - * \return true if everything is ok - */ -bool CxImage::SplitYUV(CxImage* y,CxImage* u,CxImage* v) -{ - if (!pDib) return false; - if (y==NULL && u==NULL && v==NULL) return false; - - CxImage tmpy(head.biWidth,head.biHeight,8); - CxImage tmpu(head.biWidth,head.biHeight,8); - CxImage tmpv(head.biWidth,head.biHeight,8); - - RGBQUAD color; - for(long yy=0; yyTransfer(tmpy); - if (u) u->Transfer(tmpu); - if (v) v->Transfer(tmpv); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Extract YIQ channels from the image. Each channel is an 8 bit grayscale image. - * \param y,i,q: pointers to CxImage objects, to store the splited channels - * \return true if everything is ok - */ -bool CxImage::SplitYIQ(CxImage* y,CxImage* i,CxImage* q) -{ - if (!pDib) return false; - if (y==NULL && i==NULL && q==NULL) return false; - - CxImage tmpy(head.biWidth,head.biHeight,8); - CxImage tmpi(head.biWidth,head.biHeight,8); - CxImage tmpq(head.biWidth,head.biHeight,8); - - RGBQUAD color; - for(long yy=0; yyTransfer(tmpy); - if (i) i->Transfer(tmpi); - if (q) q->Transfer(tmpq); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Extract XYZ channels from the image. Each channel is an 8 bit grayscale image. - * \param x,y,z: pointers to CxImage objects, to store the splited channels - * \return true if everything is ok - */ -bool CxImage::SplitXYZ(CxImage* x,CxImage* y,CxImage* z) -{ - if (!pDib) return false; - if (x==NULL && y==NULL && z==NULL) return false; - - CxImage tmpx(head.biWidth,head.biHeight,8); - CxImage tmpy(head.biWidth,head.biHeight,8); - CxImage tmpz(head.biWidth,head.biHeight,8); - - RGBQUAD color; - for(long yy=0; yyTransfer(tmpx); - if (y) y->Transfer(tmpy); - if (z) z->Transfer(tmpz); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Extract HSL channels from the image. Each channel is an 8 bit grayscale image. - * \param h,s,l: pointers to CxImage objects, to store the splited channels - * \return true if everything is ok - */ -bool CxImage::SplitHSL(CxImage* h,CxImage* s,CxImage* l) -{ - if (!pDib) return false; - if (h==NULL && s==NULL && l==NULL) return false; - - CxImage tmph(head.biWidth,head.biHeight,8); - CxImage tmps(head.biWidth,head.biHeight,8); - CxImage tmpl(head.biWidth,head.biHeight,8); - - RGBQUAD color; - for(long y=0; yTransfer(tmph); - if (s) s->Transfer(tmps); - if (l) l->Transfer(tmpl); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#define HSLMAX 255 /* H,L, and S vary over 0-HSLMAX */ -#define RGBMAX 255 /* R,G, and B vary over 0-RGBMAX */ - /* HSLMAX BEST IF DIVISIBLE BY 6 */ - /* RGBMAX, HSLMAX must each fit in a BYTE. */ -/* Hue is undefined if Saturation is 0 (grey-scale) */ -/* This value determines where the Hue scrollbar is */ -/* initially set for achromatic colors */ -#define HSLUNDEFINED (HSLMAX*2/3) -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::RGBtoHSL(RGBQUAD lRGBColor) -{ - BYTE R,G,B; /* input RGB values */ - BYTE H,L,S; /* output HSL values */ - BYTE cMax,cMin; /* max and min RGB values */ - WORD Rdelta,Gdelta,Bdelta; /* intermediate value: % of spread from max*/ - - R = lRGBColor.rgbRed; /* get R, G, and B out of DWORD */ - G = lRGBColor.rgbGreen; - B = lRGBColor.rgbBlue; - - cMax = max( max(R,G), B); /* calculate lightness */ - cMin = min( min(R,G), B); - L = (BYTE)((((cMax+cMin)*HSLMAX)+RGBMAX)/(2*RGBMAX)); - - if (cMax==cMin){ /* r=g=b --> achromatic case */ - S = 0; /* saturation */ - H = HSLUNDEFINED; /* hue */ - } else { /* chromatic case */ - if (L <= (HSLMAX/2)) /* saturation */ - S = (BYTE)((((cMax-cMin)*HSLMAX)+((cMax+cMin)/2))/(cMax+cMin)); - else - S = (BYTE)((((cMax-cMin)*HSLMAX)+((2*RGBMAX-cMax-cMin)/2))/(2*RGBMAX-cMax-cMin)); - /* hue */ - Rdelta = (WORD)((((cMax-R)*(HSLMAX/6)) + ((cMax-cMin)/2) ) / (cMax-cMin)); - Gdelta = (WORD)((((cMax-G)*(HSLMAX/6)) + ((cMax-cMin)/2) ) / (cMax-cMin)); - Bdelta = (WORD)((((cMax-B)*(HSLMAX/6)) + ((cMax-cMin)/2) ) / (cMax-cMin)); - - if (R == cMax) - H = (BYTE)(Bdelta - Gdelta); - else if (G == cMax) - H = (BYTE)((HSLMAX/3) + Rdelta - Bdelta); - else /* B == cMax */ - H = (BYTE)(((2*HSLMAX)/3) + Gdelta - Rdelta); - -// if (H < 0) H += HSLMAX; //always false - if (H > HSLMAX) H -= HSLMAX; - } - RGBQUAD hsl={L,S,H,0}; - return hsl; -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::HueToRGB(float n1,float n2, float hue) -{ - // fixed implementation for HSL2RGB routine - float rValue; - - if (hue > 360) - hue = hue - 360; - else if (hue < 0) - hue = hue + 360; - - if (hue < 60) - rValue = n1 + (n2-n1)*hue/60.0f; - else if (hue < 180) - rValue = n2; - else if (hue < 240) - rValue = n1+(n2-n1)*(240-hue)/60; - else - rValue = n1; - - return rValue; -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::HSLtoRGB(COLORREF cHSLColor) -{ - return HSLtoRGB(RGBtoRGBQUAD(cHSLColor)); -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::HSLtoRGB(RGBQUAD lHSLColor) -{ - // fixed implementation for HSL2RGB routine - float h,s,l; - float m1,m2; - BYTE r,g,b; - - h = (float)lHSLColor.rgbRed * 360.0f/255.0f; - s = (float)lHSLColor.rgbGreen/255.0f; - l = (float)lHSLColor.rgbBlue/255.0f; - - if (l <= 0.5) m2 = l * (1+s); - else m2 = l + s - l*s; - - m1 = 2 * l - m2; - - if (s == 0) { - r=g=b=(BYTE)(l*255.0f); - } else { - r = (BYTE)(HueToRGB(m1,m2,h+120) * 255.0f); - g = (BYTE)(HueToRGB(m1,m2,h) * 255.0f); - b = (BYTE)(HueToRGB(m1,m2,h-120) * 255.0f); - } - - RGBQUAD rgb = {b,g,r,0}; - return rgb; -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::YUVtoRGB(RGBQUAD lYUVColor) -{ - int U,V,R,G,B; - float Y = lYUVColor.rgbRed; - U = lYUVColor.rgbGreen - 128; - V = lYUVColor.rgbBlue - 128; - -// R = (int)(1.164 * Y + 2.018 * U); -// G = (int)(1.164 * Y - 0.813 * V - 0.391 * U); -// B = (int)(1.164 * Y + 1.596 * V); - R = (int)( Y + 1.403f * V); - G = (int)( Y - 0.344f * U - 0.714f * V); - B = (int)( Y + 1.770f * U); - - R= min(255,max(0,R)); - G= min(255,max(0,G)); - B= min(255,max(0,B)); - RGBQUAD rgb={(BYTE)B,(BYTE)G,(BYTE)R,0}; - return rgb; -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::RGBtoYUV(RGBQUAD lRGBColor) -{ - int Y,U,V,R,G,B; - R = lRGBColor.rgbRed; - G = lRGBColor.rgbGreen; - B = lRGBColor.rgbBlue; - -// Y = (int)( 0.257 * R + 0.504 * G + 0.098 * B); -// U = (int)( 0.439 * R - 0.368 * G - 0.071 * B + 128); -// V = (int)(-0.148 * R - 0.291 * G + 0.439 * B + 128); - Y = (int)(0.299f * R + 0.587f * G + 0.114f * B); - U = (int)((B-Y) * 0.565f + 128); - V = (int)((R-Y) * 0.713f + 128); - - Y= min(255,max(0,Y)); - U= min(255,max(0,U)); - V= min(255,max(0,V)); - RGBQUAD yuv={(BYTE)V,(BYTE)U,(BYTE)Y,0}; - return yuv; -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::YIQtoRGB(RGBQUAD lYIQColor) -{ - int I,Q,R,G,B; - float Y = lYIQColor.rgbRed; - I = lYIQColor.rgbGreen - 128; - Q = lYIQColor.rgbBlue - 128; - - R = (int)( Y + 0.956f * I + 0.621f * Q); - G = (int)( Y - 0.273f * I - 0.647f * Q); - B = (int)( Y - 1.104f * I + 1.701f * Q); - - R= min(255,max(0,R)); - G= min(255,max(0,G)); - B= min(255,max(0,B)); - RGBQUAD rgb={(BYTE)B,(BYTE)G,(BYTE)R,0}; - return rgb; -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::RGBtoYIQ(RGBQUAD lRGBColor) -{ - int Y,I,Q,R,G,B; - R = lRGBColor.rgbRed; - G = lRGBColor.rgbGreen; - B = lRGBColor.rgbBlue; - - Y = (int)( 0.2992f * R + 0.5868f * G + 0.1140f * B); - I = (int)( 0.5960f * R - 0.2742f * G - 0.3219f * B + 128); - Q = (int)( 0.2109f * R - 0.5229f * G + 0.3120f * B + 128); - - Y= min(255,max(0,Y)); - I= min(255,max(0,I)); - Q= min(255,max(0,Q)); - RGBQUAD yiq={(BYTE)Q,(BYTE)I,(BYTE)Y,0}; - return yiq; -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::XYZtoRGB(RGBQUAD lXYZColor) -{ - int X,Y,Z,R,G,B; - X = lXYZColor.rgbRed; - Y = lXYZColor.rgbGreen; - Z = lXYZColor.rgbBlue; - double k=1.088751; - - R = (int)( 3.240479f * X - 1.537150f * Y - 0.498535f * Z * k); - G = (int)( -0.969256f * X + 1.875992f * Y + 0.041556f * Z * k); - B = (int)( 0.055648f * X - 0.204043f * Y + 1.057311f * Z * k); - - R= min(255,max(0,R)); - G= min(255,max(0,G)); - B= min(255,max(0,B)); - RGBQUAD rgb={(BYTE)B,(BYTE)G,(BYTE)R,0}; - return rgb; -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::RGBtoXYZ(RGBQUAD lRGBColor) -{ - int X,Y,Z,R,G,B; - R = lRGBColor.rgbRed; - G = lRGBColor.rgbGreen; - B = lRGBColor.rgbBlue; - - X = (int)( 0.412453f * R + 0.357580f * G + 0.180423f * B); - Y = (int)( 0.212671f * R + 0.715160f * G + 0.072169f * B); - Z = (int)((0.019334f * R + 0.119193f * G + 0.950227f * B)*0.918483657f); - - //X= min(255,max(0,X)); - //Y= min(255,max(0,Y)); - //Z= min(255,max(0,Z)); - RGBQUAD xyz={(BYTE)Z,(BYTE)Y,(BYTE)X,0}; - return xyz; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Generates a "rainbow" palette with saturated colors - * \param correction: 1 generates a single hue spectrum. 0.75 is nice for scientific applications. - */ -void CxImage::HuePalette(float correction) -{ - if (head.biClrUsed==0) return; - - for(DWORD j=0; j 1.0f) blend = 1.0f; - int a0 = (int)(256*blend); - int a1 = 256 - a0; - - bool bFullBlend = false; - if (blend > 0.999f) bFullBlend = true; - - RGBQUAD color,hsl; - if (head.biClrUsed==0){ - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - - for(long y=ymin; y>8); - color.rgbBlue = (BYTE)((hsl.rgbBlue * a0 + color.rgbBlue * a1)>>8); - color.rgbGreen = (BYTE)((hsl.rgbGreen * a0 + color.rgbGreen * a1)>>8); - SetPixelColor(x,y,color); - } - } - } - } - } else { - for(DWORD j=0; j - for (int i=0;i<256;i++) { - cTable[i] = (BYTE)max(0,min(255,(int)((i-128)*c + brightness))); - } - - return Lut(cTable); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \return mean lightness of the image. Useful with Threshold() and Light() - */ -float CxImage::Mean() -{ - if (!pDib) return 0; - - CxImage tmp(*this,true); - if (!tmp.IsValid()) return false; - - tmp.GrayScale(); - float sum=0; - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - if (xmin==xmax || ymin==ymax) return (float)0.0; - - BYTE *iSrc=tmp.info.pImage; - iSrc += tmp.info.dwEffWidth*ymin; // necessary for selections - - for(long y=ymin; y - for(long x=xmin; x 0 && (y+kmax-1) < head.biHeight && x-k2 > 0 && (x+kmax-1) < head.biWidth) - { - b=0; - iCount = 0; - iY2 = ((y-k2)*info.dwEffWidth); - for(long j=-k2;j r) r=c.rgbRed; - if (c.rgbGreen > g) g=c.rgbGreen; - if (c.rgbBlue > b) b=c.rgbBlue; - } - } - c.rgbRed = r; - c.rgbGreen = g; - c.rgbBlue = b; - tmp.SetPixelColor(x,y,c); - } - } - } - Transfer(tmp); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Enhance the variations between adjacent pixels. - * Similar results can be achieved using Filter(), - * but the algorithms are different both in Edge() and in Contour(). - * \param Ksize: size of the kernel. - * \return true if everything is ok - */ -bool CxImage::Edge(long Ksize) -{ - if (!pDib) return false; - - long k2 = Ksize/2; - long kmax= Ksize-k2; - BYTE r,g,b,rr,gg,bb; - RGBQUAD c; - - CxImage tmp(*this,pSelection!=0,true,true); - if (!tmp.IsValid()) return false; - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - - for(long y=ymin; y r) r=c.rgbRed; - if (c.rgbGreen > g) g=c.rgbGreen; - if (c.rgbBlue > b) b=c.rgbBlue; - - if (c.rgbRed < rr) rr=c.rgbRed; - if (c.rgbGreen < gg) gg=c.rgbGreen; - if (c.rgbBlue < bb) bb=c.rgbBlue; - } - } - c.rgbRed = 255-abs(r-rr); - c.rgbGreen = 255-abs(g-gg); - c.rgbBlue = 255-abs(b-bb); - tmp.SetPixelColor(x,y,c); - } - } - } - Transfer(tmp); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Blends two images - * \param imgsrc2: image to be mixed with this - * \param op: blending method; see ImageOpType - * \param lXOffset, lYOffset: image displacement - * \param bMixAlpha: if true and imgsrc2 has a valid alpha layer, it will be mixed in the destination image. - * \return true if everything is ok - * - * thanks to Mwolski - */ -// -void CxImage::Mix(CxImage & imgsrc2, ImageOpType op, long lXOffset, long lYOffset, bool bMixAlpha) -{ - long lWide = min(GetWidth(),imgsrc2.GetWidth()-lXOffset); - long lHeight = min(GetHeight(),imgsrc2.GetHeight()-lYOffset); - - bool bEditAlpha = imgsrc2.AlphaIsValid() & bMixAlpha; - - if (bEditAlpha && AlphaIsValid()==false){ - AlphaCreate(); - } - - RGBQUAD rgbBackgrnd = GetTransColor(); - RGBQUAD rgb1, rgb2, rgbDest; - - for(long lY=0;lY>8); - } else { - a=255; - } - - if (a==0){ //transparent - rgbDest = rgb1; - } else if (a==255){ //opaque - rgbDest = rgb2; - } else { //blend - a1 = (BYTE)~a; - rgbDest.rgbBlue = (BYTE)((rgb1.rgbBlue*a1+rgb2.rgbBlue*a)>>8); - rgbDest.rgbGreen = (BYTE)((rgb1.rgbGreen*a1+rgb2.rgbGreen*a)>>8); - rgbDest.rgbRed = (BYTE)((rgb1.rgbRed*a1+rgb2.rgbRed*a)>>8); - } - - if (bEditAlpha) rgbDest.rgbReserved = (BYTE)(((1+rgb1.rgbReserved)*a)>>8); - } - break; - case OpSrcBlend: - if(memcmp(&rgb1,&rgbBackgrnd,sizeof(RGBQUAD))==0) - rgbDest = rgb2; - else - { - long lBDiff = abs(rgb1.rgbBlue - rgbBackgrnd.rgbBlue); - long lGDiff = abs(rgb1.rgbGreen - rgbBackgrnd.rgbGreen); - long lRDiff = abs(rgb1.rgbRed - rgbBackgrnd.rgbRed); - - double lAverage = (lBDiff+lGDiff+lRDiff)/3; - double lThresh = 16; - double dLarge = lAverage/lThresh; - double dSmall = (lThresh-lAverage)/lThresh; - double dSmallAmt = dSmall*((double)rgb2.rgbBlue); - - if( lAverage < lThresh+1){ - rgbDest.rgbBlue = (BYTE)max(0,min(255,(int)(dLarge*((double)rgb1.rgbBlue) + - dSmallAmt))); - rgbDest.rgbGreen = (BYTE)max(0,min(255,(int)(dLarge*((double)rgb1.rgbGreen) + - dSmallAmt))); - rgbDest.rgbRed = (BYTE)max(0,min(255,(int)(dLarge*((double)rgb1.rgbRed) + - dSmallAmt))); - } - else - rgbDest = rgb1; - } - break; - default: - return; - } - SetPixelColor(lX,lY,rgbDest,bEditAlpha); - } - } - } -} -//////////////////////////////////////////////////////////////////////////////// -// thanks to Kenneth Ballard -void CxImage::MixFrom(CxImage & imagesrc2, long lXOffset, long lYOffset) -{ - RGBQUAD rgbBackgrnd = imagesrc2.GetTransColor(); - RGBQUAD rgb1; - - long width = imagesrc2.GetWidth(); - long height = imagesrc2.GetHeight(); - - int x, y; - - for(x = 0; x < width; x++) - { - for(y = 0; y < height; y++) - { - rgb1 = imagesrc2.GetPixelColor(x, y); - if(memcmp(&rgb1, &rgbBackgrnd, sizeof(RGBQUAD)) != 0) - SetPixelColor(x + lXOffset, y + lYOffset, rgb1); - } - } -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Adjusts separately the red, green, and blue values in the image. - * \param r, g, b: can be from -255 to +255. - * \return true if everything is ok - */ -bool CxImage::ShiftRGB(long r, long g, long b) -{ - if (!pDib) return false; - RGBQUAD color; - if (head.biClrUsed==0){ - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - - for(long y=ymin; y - for (int i=0;i<256;i++) { - cTable[i] = (BYTE)max(0,min(255,(int)( pow((double)i, dinvgamma) / dMax))); - } - - return Lut(cTable); -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_WINCE == 0 -/** - * Adjusts the intensity of each pixel to the median intensity of its surrounding pixels. - * \param Ksize: size of the kernel. - * \return true if everything is ok - */ -bool CxImage::Median(long Ksize) -{ - if (!pDib) return false; - - long k2 = Ksize/2; - long kmax= Ksize-k2; - long i,j,k; - - RGBQUAD* kernel = (RGBQUAD*)malloc(Ksize*Ksize*sizeof(RGBQUAD)); - - CxImage tmp(*this,pSelection!=0,true,true); - if (!tmp.IsValid()) return false; - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - - for(long y=ymin; y - for(long x=xmin; xGetWidth(); - h=srcReal->GetHeight(); - } else { - w=srcImag->GetWidth(); - h=srcImag->GetHeight(); - } - - bool bXpow2 = IsPowerof2(w); - bool bYpow2 = IsPowerof2(h); - //if bForceFFT, width AND height must be powers of 2 - if (bForceFFT && !(bXpow2 && bYpow2)) { - long i; - - i=0; - while((1< copy the image - if (srcReal && dstReal) tmpReal->Copy(*srcReal,true,false,false); - if (srcImag && dstImag) tmpImag->Copy(*srcImag,true,false,false); - - // dst&&src are empty -> create new one, else turn to GrayScale - if (srcReal==0 && dstReal==0){ - tmpReal = new CxImage(w,h,8); - tmpReal->Clear(0); - tmpReal->SetGrayPalette(); - } else { - if (!tmpReal->IsGrayScale()) tmpReal->GrayScale(); - } - if (srcImag==0 && dstImag==0){ - tmpImag = new CxImage(w,h,8); - tmpImag->Clear(0); - tmpImag->SetGrayPalette(); - } else { - if (!tmpImag->IsGrayScale()) tmpImag->GrayScale(); - } - - if (!(tmpReal->IsValid() && tmpImag->IsValid())){ - if (srcReal==0 && dstReal==0) delete tmpReal; - if (srcImag==0 && dstImag==0) delete tmpImag; - return false; - } - - //resample for FFT, if necessary - tmpReal->Resample(w,h,0); - tmpImag->Resample(w,h,0); - - //ok, here we have 2 (w x h), grayscale images ready for a FFT - - double* real; - double* imag; - long j,k,m; - - _complex **grid; - //double mean = tmpReal->Mean(); - /* Allocate memory for the grid */ - grid = (_complex **)malloc(w * sizeof(_complex)); - for (k=0;kGetPixelIndex(k,j)-128; - grid[k][j].y = tmpImag->GetPixelIndex(k,j)-128; - } - } - - //DFT buffers - double *real2,*imag2; - real2 = (double*)malloc(max(w,h) * sizeof(double)); - imag2 = (double*)malloc(max(w,h) * sizeof(double)); - - /* Transform the rows */ - real = (double *)malloc(w * sizeof(double)); - imag = (double *)malloc(w * sizeof(double)); - - m=0; - while((1<SetPixelIndex(k,j,(BYTE)max(0,min(255,(nn*(3+log(_cabs(grid[k][j]))))))); - if (grid[k][j].x==0){ - tmpImag->SetPixelIndex(k,j,(BYTE)max(0,min(255,(128+(atan(grid[k][j].y/0.0000000001)*nn))))); - } else { - tmpImag->SetPixelIndex(k,j,(BYTE)max(0,min(255,(128+(atan(grid[k][j].y/grid[k][j].x)*nn))))); - } - } else { - tmpReal->SetPixelIndex(k,j,(BYTE)max(0,min(255,(128 + grid[k][j].x*nn)))); - tmpImag->SetPixelIndex(k,j,(BYTE)max(0,min(255,(128 + grid[k][j].y*nn)))); - } - } - } - - for (k=0;k> 1; - j = 0; - for (i=0;i>= 1; - } - j += k; - } - - /* Compute the FFT */ - c1 = -1.0; - c2 = 0.0; - l2 = 1; - for (l=0;lGetWidth(); - long h = r->GetHeight(); - - Create(w,h,24); - - g->Resample(w,h); - b->Resample(w,h); - - if (a) { - a->Resample(w,h); -#if CXIMAGE_SUPPORT_ALPHA - AlphaCreate(); -#endif //CXIMAGE_SUPPORT_ALPHA - } - - RGBQUAD c; - for (long y=0;y - for (long x=0;xGetPixelIndex(x,y); - c.rgbGreen=g->GetPixelIndex(x,y); - c.rgbBlue=b->GetPixelIndex(x,y); - switch (colorspace){ - case 1: - SetPixelColor(x,y,HSLtoRGB(c)); - break; - case 2: - SetPixelColor(x,y,YUVtoRGB(c)); - break; - case 3: - SetPixelColor(x,y,YIQtoRGB(c)); - break; - case 4: - SetPixelColor(x,y,XYZtoRGB(c)); - break; - default: - SetPixelColor(x,y,c); - } -#if CXIMAGE_SUPPORT_ALPHA - if (a) AlphaSet(x,y,a->GetPixelIndex(x,y)); -#endif //CXIMAGE_SUPPORT_ALPHA - } - } - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Smart blurring to remove small defects, dithering or artifacts. - * \param radius: normally between 0.01 and 0.5 - * \param niterations: should be trimmed with radius, to avoid blurring should be (radius*niterations)<1 - * \param colorspace: 0 = RGB, 1 = HSL, 2 = YUV, 3 = YIQ, 4 = XYZ - * \return true if everything is ok - */ -bool CxImage::Repair(float radius, long niterations, long colorspace) -{ - if (!IsValid()) return false; - - long w = GetWidth(); - long h = GetHeight(); - - CxImage r,g,b; - - r.Create(w,h,8); - g.Create(w,h,8); - b.Create(w,h,8); - - switch (colorspace){ - case 1: - SplitHSL(&r,&g,&b); - break; - case 2: - SplitYUV(&r,&g,&b); - break; - case 3: - SplitYIQ(&r,&g,&b); - break; - case 4: - SplitXYZ(&r,&g,&b); - break; - default: - SplitRGB(&r,&g,&b); - } - - for (int i=0; iGetWidth()-1; - long h = ch->GetHeight()-1; - - double correction,ix,iy,ixx,ixy,iyy,den,num; - int x,y,xy0,xp1,xm1,yp1,ym1; - for(x=1; xGetPixelIndex(x,y); - xm1 = ch->GetPixelIndex(x-1,y); - xp1 = ch->GetPixelIndex(x+1,y); - ym1 = ch->GetPixelIndex(x,y-1); - yp1 = ch->GetPixelIndex(x,y+1); - - ix= (xp1-xm1)/2.0; - iy= (yp1-ym1)/2.0; - ixx= xp1 - 2.0 * xy0 + xm1; - iyy= yp1 - 2.0 * xy0 + ym1; - ixy=(ch->GetPixelIndex(x+1,y+1)+ch->GetPixelIndex(x-1,y-1)- - ch->GetPixelIndex(x-1,y+1)-ch->GetPixelIndex(x+1,y-1))/4.0; - - num= (1.0+iy*iy)*ixx - ix*iy*ixy + (1.0+ix*ix)*iyy; - den= 1.0+ix*ix+iy*iy; - correction = num/den; - - tmp.SetPixelIndex(x,y,(BYTE)min(255,max(0,(xy0 + radius * correction)))); - } - } - - for (x=0;x<=w;x++){ - tmp.SetPixelIndex(x,0,ch->GetPixelIndex(x,0)); - tmp.SetPixelIndex(x,h,ch->GetPixelIndex(x,h)); - } - for (y=0;y<=h;y++){ - tmp.SetPixelIndex(0,y,ch->GetPixelIndex(0,y)); - tmp.SetPixelIndex(w,y,ch->GetPixelIndex(w,y)); - } - ch->Transfer(tmp); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Enhance the variations between adjacent pixels. - * Similar results can be achieved using Filter(), - * but the algorithms are different both in Edge() and in Contour(). - * \return true if everything is ok - */ -bool CxImage::Contour() -{ - if (!pDib) return false; - - long Ksize = 3; - long k2 = Ksize/2; - long kmax= Ksize-k2; - long i,j,k; - BYTE maxr,maxg,maxb; - RGBQUAD pix1,pix2; - - CxImage tmp(*this,pSelection!=0,true,true); - if (!tmp.IsValid()) return false; - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - - for(long y=ymin; ymaxb) maxb = pix2.rgbBlue; - if ((pix2.rgbGreen-pix1.rgbGreen)>maxg) maxg = pix2.rgbGreen; - if ((pix2.rgbRed-pix1.rgbRed)>maxr) maxr = pix2.rgbRed; - } - } - pix1.rgbBlue=(BYTE)(255-maxb); - pix1.rgbGreen=(BYTE)(255-maxg); - pix1.rgbRed=(BYTE)(255-maxr); - tmp.SetPixelColor(x,y,pix1); - } - } - } - Transfer(tmp); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Adds a random offset to each pixel in the image - * \param radius: maximum pixel displacement - * \return true if everything is ok - */ -bool CxImage::Jitter(long radius) -{ - if (!pDib) return false; - - long nx,ny; - - CxImage tmp(*this,pSelection!=0,true,true); - if (!tmp.IsValid()) return false; - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - - for(long y=ymin; y y) - { - for (row = 0; row < y ; row++) - { - scale=0; - /* find the scale factor */ - for (j = 0; j < y ; j++) - { - /* if the index is in bounds, add it to the scale counter */ - if ((j + cmatrix_length/2 - row >= 0) && - (j + cmatrix_length/2 - row < cmatrix_length)) - scale += cmatrix[j + cmatrix_length/2 - row]; - } - for (i = 0; i= row - cmatrix_length/2) && - (j <= row + cmatrix_length/2)) - sum += cur_col[j*bytes + i] * cmatrix[j]; - } - dest_col[row*bytes + i] = (BYTE)(0.5f + sum / scale); - } - } - } - else - { - /* for the edge condition, we only use available info and scale to one */ - for (row = 0; row < cmatrix_middle; row++) - { - /* find scale factor */ - scale=0; - for (j = cmatrix_middle - row; j0; j--) - { - sum += *(ctable_p + *cur_col_p1); - cur_col_p1 += bytes; - ctable_p += 256; - } - cur_col_p++; - *(dest_col_p++) = (BYTE)(0.5f + sum); - } - } - - /* for the edge condition , we only use available info, and scale to one */ - for (; row < y; row++) - { - /* find scale factor */ - scale=0; - for (j = 0; j< y-row + cmatrix_middle; j++) - scale += cmatrix[j]; - for (i = 0; i 255) dest_row[u*3+v] = 255; - else dest_row[u*3+v] = value; - } - } - } - - Transfer(tmp); - - return TRUE; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Apply a look up table to the image. - * \param pLut: BYTE[256] look up table - * \return true if everything is ok - */ -bool CxImage::Lut(BYTE* pLut) -{ - if (!pDib || !pLut) return false; - RGBQUAD color; - - double dbScaler; - if (head.biClrUsed==0){ - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - // faster loop for full image - BYTE *iSrc=info.pImage; - for(unsigned long i=0; i < head.biSizeImage ; i++){ - *iSrc++ = pLut[*iSrc]; - } - return true; - } - - dbScaler = 100.0/ymax; - - for(long y=ymin; y - for(long x=xmin; x - if (!pDib) return false; - FloodFill2(x,y,GetPixelColor(x,y),FillColor); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImage::FloodFill2(int x, int y, RGBQUAD old_color, RGBQUAD new_color) -{ - // Fill in the actual pixels. - // Function steps recursively until it finds borders (color that is not old_color) - if (!IsInside(x,y)) return; - - RGBQUAD r = GetPixelColor(x,y); - COLORREF cr = RGB(r.rgbRed,r.rgbGreen,r.rgbBlue); - - if(cr == RGB(old_color.rgbRed,old_color.rgbGreen,old_color.rgbBlue) - && cr != RGB(new_color.rgbRed,new_color.rgbGreen,new_color.rgbBlue) ) { - - // the above if statement, after && is there to prevent - // stack overflows. The program will continue to find - // colors if you flood-fill an entire region (entire picture) - - SetPixelColor(x,y,new_color); - - FloodFill2((x+1),y,old_color,new_color); - FloodFill2((x-1),y,old_color,new_color); - FloodFill2(x,(y+1),old_color,new_color); - FloodFill2(x,(y-1),old_color,new_color); - } -}*/ -/////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_DSP diff --git a/src/win32/dependencies/cximage/ximaenc.cpp b/src/win32/dependencies/cximage/ximaenc.cpp deleted file mode 100644 index da95578b..00000000 --- a/src/win32/dependencies/cximage/ximaenc.cpp +++ /dev/null @@ -1,920 +0,0 @@ -// xImaCodec.cpp : Encode Decode functions -/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_JPG -#include "ximajpg.h" -#endif - -#if CXIMAGE_SUPPORT_GIF -#include "ximagif.h" -#endif - -#if CXIMAGE_SUPPORT_PNG -#include "ximapng.h" -#endif - -#if CXIMAGE_SUPPORT_MNG -#include "ximamng.h" -#endif - -#if CXIMAGE_SUPPORT_BMP -#include "ximabmp.h" -#endif - -#if CXIMAGE_SUPPORT_ICO -#include "ximaico.h" -#endif - -#if CXIMAGE_SUPPORT_TIF -#include "ximatif.h" -#endif - -#if CXIMAGE_SUPPORT_TGA -#include "ximatga.h" -#endif - -#if CXIMAGE_SUPPORT_PCX -#include "ximapcx.h" -#endif - -#if CXIMAGE_SUPPORT_WBMP -#include "ximawbmp.h" -#endif - -#if CXIMAGE_SUPPORT_WMF -#include "ximawmf.h" // - WMF/EMF support -#endif - -#if CXIMAGE_SUPPORT_J2K -#include "ximaj2k.h" -#endif - -#if CXIMAGE_SUPPORT_JBG -#include "ximajbg.h" -#endif - -#if CXIMAGE_SUPPORT_JASPER -#include "ximajas.h" -#endif - -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::EncodeSafeCheck(CxFile *hFile) -{ - if (hFile==NULL) { - strcpy(info.szLastError,CXIMAGE_ERR_NOFILE); - return true; - } - - if (pDib==NULL){ - strcpy(info.szLastError,CXIMAGE_ERR_NOIMAGE); - return true; - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -//#ifdef WIN32 -//bool CxImage::Save(LPCWSTR filename, DWORD imagetype) -//{ -// FILE* hFile; //file handle to write the image -// if ((hFile=_wfopen(filename,L"wb"))==NULL) return false; -// bool bOK = Encode(hFile,imagetype); -// fclose(hFile); -// return bOK; -//} -//#endif //WIN32 -//////////////////////////////////////////////////////////////////////////////// -// For UNICODE support: char -> TCHAR -/** - * Saves to disk the image in a specific format. - * \param filename: file name - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - * \return true if everything is ok - */ -bool CxImage::Save(const TCHAR * filename, DWORD imagetype) -{ - FILE* hFile; //file handle to write the image - -#ifdef WIN32 - if ((hFile=_tfopen(filename,_T("wb")))==NULL) return false; // For UNICODE support -#else - if ((hFile=fopen(filename,"wb"))==NULL) return false; -#endif - - bool bOK = Encode(hFile,imagetype); - fclose(hFile); - return bOK; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Saves to disk the image in a specific format. - * \param hFile: file handle, open and enabled for writing. - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - * \return true if everything is ok - */ -bool CxImage::Encode(FILE *hFile, DWORD imagetype) -{ - CxIOFile file(hFile); - return Encode(&file,imagetype); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Saves to memory buffer the image in a specific format. - * \param buffer: output memory buffer pointer. Must be NULL, - * the function allocates and fill the memory, - * the application must free the buffer, see also FreeMemory(). - * \param size: output memory buffer size. - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - * \return true if everything is ok - */ -bool CxImage::Encode(BYTE * &buffer, long &size, DWORD imagetype) -{ - if (buffer!=NULL){ - strcpy(info.szLastError,"the buffer must be empty"); - return false; - } - CxMemFile file; - file.Open(); - if(Encode(&file,imagetype)){ - buffer=file.GetBuffer(); - size=file.Size(); - return true; - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Saves to disk the image in a specific format. - * \param hFile: file handle (implemented using CxMemFile or CxIOFile), - * open and enabled for writing. - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - * \return true if everything is ok - * \sa ENUM_CXIMAGE_FORMATS - */ -bool CxImage::Encode(CxFile *hFile, DWORD imagetype) -{ - -#if CXIMAGE_SUPPORT_BMP - - if (imagetype==CXIMAGE_FORMAT_BMP){ - CxImageBMP newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_ICO - if (imagetype==CXIMAGE_FORMAT_ICO){ - CxImageICO newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_TIF - if (imagetype==CXIMAGE_FORMAT_TIF){ - CxImageTIF newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_JPG - if (imagetype==CXIMAGE_FORMAT_JPG){ - CxImageJPG newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_GIF - if (imagetype==CXIMAGE_FORMAT_GIF){ - CxImageGIF newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_PNG - if (imagetype==CXIMAGE_FORMAT_PNG){ - CxImagePNG newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_MNG - if (imagetype==CXIMAGE_FORMAT_MNG){ - CxImageMNG newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_TGA - if (imagetype==CXIMAGE_FORMAT_TGA){ - CxImageTGA newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_PCX - if (imagetype==CXIMAGE_FORMAT_PCX){ - CxImagePCX newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_WBMP - if (imagetype==CXIMAGE_FORMAT_WBMP){ - CxImageWBMP newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_WMF && CXIMAGE_SUPPORT_WINDOWS // - WMF/EMF support - if (imagetype==CXIMAGE_FORMAT_WMF){ - CxImageWMF newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_J2K - if (imagetype==CXIMAGE_FORMAT_J2K){ - CxImageJ2K newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_JBG - if (imagetype==CXIMAGE_FORMAT_JBG){ - CxImageJBG newima; - newima.Ghost(this); - if (newima.Encode(hFile)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_JASPER - if ( - #if CXIMAGE_SUPPORT_JP2 - imagetype==CXIMAGE_FORMAT_JP2 || - #endif - #if CXIMAGE_SUPPORT_JPC - imagetype==CXIMAGE_FORMAT_JPC || - #endif - #if CXIMAGE_SUPPORT_PGX - imagetype==CXIMAGE_FORMAT_PGX || - #endif - #if CXIMAGE_SUPPORT_PNM - imagetype==CXIMAGE_FORMAT_PNM || - #endif - #if CXIMAGE_SUPPORT_RAS - imagetype==CXIMAGE_FORMAT_RAS || - #endif - false ){ - CxImageJAS newima; - newima.Ghost(this); - if (newima.Encode(hFile,imagetype)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif - - strcpy(info.szLastError,"Encode: Unknown format"); - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Saves to disk or memory pagecount images, referenced by an array of CxImage pointers. - * \param hFile: file handle. - * \param pImages: array of CxImage pointers. - * \param pagecount: number of images. - * \param imagetype: can be CXIMAGE_FORMAT_TIF or CXIMAGE_FORMAT_GIF. - * \return true if everything is ok - */ -bool CxImage::Encode(FILE * hFile, CxImage ** pImages, int pagecount, DWORD imagetype) -{ - CxIOFile file(hFile); - return Encode(&file, pImages, pagecount,imagetype); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Saves to disk or memory pagecount images, referenced by an array of CxImage pointers. - * \param hFile: file handle (implemented using CxMemFile or CxIOFile). - * \param pImages: array of CxImage pointers. - * \param pagecount: number of images. - * \param imagetype: can be CXIMAGE_FORMAT_TIF or CXIMAGE_FORMAT_GIF. - * \return true if everything is ok - */ -bool CxImage::Encode(CxFile * hFile, CxImage ** pImages, int pagecount, DWORD imagetype) -{ -#if CXIMAGE_SUPPORT_TIF - if (imagetype==CXIMAGE_FORMAT_TIF){ - CxImageTIF newima; - newima.Ghost(this); - if (newima.Encode(hFile,pImages,pagecount)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_GIF - if (imagetype==CXIMAGE_FORMAT_GIF){ - CxImageGIF newima; - newima.Ghost(this); - if (newima.Encode(hFile,pImages,pagecount)){ - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif - strcpy(info.szLastError,"Multipage Encode, Unsupported operation for this format"); - return false; -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * exports the image into a RGBA buffer, Useful for OpenGL applications. - * \param buffer: output memory buffer pointer. Must be NULL, - * the function allocates and fill the memory, - * the application must free the buffer, see also FreeMemory(). - * \param size: output memory buffer size. - * \return true if everything is ok - */ -bool CxImage::Encode2RGBA(BYTE * &buffer, long &size) -{ - if (buffer!=NULL){ - strcpy(info.szLastError,"the buffer must be empty"); - return false; - } - CxMemFile file; - file.Open(); - if(Encode2RGBA(&file)){ - buffer=file.GetBuffer(); - size=file.Size(); - return true; - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * exports the image into a RGBA buffer, Useful for OpenGL applications. - * \param hFile: file handle (implemented using CxMemFile or CxIOFile). - * \return true if everything is ok - */ -bool CxImage::Encode2RGBA(CxFile *hFile) -{ - if (EncodeSafeCheck(hFile)) return false; - - for (DWORD y = 0; yPutC(color.rgbRed); - hFile->PutC(color.rgbGreen); - hFile->PutC(color.rgbBlue); - hFile->PutC(color.rgbReserved); - } - } - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_DECODE -//////////////////////////////////////////////////////////////////////////////// -// For UNICODE support: char -> TCHAR -/** - * Reads from disk the image in a specific format. - * - If decoding fails using the specified image format, - * the function will try the automatic file format recognition. - * - * \param filename: file name - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - * \return true if everything is ok - */ -bool CxImage::Load(const TCHAR * filename, DWORD imagetype) -//bool CxImage::Load(const char * filename, DWORD imagetype) -{ - /*FILE* hFile; //file handle to read the image - if ((hFile=fopen(filename,"rb"))==NULL) return false; - bool bOK = Decode(hFile,imagetype); - fclose(hFile);*/ - - /* automatic file type recognition */ - bool bOK = false; - if ( imagetype > 0 && imagetype < CMAX_IMAGE_FORMATS ){ - FILE* hFile; //file handle to read the image - -#ifdef WIN32 - if ((hFile=_tfopen(filename,_T("rb")))==NULL) return false; // For UNICODE support -#else - if ((hFile=fopen(filename,"rb"))==NULL) return false; -#endif - - bOK = Decode(hFile,imagetype); - fclose(hFile); - if (bOK) return bOK; - } - - char szError[256]; - strcpy(szError,info.szLastError); //save the first error - - // if failed, try automatic recognition of the file... - FILE* hFile; - -#ifdef WIN32 - if ((hFile=_tfopen(filename,_T("rb")))==NULL) return false; // For UNICODE support -#else - if ((hFile=fopen(filename,"rb"))==NULL) return false; -#endif - - bOK = Decode(hFile,CXIMAGE_FORMAT_UNKNOWN); - fclose(hFile); - - if (!bOK && imagetype > 0) strcpy(info.szLastError,szError); //restore the first error - - return bOK; -} -//////////////////////////////////////////////////////////////////////////////// -#ifdef WIN32 -//bool CxImage::Load(LPCWSTR filename, DWORD imagetype) -//{ -// /*FILE* hFile; //file handle to read the image -// if ((hFile=_wfopen(filename, L"rb"))==NULL) return false; -// bool bOK = Decode(hFile,imagetype); -// fclose(hFile);*/ -// -// /* automatic file type recognition */ -// bool bOK = false; -// if ( imagetype > 0 && imagetype < CMAX_IMAGE_FORMATS ){ -// FILE* hFile; //file handle to read the image -// if ((hFile=_wfopen(filename,L"rb"))==NULL) return false; -// bOK = Decode(hFile,imagetype); -// fclose(hFile); -// if (bOK) return bOK; -// } -// -// char szError[256]; -// strcpy(szError,info.szLastError); //save the first error -// -// // if failed, try automatic recognition of the file... -// FILE* hFile; //file handle to read the image -// if ((hFile=_wfopen(filename,L"rb"))==NULL) return false; -// bOK = Decode(hFile,CXIMAGE_FORMAT_UNKNOWN); -// fclose(hFile); -// -// if (!bOK && imagetype > 0) strcpy(info.szLastError,szError); //restore the first error -// -// return bOK; -//} -//////////////////////////////////////////////////////////////////////////////// -/** - * Loads an image from the application resources. - * \param hRes: the resource handle returned by FindResource(). - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS. - * \param hModule: NULL for internal resource, or external application/DLL hinstance returned by LoadLibray. - * \return true if everything is ok - */ -bool CxImage::LoadResource(HRSRC hRes, DWORD imagetype, HMODULE hModule) -{ - DWORD rsize=SizeofResource(hModule,hRes); - HGLOBAL hMem=::LoadResource(hModule,hRes); - if (hMem){ - char* lpVoid=(char*)LockResource(hMem); - if (lpVoid){ - // FILE* fTmp=tmpfile(); doesn't work with network - /*char tmpPath[MAX_PATH] = {0}; - char tmpFile[MAX_PATH] = {0}; - GetTempPath(MAX_PATH,tmpPath); - GetTempFileName(tmpPath,"IMG",0,tmpFile); - FILE* fTmp=fopen(tmpFile,"w+b"); - if (fTmp){ - fwrite(lpVoid,rsize,1,fTmp); - fseek(fTmp,0,SEEK_SET); - bool bOK = Decode(fTmp,imagetype); - fclose(fTmp); - DeleteFile(tmpFile); - return bOK; - }*/ - - CxMemFile fTmp((BYTE*)lpVoid,rsize); - return Decode(&fTmp,imagetype); - } - } else strcpy(info.szLastError,"Unable to load resource!"); - return false; -} -#endif //WIN32 -//////////////////////////////////////////////////////////////////////////////// -/** - * Constructor from file name, see Load() - * \param filename: file name - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - */ -// -// > filename: file name -// > imagetype: specify the image format (CXIMAGE_FORMAT_BMP,...) -// For UNICODE support: char -> TCHAR -CxImage::CxImage(const TCHAR * filename, DWORD imagetype) -//CxImage::CxImage(const char * filename, DWORD imagetype) -{ - Startup(imagetype); - Load(filename,imagetype); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Constructor from file handle, see Decode() - * \param stream: file handle, with read access. - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - */ -CxImage::CxImage(FILE * stream, DWORD imagetype) -{ - Startup(imagetype); - Decode(stream,imagetype); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Constructor from CxFile object, see Decode() - * \param stream: file handle (implemented using CxMemFile or CxIOFile), with read access. - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - */ -CxImage::CxImage(CxFile * stream, DWORD imagetype) -{ - Startup(imagetype); - Decode(stream,imagetype); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Constructor from memory buffer, see Decode() - * \param buffer: memory buffer - * \param size: size of buffer - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - */ -CxImage::CxImage(BYTE * buffer, DWORD size, DWORD imagetype) -{ - Startup(imagetype); - CxMemFile stream(buffer,size); - Decode(&stream,imagetype); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Loads an image from memory buffer - * \param buffer: memory buffer - * \param size: size of buffer - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - * \return true if everything is ok - */ -bool CxImage::Decode(BYTE * buffer, DWORD size, DWORD imagetype) -{ - CxMemFile file(buffer,size); - return Decode(&file,imagetype); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Loads an image from file handle. - * \param hFile: file handle, with read access. - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - * \return true if everything is ok - */ -bool CxImage::Decode(FILE *hFile, DWORD imagetype) -{ - CxIOFile file(hFile); - return Decode(&file,imagetype); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Loads an image from CxFile object - * \param hFile: file handle (implemented using CxMemFile or CxIOFile), with read access. - * \param imagetype: file format, see ENUM_CXIMAGE_FORMATS - * \return true if everything is ok - * \sa ENUM_CXIMAGE_FORMATS - */ -bool CxImage::Decode(CxFile *hFile, DWORD imagetype) -{ - - if (imagetype==CXIMAGE_FORMAT_UNKNOWN){ - DWORD pos = hFile->Tell(); -#if CXIMAGE_SUPPORT_BMP - { CxImageBMP newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_JPG - { CxImageJPG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_ICO - { CxImageICO newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_GIF - { CxImageGIF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_PNG - { CxImagePNG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_TIF - { CxImageTIF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_MNG - { CxImageMNG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_TGA - { CxImageTGA newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_PCX - { CxImagePCX newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_WBMP - { CxImageWBMP newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_WMF && CXIMAGE_SUPPORT_WINDOWS - { CxImageWMF newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_J2K - { CxImageJ2K newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_JBG - { CxImageJBG newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif -#if CXIMAGE_SUPPORT_JASPER - { CxImageJAS newima; newima.CopyInfo(*this); if (newima.Decode(hFile)) { Transfer(newima); return true; } else hFile->Seek(pos,SEEK_SET); } -#endif - } - -#if CXIMAGE_SUPPORT_BMP - if (imagetype==CXIMAGE_FORMAT_BMP){ - CxImageBMP newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_JPG - if (imagetype==CXIMAGE_FORMAT_JPG){ - CxImageJPG newima; - newima.CopyInfo(*this); // - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_ICO - if (imagetype==CXIMAGE_FORMAT_ICO){ - CxImageICO newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - info.nNumFrames = newima.info.nNumFrames; - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_GIF - if (imagetype==CXIMAGE_FORMAT_GIF){ - CxImageGIF newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - info.nNumFrames = newima.info.nNumFrames; - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_PNG - if (imagetype==CXIMAGE_FORMAT_PNG){ - CxImagePNG newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_TIF - if (imagetype==CXIMAGE_FORMAT_TIF){ - CxImageTIF newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - info.nNumFrames = newima.info.nNumFrames; - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_MNG - if (imagetype==CXIMAGE_FORMAT_MNG){ - CxImageMNG newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - info.nNumFrames = newima.info.nNumFrames; - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_TGA - if (imagetype==CXIMAGE_FORMAT_TGA){ - CxImageTGA newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_PCX - if (imagetype==CXIMAGE_FORMAT_PCX){ - CxImagePCX newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_WBMP - if (imagetype==CXIMAGE_FORMAT_WBMP){ - CxImageWBMP newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_WMF && CXIMAGE_SUPPORT_WINDOWS // vho - WMF support - if (imagetype == CXIMAGE_FORMAT_WMF){ - CxImageWMF newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_J2K - if (imagetype==CXIMAGE_FORMAT_J2K){ - CxImageJ2K newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_JBG - if (imagetype==CXIMAGE_FORMAT_JBG){ - CxImageJBG newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif -#if CXIMAGE_SUPPORT_JASPER - if ( - #if CXIMAGE_SUPPORT_JP2 - imagetype==CXIMAGE_FORMAT_JP2 || - #endif - #if CXIMAGE_SUPPORT_JPC - imagetype==CXIMAGE_FORMAT_JPC || - #endif - #if CXIMAGE_SUPPORT_PGX - imagetype==CXIMAGE_FORMAT_PGX || - #endif - #if CXIMAGE_SUPPORT_PNM - imagetype==CXIMAGE_FORMAT_PNM || - #endif - #if CXIMAGE_SUPPORT_RAS - imagetype==CXIMAGE_FORMAT_RAS || - #endif - false ){ - CxImageJAS newima; - newima.CopyInfo(*this); - if (newima.Decode(hFile,imagetype)){ - Transfer(newima); - return true; - } else { - strcpy(info.szLastError,newima.GetLastError()); - return false; - } - } -#endif - - strcpy(info.szLastError,"Decode: Unknown or wrong format"); - return false; -} -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_DECODE -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/win32/dependencies/cximage/ximaexif.cpp b/src/win32/dependencies/cximage/ximaexif.cpp deleted file mode 100644 index 17f962a1..00000000 --- a/src/win32/dependencies/cximage/ximaexif.cpp +++ /dev/null @@ -1,873 +0,0 @@ -/* - * File: ximaexif.cpp - * Purpose: EXIF reader - * 18/Aug/2002 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - * based on jhead-1.8 by Matthias Wandel - */ - -#include "ximajpg.h" - -#if CXIMAGEJPG_SUPPORT_EXIF - -//////////////////////////////////////////////////////////////////////////////// -CxImageJPG::CxExifInfo::CxExifInfo(EXIFINFO* info) -{ - if (info) { - m_exifinfo = info; - freeinfo = false; - } else { - m_exifinfo = new EXIFINFO; - memset(m_exifinfo,0,sizeof(EXIFINFO)); - freeinfo = true; - } - - m_szLastError[0]='\0'; - ExifImageWidth = MotorolaOrder = 0; - SectionsRead=0; - memset(&Sections, 0, MAX_SECTIONS * sizeof(Section_t)); -} -//////////////////////////////////////////////////////////////////////////////// -CxImageJPG::CxExifInfo::~CxExifInfo() -{ - for(int i=0;iGetC(); - - if (a != 0xff || hFile->GetC() != M_SOI){ - return FALSE; - } - - for(;;){ - int itemlen; - int marker = 0; - int ll,lh, got; - BYTE * Data; - - if (SectionsRead >= MAX_SECTIONS){ - strcpy(m_szLastError,"Too many sections in jpg file"); - return false; - } - - for (a=0;a<7;a++){ - marker = hFile->GetC(); - if (marker != 0xff) break; - - if (a >= 6){ - printf("too many padding bytes\n"); - return false; - } - } - - if (marker == 0xff){ - // 0xff is legal padding, but if we get that many, something's wrong. - strcpy(m_szLastError,"too many padding bytes!"); - return false; - } - - Sections[SectionsRead].Type = marker; - - // Read the length of the section. - lh = hFile->GetC(); - ll = hFile->GetC(); - - itemlen = (lh << 8) | ll; - - if (itemlen < 2){ - strcpy(m_szLastError,"invalid marker"); - return false; - } - - Sections[SectionsRead].Size = itemlen; - - Data = (BYTE *)malloc(itemlen); - if (Data == NULL){ - strcpy(m_szLastError,"Could not allocate memory"); - return false; - } - Sections[SectionsRead].Data = Data; - - // Store first two pre-read bytes. - Data[0] = (BYTE)lh; - Data[1] = (BYTE)ll; - - got = hFile->Read(Data+2, 1, itemlen-2); // Read the whole section. - if (got != itemlen-2){ - strcpy(m_szLastError,"Premature end of file?"); - return false; - } - SectionsRead += 1; - - switch(marker){ - - case M_SOS: // stop before hitting compressed data - // If reading entire image is requested, read the rest of the data. - if (nReadMode & EXIF_READ_IMAGE){ - int cp, ep, size; - // Determine how much file is left. - cp = hFile->Tell(); - hFile->Seek(0, SEEK_END); - ep = hFile->Tell(); - hFile->Seek(cp, SEEK_SET); - - size = ep-cp; - Data = (BYTE *)malloc(size); - if (Data == NULL){ - strcpy(m_szLastError,"could not allocate data for entire image"); - return false; - } - - got = hFile->Read(Data, 1, size); - if (got != size){ - strcpy(m_szLastError,"could not read the rest of the image"); - return false; - } - - Sections[SectionsRead].Data = Data; - Sections[SectionsRead].Size = size; - Sections[SectionsRead].Type = PSEUDO_IMAGE_MARKER; - SectionsRead ++; - } - return true; - - case M_EOI: // in case it's a tables-only JPEG stream - printf("No image in jpeg!\n"); - return FALSE; - - case M_COM: // Comment section - if (HaveCom || ((nReadMode & EXIF_READ_EXIF) == 0)){ - // Discard this section. - free(Sections[--SectionsRead].Data); - Sections[SectionsRead].Data=0; - }else{ - process_COM(Data, itemlen); - HaveCom = TRUE; - } - break; - - case M_JFIF: - // Regular jpegs always have this tag, exif images have the exif - // marker instead, althogh ACDsee will write images with both markers. - // this program will re-create this marker on absence of exif marker. - // hence no need to keep the copy from the file. - free(Sections[--SectionsRead].Data); - Sections[SectionsRead].Data=0; - break; - - case M_EXIF: - // Seen files from some 'U-lead' software with Vivitar scanner - // that uses marker 31 for non exif stuff. Thus make sure - // it says 'Exif' in the section before treating it as exif. - if ((nReadMode & EXIF_READ_EXIF) && memcmp(Data+2, "Exif", 4) == 0){ - m_exifinfo->IsExif = process_EXIF((BYTE *)Data+2, itemlen); - }else{ - // Discard this section. - free(Sections[--SectionsRead].Data); - Sections[SectionsRead].Data=0; - } - break; - - case M_SOF0: - case M_SOF1: - case M_SOF2: - case M_SOF3: - case M_SOF5: - case M_SOF6: - case M_SOF7: - case M_SOF9: - case M_SOF10: - case M_SOF11: - case M_SOF13: - case M_SOF14: - case M_SOF15: - process_SOFn(Data, marker); - break; - default: - // Skip any other sections. - //if (ShowTags) printf("Jpeg section marker 0x%02x size %d\n",marker, itemlen); - break; - } - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/*-------------------------------------------------------------------------- - Process a EXIF marker - Describes all the drivel that most digital cameras include... ---------------------------------------------------------------------------*/ -bool CxImageJPG::CxExifInfo::process_EXIF(unsigned char * CharBuf, unsigned int length) -{ - m_exifinfo->FlashUsed = 0; - /* If it's from a digicam, and it used flash, it says so. */ - m_exifinfo->Comments[0] = '\0'; /* Initial value - null string */ - - ExifImageWidth = 0; - - { /* Check the EXIF header component */ - static const unsigned char ExifHeader[] = "Exif\0\0"; - if (memcmp(CharBuf+0, ExifHeader,6)){ - strcpy(m_szLastError,"Incorrect Exif header"); - return false; - } - } - - if (memcmp(CharBuf+6,"II",2) == 0){ - MotorolaOrder = 0; - }else{ - if (memcmp(CharBuf+6,"MM",2) == 0){ - MotorolaOrder = 1; - }else{ - strcpy(m_szLastError,"Invalid Exif alignment marker."); - return false; - } - } - - /* Check the next two values for correctness. */ - if (Get16u(CharBuf+8) != 0x2a){ - strcpy(m_szLastError,"Invalid Exif start (1)"); - return false; - } - - int FirstOffset = Get32u(CharBuf+10); - /* - if (FirstOffset < 8 || FirstOffset > 16){ - // I used to ensure this was set to 8 (website I used indicated its 8) - // but PENTAX Optio 230 has it set differently, and uses it as offset. (Sept 11 2002) - strcpy(m_szLastError,"Suspicious offset of first IFD value"); - return false; - }*/ - - unsigned char * LastExifRefd = CharBuf; - - /* First directory starts 16 bytes in. Offsets start at 8 bytes in. */ - if (!ProcessExifDir(CharBuf+14, CharBuf+6, length-6, m_exifinfo, &LastExifRefd)) - return false; - - /* give a chance for a second directory */ - if (FirstOffset > 8) { - if (!ProcessExifDir(CharBuf+14+FirstOffset-8, CharBuf+6, length-6, m_exifinfo, &LastExifRefd)) - return false; - } - - /* This is how far the interesting (non thumbnail) part of the exif went. */ - // int ExifSettingsLength = LastExifRefd - CharBuf; - - /* Compute the CCD width, in milimeters. */ - if (m_exifinfo->FocalplaneXRes != 0){ - m_exifinfo->CCDWidth = (float)(ExifImageWidth * m_exifinfo->FocalplaneUnits / m_exifinfo->FocalplaneXRes); - } - - return true; -} -//-------------------------------------------------------------------------- -// Get 16 bits motorola order (always) for jpeg header stuff. -//-------------------------------------------------------------------------- -int CxImageJPG::CxExifInfo::Get16m(void * Short) -{ - return (((unsigned char *)Short)[0] << 8) | ((unsigned char *)Short)[1]; -} -//////////////////////////////////////////////////////////////////////////////// -/*-------------------------------------------------------------------------- - Convert a 16 bit unsigned value from file's native byte order ---------------------------------------------------------------------------*/ -int CxImageJPG::CxExifInfo::Get16u(void * Short) -{ - if (MotorolaOrder){ - return (((unsigned char *)Short)[0] << 8) | ((unsigned char *)Short)[1]; - }else{ - return (((unsigned char *)Short)[1] << 8) | ((unsigned char *)Short)[0]; - } -} -//////////////////////////////////////////////////////////////////////////////// -/*-------------------------------------------------------------------------- - Convert a 32 bit signed value from file's native byte order ---------------------------------------------------------------------------*/ -long CxImageJPG::CxExifInfo::Get32s(void * Long) -{ - if (MotorolaOrder){ - return ((( char *)Long)[0] << 24) | (((unsigned char *)Long)[1] << 16) - | (((unsigned char *)Long)[2] << 8 ) | (((unsigned char *)Long)[3] << 0 ); - }else{ - return ((( char *)Long)[3] << 24) | (((unsigned char *)Long)[2] << 16) - | (((unsigned char *)Long)[1] << 8 ) | (((unsigned char *)Long)[0] << 0 ); - } -} -//////////////////////////////////////////////////////////////////////////////// -/*-------------------------------------------------------------------------- - Convert a 32 bit unsigned value from file's native byte order ---------------------------------------------------------------------------*/ -unsigned long CxImageJPG::CxExifInfo::Get32u(void * Long) -{ - return (unsigned long)Get32s(Long) & 0xffffffff; -} -//////////////////////////////////////////////////////////////////////////////// - -/* Describes format descriptor */ -static const int BytesPerFormat[] = {0,1,1,2,4,8,1,1,2,4,8,4,8}; -#define NUM_FORMATS 12 - -#define FMT_BYTE 1 -#define FMT_STRING 2 -#define FMT_USHORT 3 -#define FMT_ULONG 4 -#define FMT_URATIONAL 5 -#define FMT_SBYTE 6 -#define FMT_UNDEFINED 7 -#define FMT_SSHORT 8 -#define FMT_SLONG 9 -#define FMT_SRATIONAL 10 -#define FMT_SINGLE 11 -#define FMT_DOUBLE 12 - -/* Describes tag values */ - -#define TAG_EXIF_VERSION 0x9000 -#define TAG_EXIF_OFFSET 0x8769 -#define TAG_INTEROP_OFFSET 0xa005 - -#define TAG_MAKE 0x010F -#define TAG_MODEL 0x0110 - -#define TAG_ORIENTATION 0x0112 -#define TAG_XRESOLUTION 0x011A -#define TAG_YRESOLUTION 0x011B -#define TAG_RESOLUTIONUNIT 0x0128 - -#define TAG_EXPOSURETIME 0x829A -#define TAG_FNUMBER 0x829D - -#define TAG_SHUTTERSPEED 0x9201 -#define TAG_APERTURE 0x9202 -#define TAG_BRIGHTNESS 0x9203 -#define TAG_MAXAPERTURE 0x9205 -#define TAG_FOCALLENGTH 0x920A - -#define TAG_DATETIME_ORIGINAL 0x9003 -#define TAG_USERCOMMENT 0x9286 - -#define TAG_SUBJECT_DISTANCE 0x9206 -#define TAG_FLASH 0x9209 - -#define TAG_FOCALPLANEXRES 0xa20E -#define TAG_FOCALPLANEYRES 0xa20F -#define TAG_FOCALPLANEUNITS 0xa210 -#define TAG_EXIF_IMAGEWIDTH 0xA002 -#define TAG_EXIF_IMAGELENGTH 0xA003 - -/* the following is added 05-jan-2001 vcs */ -#define TAG_EXPOSURE_BIAS 0x9204 -#define TAG_WHITEBALANCE 0x9208 -#define TAG_METERING_MODE 0x9207 -#define TAG_EXPOSURE_PROGRAM 0x8822 -#define TAG_ISO_EQUIVALENT 0x8827 -#define TAG_COMPRESSION_LEVEL 0x9102 - -#define TAG_THUMBNAIL_OFFSET 0x0201 -#define TAG_THUMBNAIL_LENGTH 0x0202 - - -/*-------------------------------------------------------------------------- - Process one of the nested EXIF directories. ---------------------------------------------------------------------------*/ -bool CxImageJPG::CxExifInfo::ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength, - EXIFINFO * const m_exifinfo, unsigned char ** const LastExifRefdP ) -{ - int de; - int a; - int NumDirEntries; - unsigned ThumbnailOffset = 0; - unsigned ThumbnailSize = 0; - - NumDirEntries = Get16u(DirStart); - - if ((DirStart+2+NumDirEntries*12) > (OffsetBase+ExifLength)){ - strcpy(m_szLastError,"Illegally sized directory"); - return false; - } - - for (de=0;de= NUM_FORMATS) { - /* (-1) catches illegal zero case as unsigned underflows to positive large */ - strcpy(m_szLastError,"Illegal format code in EXIF dir"); - return false; - } - - ByteCount = Components * BytesPerFormat[Format]; - - if (ByteCount > 4){ - unsigned OffsetVal; - OffsetVal = Get32u(DirEntry+8); - /* If its bigger than 4 bytes, the dir entry contains an offset.*/ - if (OffsetVal+ByteCount > ExifLength){ - /* Bogus pointer offset and / or bytecount value */ - strcpy(m_szLastError,"Illegal pointer offset value in EXIF."); - return false; - } - ValuePtr = OffsetBase+OffsetVal; - }else{ - /* 4 bytes or less and value is in the dir entry itself */ - ValuePtr = DirEntry+8; - } - - if (*LastExifRefdP < ValuePtr+ByteCount){ - /* Keep track of last byte in the exif header that was - actually referenced. That way, we know where the - discardable thumbnail data begins. - */ - *LastExifRefdP = ValuePtr+ByteCount; - } - - /* Extract useful components of tag */ - switch(Tag){ - - case TAG_MAKE: - strncpy(m_exifinfo->CameraMake, (char*)ValuePtr, 31); - break; - - case TAG_MODEL: - strncpy(m_exifinfo->CameraModel, (char*)ValuePtr, 39); - break; - - case TAG_EXIF_VERSION: - strncpy(m_exifinfo->Version,(char*)ValuePtr, 4); - break; - - case TAG_DATETIME_ORIGINAL: - strncpy(m_exifinfo->DateTime, (char*)ValuePtr, 19); - break; - - case TAG_USERCOMMENT: - // Olympus has this padded with trailing spaces. Remove these first. - for (a=ByteCount;;){ - a--; - if (((char*)ValuePtr)[a] == ' '){ - ((char*)ValuePtr)[a] = '\0'; - }else{ - break; - } - if (a == 0) break; - } - - /* Copy the comment */ - if (memcmp(ValuePtr, "ASCII",5) == 0){ - for (a=5;a<10;a++){ - char c; - c = ((char*)ValuePtr)[a]; - if (c != '\0' && c != ' '){ - strncpy(m_exifinfo->Comments, (char*)ValuePtr+a, 199); - break; - } - } - - }else{ - strncpy(m_exifinfo->Comments, (char*)ValuePtr, 199); - } - break; - - case TAG_FNUMBER: - /* Simplest way of expressing aperture, so I trust it the most. - (overwrite previously computd value if there is one) - */ - m_exifinfo->ApertureFNumber = (float)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_APERTURE: - case TAG_MAXAPERTURE: - /* More relevant info always comes earlier, so only - use this field if we don't have appropriate aperture - information yet. - */ - if (m_exifinfo->ApertureFNumber == 0){ - m_exifinfo->ApertureFNumber = (float)exp(ConvertAnyFormat(ValuePtr, Format)*log(2.0f)*0.5); - } - break; - - case TAG_BRIGHTNESS: - m_exifinfo->Brightness = (float)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_FOCALLENGTH: - /* Nice digital cameras actually save the focal length - as a function of how farthey are zoomed in. - */ - - m_exifinfo->FocalLength = (float)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_SUBJECT_DISTANCE: - /* Inidcates the distacne the autofocus camera is focused to. - Tends to be less accurate as distance increases. - */ - m_exifinfo->Distance = (float)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_EXPOSURETIME: - /* Simplest way of expressing exposure time, so I - trust it most. (overwrite previously computd value - if there is one) - */ - m_exifinfo->ExposureTime = - (float)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_SHUTTERSPEED: - /* More complicated way of expressing exposure time, - so only use this value if we don't already have it - from somewhere else. - */ - if (m_exifinfo->ExposureTime == 0){ - m_exifinfo->ExposureTime = (float) - (1/exp(ConvertAnyFormat(ValuePtr, Format)*log(2.0f))); - } - break; - - case TAG_FLASH: - if ((int)ConvertAnyFormat(ValuePtr, Format) & 7){ - m_exifinfo->FlashUsed = 1; - }else{ - m_exifinfo->FlashUsed = 0; - } - break; - - case TAG_ORIENTATION: - m_exifinfo->Orientation = (int)ConvertAnyFormat(ValuePtr, Format); - if (m_exifinfo->Orientation < 1 || m_exifinfo->Orientation > 8){ - strcpy(m_szLastError,"Undefined rotation value"); - m_exifinfo->Orientation = 0; - } - break; - - case TAG_EXIF_IMAGELENGTH: - case TAG_EXIF_IMAGEWIDTH: - /* Use largest of height and width to deal with images - that have been rotated to portrait format. - */ - a = (int)ConvertAnyFormat(ValuePtr, Format); - if (ExifImageWidth < a) ExifImageWidth = a; - break; - - case TAG_FOCALPLANEXRES: - m_exifinfo->FocalplaneXRes = (float)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_FOCALPLANEYRES: - m_exifinfo->FocalplaneYRes = (float)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_RESOLUTIONUNIT: - switch((int)ConvertAnyFormat(ValuePtr, Format)){ - case 1: m_exifinfo->ResolutionUnit = 1.0f; break; /* 1 inch */ - case 2: m_exifinfo->ResolutionUnit = 1.0f; break; - case 3: m_exifinfo->ResolutionUnit = 0.3937007874f; break; /* 1 centimeter*/ - case 4: m_exifinfo->ResolutionUnit = 0.03937007874f; break; /* 1 millimeter*/ - case 5: m_exifinfo->ResolutionUnit = 0.00003937007874f; /* 1 micrometer*/ - } - break; - - case TAG_FOCALPLANEUNITS: - switch((int)ConvertAnyFormat(ValuePtr, Format)){ - case 1: m_exifinfo->FocalplaneUnits = 1.0f; break; /* 1 inch */ - case 2: m_exifinfo->FocalplaneUnits = 1.0f; break; - case 3: m_exifinfo->FocalplaneUnits = 0.3937007874f; break; /* 1 centimeter*/ - case 4: m_exifinfo->FocalplaneUnits = 0.03937007874f; break; /* 1 millimeter*/ - case 5: m_exifinfo->FocalplaneUnits = 0.00003937007874f; /* 1 micrometer*/ - } - break; - - // Remaining cases contributed by: Volker C. Schoech - - case TAG_EXPOSURE_BIAS: - m_exifinfo->ExposureBias = (float) ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_WHITEBALANCE: - m_exifinfo->Whitebalance = (int)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_METERING_MODE: - m_exifinfo->MeteringMode = (int)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_EXPOSURE_PROGRAM: - m_exifinfo->ExposureProgram = (int)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_ISO_EQUIVALENT: - m_exifinfo->ISOequivalent = (int)ConvertAnyFormat(ValuePtr, Format); - if ( m_exifinfo->ISOequivalent < 50 ) m_exifinfo->ISOequivalent *= 200; - break; - - case TAG_COMPRESSION_LEVEL: - m_exifinfo->CompressionLevel = (int)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_XRESOLUTION: - m_exifinfo->Xresolution = (float)ConvertAnyFormat(ValuePtr, Format); - break; - case TAG_YRESOLUTION: - m_exifinfo->Yresolution = (float)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_THUMBNAIL_OFFSET: - ThumbnailOffset = (unsigned)ConvertAnyFormat(ValuePtr, Format); - break; - - case TAG_THUMBNAIL_LENGTH: - ThumbnailSize = (unsigned)ConvertAnyFormat(ValuePtr, Format); - break; - - } - - if (Tag == TAG_EXIF_OFFSET || Tag == TAG_INTEROP_OFFSET){ - unsigned char * SubdirStart; - unsigned Offset = Get32u(ValuePtr); - if (Offset>8){ - SubdirStart = OffsetBase + Offset; - if (SubdirStart < OffsetBase || - SubdirStart > OffsetBase+ExifLength){ - strcpy(m_szLastError,"Illegal subdirectory link"); - return false; - } - ProcessExifDir(SubdirStart, OffsetBase, ExifLength, m_exifinfo, LastExifRefdP); - } - continue; - } - } - - - { - /* In addition to linking to subdirectories via exif tags, - there's also a potential link to another directory at the end - of each directory. This has got to be the result of a - committee! - */ - unsigned char * SubdirStart; - unsigned Offset; - Offset = Get16u(DirStart+2+12*NumDirEntries); - if (Offset){ - SubdirStart = OffsetBase + Offset; - if (SubdirStart < OffsetBase - || SubdirStart > OffsetBase+ExifLength){ - strcpy(m_szLastError,"Illegal subdirectory link"); - return false; - } - ProcessExifDir(SubdirStart, OffsetBase, ExifLength, m_exifinfo, LastExifRefdP); - } - } - - - if (ThumbnailSize && ThumbnailOffset){ - if (ThumbnailSize + ThumbnailOffset <= ExifLength){ - /* The thumbnail pointer appears to be valid. Store it. */ - m_exifinfo->ThumbnailPointer = OffsetBase + ThumbnailOffset; - m_exifinfo->ThumbnailSize = ThumbnailSize; - } - } - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/*-------------------------------------------------------------------------- - Evaluate number, be it int, rational, or float from directory. ---------------------------------------------------------------------------*/ -double CxImageJPG::CxExifInfo::ConvertAnyFormat(void * ValuePtr, int Format) -{ - double Value; - Value = 0; - - switch(Format){ - case FMT_SBYTE: Value = *(signed char *)ValuePtr; break; - case FMT_BYTE: Value = *(unsigned char *)ValuePtr; break; - - case FMT_USHORT: Value = Get16u(ValuePtr); break; - case FMT_ULONG: Value = Get32u(ValuePtr); break; - - case FMT_URATIONAL: - case FMT_SRATIONAL: - { - int Num,Den; - Num = Get32s(ValuePtr); - Den = Get32s(4+(char *)ValuePtr); - if (Den == 0){ - Value = 0; - }else{ - Value = (double)Num/Den; - } - break; - } - - case FMT_SSHORT: Value = (signed short)Get16u(ValuePtr); break; - case FMT_SLONG: Value = Get32s(ValuePtr); break; - - /* Not sure if this is correct (never seen float used in Exif format) - */ - case FMT_SINGLE: Value = (double)*(float *)ValuePtr; break; - case FMT_DOUBLE: Value = *(double *)ValuePtr; break; - } - return Value; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageJPG::CxExifInfo::process_COM (const BYTE * Data, int length) -{ - int ch; - char Comment[MAX_COMMENT+1]; - int nch; - int a; - - nch = 0; - - if (length > MAX_COMMENT) length = MAX_COMMENT; // Truncate if it won't fit in our structure. - - for (a=2;aComments,Comment); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageJPG::CxExifInfo::process_SOFn (const BYTE * Data, int marker) -{ - int data_precision, num_components; - - data_precision = Data[2]; - m_exifinfo->Height = Get16m((void*)(Data+3)); - m_exifinfo->Width = Get16m((void*)(Data+5)); - num_components = Data[7]; - - if (num_components == 3){ - m_exifinfo->IsColor = 1; - }else{ - m_exifinfo->IsColor = 0; - } - - m_exifinfo->Process = marker; - - //if (ShowTags) printf("JPEG image is %uw * %uh, %d color components, %d bits per sample\n", - // ImageInfo.Width, ImageInfo.Height, num_components, data_precision); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * this will work only on a CxImageJPG object, if the image originally has valid EXIF data - \verbatim - CxImageJPG jpg; - CxIOFile in,out; - in.Open("D:\\exif_in.jpg","rb"); - out.Open("D:\\exif_out.jpg","w+b"); - jpg.Decode(&in); - if (jpg.IsValid()){ - jpg.RotateLeft(); - jpg.Encode(&out); - } - \endverbatim -*/ -bool CxImageJPG::CxExifInfo::EncodeExif(CxFile * hFile) -{ - int a; - - if (FindSection(M_SOS)==NULL){ - strcpy(m_szLastError,"Can't write exif : didn't read all"); - return false; - } - - // Initial static jpeg marker. - hFile->PutC(0xff); - hFile->PutC(0xd8); - - if (Sections[0].Type != M_EXIF && Sections[0].Type != M_JFIF){ - // The image must start with an exif or jfif marker. If we threw those away, create one. - static BYTE JfifHead[18] = { - 0xff, M_JFIF, - 0x00, 0x10, 'J' , 'F' , 'I' , 'F' , 0x00, 0x01, - 0x01, 0x01, 0x01, 0x2C, 0x01, 0x2C, 0x00, 0x00 - }; - hFile->Write(JfifHead, 18, 1); - } - - // Write all the misc sections - for (a=0;aPutC(0xff); - hFile->PutC(Sections[a].Type); - hFile->Write(Sections[a].Data, Sections[a].Size, 1); - } - - // Write the remaining image data. - hFile->Write(Sections[a].Data, Sections[a].Size, 1); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageJPG::CxExifInfo::DiscardAllButExif() -{ - Section_t ExifKeeper; - Section_t CommentKeeper; - int a; - - memset(&ExifKeeper, 0, sizeof(ExifKeeper)); - memset(&CommentKeeper, 0, sizeof(ExifKeeper)); - - for (a=0;a Use it before Create() - */ -void CxImage::CopyInfo(const CxImage &src) -{ - if (pDib==NULL) memcpy(&info,&src.info,sizeof(CXIMAGEINFO)); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \sa Copy - */ -CxImage& CxImage::operator = (const CxImage& isrc) -{ - if (this != &isrc) Copy(isrc); - return *this; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Initializes or rebuilds the image. - * \param dwWidth: width - * \param dwHeight: height - * \param wBpp: bit per pixel, can be 1, 4, 8, 24 - * \param imagetype: (optional) set the image format, see ENUM_CXIMAGE_FORMATS - * \return pointer to the internal pDib object; NULL if an error occurs. - */ -void* CxImage::Create(DWORD dwWidth, DWORD dwHeight, DWORD wBpp, DWORD imagetype) -{ - // destroy the existing image (if any) - if (!Destroy()) - return NULL; - - // prevent further actions if width or height are not vaild - if ((dwWidth == 0) || (dwHeight == 0)){ - strcpy(info.szLastError,"CxImage::Create : width and height must be greater than zero"); - return NULL; - } - - // Make sure bits per pixel is valid - if (wBpp <= 1) wBpp = 1; - else if (wBpp <= 4) wBpp = 4; - else if (wBpp <= 8) wBpp = 8; - else wBpp = 24; - - // limit memory requirements (and also a check for bad parameters) - if (((dwWidth*dwHeight*wBpp)>>8) > CXIMAGE_MAX_MEMORY){ - strcpy(info.szLastError,"CXIMAGE_MAX_MEMORY exceeded"); - return NULL; - } - - // set the correct bpp value - switch (wBpp){ - case 1: - head.biClrUsed = 2; break; - case 4: - head.biClrUsed = 16; break; - case 8: - head.biClrUsed = 256; break; - default: - head.biClrUsed = 0; - } - - //set the common image informations - info.dwEffWidth = ((((wBpp * dwWidth) + 31) / 32) * 4); - info.dwType = imagetype; - - // initialize BITMAPINFOHEADER - head.biSize = sizeof(BITMAPINFOHEADER); // - head.biWidth = dwWidth; // fill in width from parameter - head.biHeight = dwHeight; // fill in height from parameter - head.biPlanes = 1; // must be 1 - head.biBitCount = (WORD)wBpp; // from parameter - head.biCompression = BI_RGB; - head.biSizeImage = info.dwEffWidth * dwHeight; -// head.biXPelsPerMeter = 0; See SetXDPI -// head.biYPelsPerMeter = 0; See SetYDPI - head.biClrImportant = 0; - - pDib = malloc(GetSize()); // alloc memory block to store our bitmap - if (!pDib){ - strcpy(info.szLastError,"CxImage::Create can't allocate memory"); - return NULL; - } - - //clear the palette - RGBQUAD* pal=GetPalette(); - if (pal) memset(pal,0,GetPaletteSize()); - //Destroy the existing selection -#if CXIMAGE_SUPPORT_SELECTION - if (pSelection) SelectionDelete(); -#endif //CXIMAGE_SUPPORT_SELECTION - //Destroy the existing alpha channel -#if CXIMAGE_SUPPORT_ALPHA - if (pAlpha) AlphaDelete(); -#endif //CXIMAGE_SUPPORT_ALPHA - - // use our bitmap info structure to fill in first part of - // our DIB with the BITMAPINFOHEADER - BITMAPINFOHEADER* lpbi; - lpbi = (BITMAPINFOHEADER*)(pDib); - *lpbi = head; - - info.pImage=GetBits(); - - return pDib; //return handle to the DIB -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \return pointer to the image pixels. USE CAREFULLY - */ -BYTE* CxImage::GetBits(DWORD row) -{ - if (pDib){ - if (row) { - if (row<(DWORD)head.biHeight){ - return ((BYTE*)pDib + *(DWORD*)pDib + GetPaletteSize() + (info.dwEffWidth * row)); - } else { - return NULL; - } - } else { - return ((BYTE*)pDib + *(DWORD*)pDib + GetPaletteSize()); - } - } - return NULL; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \return the size in bytes of the internal pDib object - */ -long CxImage::GetSize() -{ - return head.biSize + head.biSizeImage + GetPaletteSize(); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Checks if the coordinates are inside the image - * \return true if x and y are both inside the image - */ -bool CxImage::IsInside(long x, long y) -{ - return (0<=y && y 0) bval = 255; - } - if (GetBpp() == 4){ - bval = (BYTE)(17*(0x0F & bval)); - } - - memset(info.pImage,bval,head.biSizeImage); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Transfers the image from an existing source image. The source becomes empty. - * \return true if everything is ok - */ -bool CxImage::Transfer(CxImage &from) -{ - if (!Destroy()) - return false; - - memcpy(&head,&from.head,sizeof(BITMAPINFOHEADER)); - memcpy(&info,&from.info,sizeof(CXIMAGEINFO)); - - pDib = from.pDib; - pSelection = from.pSelection; - pAlpha = from.pAlpha; - pLayers = from.pLayers; - - memset(&from.head,0,sizeof(BITMAPINFOHEADER)); - memset(&from.info,0,sizeof(CXIMAGEINFO)); - from.pDib = from.pSelection = from.pAlpha = NULL; - from.pLayers = NULL; - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * (this) points to the same pDib owned by (*from), the image remains in (*from) - * but (this) has the access to the pixels. Use carefully !!! - */ -void CxImage::Ghost(CxImage *from) -{ - if (from){ - memcpy(&head,&from->head,sizeof(BITMAPINFOHEADER)); - memcpy(&info,&from->info,sizeof(CXIMAGEINFO)); - pDib = from->pDib; - pSelection = from->pSelection; - pAlpha = from->pAlpha; - pLayers = from->pLayers; - info.pGhost=from; - } -} -//////////////////////////////////////////////////////////////////////////////// -/** - * turns a 16 or 32 bit bitfield image into a RGB image - */ -void CxImage::Bitfield2RGB(BYTE *src, WORD redmask, WORD greenmask, WORD bluemask, BYTE bpp) -{ - switch (bpp){ - case 16: - { - DWORD ns[3]={0,0,0}; - // compute the number of shift for each mask - for (int i=0;i<16;i++){ - if ((redmask>>i)&0x01) ns[0]++; - if ((greenmask>>i)&0x01) ns[1]++; - if ((bluemask>>i)&0x01) ns[2]++; - } - ns[1]+=ns[0]; ns[2]+=ns[1]; ns[0]=8-ns[0]; ns[1]-=8; ns[2]-=8; - // dword aligned width for 16 bit image - long effwidth2=(((head.biWidth + 1) / 2) * 4); - WORD w; - long y2,y3,x2,x3; - BYTE *p=info.pImage; - // scan the buffer in reverse direction to avoid reallocations - for (long y=head.biHeight-1; y>=0; y--){ - y2=effwidth2*y; - y3=info.dwEffWidth*y; - for (long x=head.biWidth-1; x>=0; x--){ - x2 = 2*x+y2; - x3 = 3*x+y3; - w = (WORD)(src[x2]+256*src[1+x2]); - p[ x3]=(BYTE)((w & bluemask)<>ns[1]); - p[2+x3]=(BYTE)((w & redmask)>>ns[2]); - } - } - break; - } - case 32: - { - // dword aligned width for 32 bit image - long effwidth4 = head.biWidth * 4; - long y4,y3,x4,x3; - BYTE *p=info.pImage; - // scan the buffer in reverse direction to avoid reallocations - for (long y=head.biHeight-1; y>=0; y--){ - y4=effwidth4*y; - y3=info.dwEffWidth*y; - for (long x=head.biWidth-1; x>=0; x--){ - x4 = 4*x+y4; - x3 = 3*x+y3; - p[ x3]=src[ x4]; - p[1+x3]=src[1+x4]; - p[2+x3]=src[2+x4]; - } - } - } - - } - return; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Creates an image from a generic buffer - * \param pArray: source memory buffer - * \param dwWidth: image width - * \param dwHeight: image height - * \param dwBitsperpixel: can be 1,4,8,24,32 - * \param dwBytesperline: line alignment, in bytes, for a single row stored in pArray - * \param bFlipImage: tune this parameter if the image is upsidedown - * \return true if everything is ok - */ -bool CxImage::CreateFromArray(BYTE* pArray,DWORD dwWidth,DWORD dwHeight,DWORD dwBitsperpixel, DWORD dwBytesperline, bool bFlipImage) -{ - if (pArray==NULL) return false; - if (!((dwBitsperpixel==1)||(dwBitsperpixel==4)||(dwBitsperpixel==8)|| - (dwBitsperpixel==24)||(dwBitsperpixel==32))) return false; - - if (!Create(dwWidth,dwHeight,dwBitsperpixel)) return false; - - if (dwBitsperpixel<24) SetGrayPalette(); - -#if CXIMAGE_SUPPORT_ALPHA - if (dwBitsperpixel==32) AlphaCreate(); -#endif //CXIMAGE_SUPPORT_ALPHA - - BYTE *dst,*src; - - for (DWORD y = 0; yrgbRed,c1->rgbGreen,c1->rgbBlue); - int g2 = (int)RGB2GRAY(c2->rgbRed,c2->rgbGreen,c2->rgbBlue); - - return (g1-g2); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * simply calls "if (memblock) free(memblock);". - * Useful when calling Encode for a memory buffer, - * from a DLL compiled with different memory management options. - * CxImage::FreeMemory will use the same memory environment used by Encode. - */ -void CxImage::FreeMemory(void* memblock) -{ - if (memblock) - free(memblock); -} -//////////////////////////////////////////////////////////////////////////////// -//EOF diff --git a/src/win32/dependencies/cximage/ximage.h b/src/win32/dependencies/cximage/ximage.h deleted file mode 100644 index 8d3af351..00000000 --- a/src/win32/dependencies/cximage/ximage.h +++ /dev/null @@ -1,648 +0,0 @@ -/* - * File: ximage.h - * Purpose: General Purpose Image Class - */ -/* - -------------------------------------------------------------------------------- - - COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: - - CxImage version 5.99c 17/Oct/2004 - - CxImage : Copyright (C) 2001 - 2004, Davide Pizzolato - - Original CImage and CImageIterator implementation are: - Copyright (C) 1995, Alejandro Aguilar Sierra (asierra(at)servidor(dot)unam(dot)mx) - - Covered code is provided under this license on an "as is" basis, without warranty - of any kind, either expressed or implied, including, without limitation, warranties - that the covered code is free of defects, merchantable, fit for a particular purpose - or non-infringing. The entire risk as to the quality and performance of the covered - code is with you. Should any covered code prove defective in any respect, you (not - the initial developer or any other contributor) assume the cost of any necessary - servicing, repair or correction. This disclaimer of warranty constitutes an essential - part of this license. No use of any covered code is authorized hereunder except under - this disclaimer. - - Permission is hereby granted to use, copy, modify, and distribute this - source code, or portions hereof, for any purpose, including commercial applications, - freely and without fee, subject to the following restrictions: - - 1. The origin of this software must not be misrepresented; you must not - claim that you wrote the original software. If you use this software - in a product, an acknowledgment in the product documentation would be - appreciated but is not required. - - 2. Altered source versions must be plainly marked as such, and must not be - misrepresented as being the original software. - - 3. This notice may not be removed or altered from any source distribution. - - -------------------------------------------------------------------------------- - - Other information: about CxImage, and the latest version, can be found at the - CxImage home page: http://www.xdp.it - - -------------------------------------------------------------------------------- - */ -#if !defined(__CXIMAGE_H) -#define __CXIMAGE_H - -#if _MSC_VER > 1000 -#pragma once -#endif - -///////////////////////////////////////////////////////////////////////////// -#include "xfile.h" -#include "xiofile.h" -#include "xmemfile.h" -#include "ximadef.h" // adjust some #define - -/* see "ximacfg.h" for CxImage configuration options */ - -///////////////////////////////////////////////////////////////////////////// -// CxImage formats enumerator -enum ENUM_CXIMAGE_FORMATS{ -CXIMAGE_FORMAT_UNKNOWN, -#if CXIMAGE_SUPPORT_BMP -CXIMAGE_FORMAT_BMP, -#endif -#if CXIMAGE_SUPPORT_GIF -CXIMAGE_FORMAT_GIF, -#endif -#if CXIMAGE_SUPPORT_JPG -CXIMAGE_FORMAT_JPG, -#endif -#if CXIMAGE_SUPPORT_PNG -CXIMAGE_FORMAT_PNG, -#endif -#if CXIMAGE_SUPPORT_MNG -CXIMAGE_FORMAT_MNG, -#endif -#if CXIMAGE_SUPPORT_ICO -CXIMAGE_FORMAT_ICO, -#endif -#if CXIMAGE_SUPPORT_TIF -CXIMAGE_FORMAT_TIF, -#endif -#if CXIMAGE_SUPPORT_TGA -CXIMAGE_FORMAT_TGA, -#endif -#if CXIMAGE_SUPPORT_PCX -CXIMAGE_FORMAT_PCX, -#endif -#if CXIMAGE_SUPPORT_WBMP -CXIMAGE_FORMAT_WBMP, -#endif -#if CXIMAGE_SUPPORT_WMF -CXIMAGE_FORMAT_WMF, -#endif -#if CXIMAGE_SUPPORT_J2K -CXIMAGE_FORMAT_J2K, -#endif -#if CXIMAGE_SUPPORT_JBG -CXIMAGE_FORMAT_JBG, -#endif -#if CXIMAGE_SUPPORT_JP2 -CXIMAGE_FORMAT_JP2, -#endif -#if CXIMAGE_SUPPORT_JPC -CXIMAGE_FORMAT_JPC, -#endif -#if CXIMAGE_SUPPORT_PGX -CXIMAGE_FORMAT_PGX, -#endif -#if CXIMAGE_SUPPORT_PNM -CXIMAGE_FORMAT_PNM, -#endif -#if CXIMAGE_SUPPORT_RAS -CXIMAGE_FORMAT_RAS, -#endif -CMAX_IMAGE_FORMATS -}; - -///////////////////////////////////////////////////////////////////////////// -// CxImage class -///////////////////////////////////////////////////////////////////////////// -class DLL_EXP CxImage -{ -//extensible information collector -typedef struct tagCxImageInfo { - DWORD dwEffWidth; ///< DWORD aligned scan line width - BYTE* pImage; ///< THE IMAGE BITS - CxImage* pGhost; ///< if this is a ghost, pGhost points to the body - CxImage* pParent; ///< if this is a layer, pParent points to the body - DWORD dwType; ///< original image format - char szLastError[256]; ///< debugging - long nProgress; ///< monitor - long nEscape; ///< escape - long nBkgndIndex; ///< used for GIF, PNG, MNG - RGBQUAD nBkgndColor; ///< used for RGB transparency - BYTE nQuality; ///< used for JPEG - BYTE nJpegScale; ///< used for JPEG [ignacio] - long nFrame; ///< used for TIF, GIF, MNG : actual frame - long nNumFrames; ///< used for TIF, GIF, MNG : total number of frames - DWORD dwFrameDelay; ///< used for GIF, MNG - long xDPI; ///< horizontal resolution - long yDPI; ///< vertical resolution - RECT rSelectionBox; ///< bounding rectangle - BYTE nAlphaMax; ///< max opacity (fade) - bool bAlphaPaletteEnabled; ///< true if alpha values in the palette are enabled. - bool bEnabled; ///< enables the painting functions - long xOffset; - long yOffset; - DWORD dwCodecOpt[CMAX_IMAGE_FORMATS]; ///< for GIF, TIF : 0=def.1=unc,2=fax3,3=fax4,4=pack,5=jpg - RGBQUAD last_c; ///< for GetNearestIndex optimization - BYTE last_c_index; - bool last_c_isvalid; - long nNumLayers; - DWORD dwFlags; ///< 0x??00000 = reserved, 0x00??0000 = blend mode, 0x0000???? = layer id - user flags - -} CXIMAGEINFO; - -public: - //public structures -struct rgb_color { BYTE r,g,b; }; - -#if CXIMAGE_SUPPORT_WINDOWS -// text placement data -// members must be initialized with the InitTextInfo(&this) function. -typedef struct tagCxTextInfo -{ - TCHAR text[4096]; ///< text (char -> TCHAR for UNICODE [Cesar M]) - LOGFONT lfont; ///< font and codepage data - COLORREF fcolor; ///< foreground color - long align; ///< DT_CENTER, DT_RIGHT, DT_LEFT aligment for multiline text - BYTE opaque; ///< text has background or hasn't. Default is true. - ///< data for background (ignored if .opaque==FALSE) - COLORREF bcolor; ///< background color - float b_opacity; ///< opacity value for background between 0.0-1.0 Default is 0. (opaque) - BYTE b_outline; ///< outline width for background (zero: no outline) - BYTE b_round; ///< rounding radius for background rectangle. % of the height, between 0-50. Default is 10. - ///< (backgr. always has a frame: width = 3 pixel + 10% of height by default.) -} CXTEXTINFO; -#endif - -public: -/** \addtogroup Constructors */ //@{ - CxImage(DWORD imagetype = 0); - CxImage(DWORD dwWidth, DWORD dwHeight, DWORD wBpp, DWORD imagetype = 0); - CxImage(const CxImage &src, bool copypixels = true, bool copyselection = true, bool copyalpha = true); - CxImage(const TCHAR * filename, DWORD imagetype); // For UNICODE support: char -> TCHAR - CxImage(FILE * stream, DWORD imagetype); - CxImage(CxFile * stream, DWORD imagetype); - CxImage(BYTE * buffer, DWORD size, DWORD imagetype); - virtual ~CxImage() { Destroy(); }; - CxImage& operator = (const CxImage&); -//@} - -/** \addtogroup Initialization */ //@{ - void* Create(DWORD dwWidth, DWORD dwHeight, DWORD wBpp, DWORD imagetype = 0); - bool Destroy(); - void Clear(BYTE bval=0); - void Copy(const CxImage &src, bool copypixels = true, bool copyselection = true, bool copyalpha = true); - bool Transfer(CxImage &from); - bool CreateFromArray(BYTE* pArray,DWORD dwWidth,DWORD dwHeight,DWORD dwBitsperpixel, DWORD dwBytesperline, bool bFlipImage); - bool CreateFromMatrix(BYTE** ppMatrix,DWORD dwWidth,DWORD dwHeight,DWORD dwBitsperpixel, DWORD dwBytesperline, bool bFlipImage); - void FreeMemory(void* memblock); -//@} - -/** \addtogroup Attributes */ //@{ - long GetSize(); - BYTE* GetBits(DWORD row = 0); - BYTE GetColorType(); - void* GetDIB() const; - DWORD GetHeight() const; - DWORD GetWidth() const; - DWORD GetEffWidth() const; - DWORD GetNumColors() const; - WORD GetBpp() const; - DWORD GetType() const; - const char* GetLastError(); - const TCHAR* GetVersion(); - const float GetVersionNumber(); - - DWORD GetFrameDelay() const; - void SetFrameDelay(DWORD d); - - void GetOffset(long *x,long *y); - void SetOffset(long x,long y); - - BYTE GetJpegQuality() const; - void SetJpegQuality(BYTE q); - - BYTE GetJpegScale() const; - void SetJpegScale(BYTE q); - - long GetXDPI() const; - long GetYDPI() const; - void SetXDPI(long dpi); - void SetYDPI(long dpi); - - DWORD GetClrImportant() const; - void SetClrImportant(DWORD ncolors = 0); - - long GetProgress() const; - long GetEscape() const; - void SetProgress(long p); - void SetEscape(long i); - - long GetTransIndex() const; - RGBQUAD GetTransColor(); - void SetTransIndex(long idx); - void SetTransColor(RGBQUAD rgb); - bool IsTransparent() const; - - DWORD GetCodecOption(DWORD imagetype = 0); - bool SetCodecOption(DWORD opt, DWORD imagetype = 0); - - DWORD GetFlags() const; - void SetFlags(DWORD flags, bool bLockReservedFlags = true); - - //void* GetUserData() const {return info.pUserData;} - //void SetUserData(void* pUserData) {info.pUserData = pUserData;} -//@} - -/** \addtogroup Palette - * These functions have no effects on RGB images and in this case the returned value is always 0. - * @{ */ - bool IsGrayScale(); - bool IsIndexed() const; - bool IsSamePalette(CxImage &img, bool bCheckAlpha = true); - DWORD GetPaletteSize(); - RGBQUAD* GetPalette() const; - RGBQUAD GetPaletteColor(BYTE idx); - bool GetPaletteColor(BYTE i, BYTE* r, BYTE* g, BYTE* b); - BYTE GetNearestIndex(RGBQUAD c); - void BlendPalette(COLORREF cr,long perc); - void SetGrayPalette(); - void SetPalette(DWORD n, BYTE *r, BYTE *g, BYTE *b); - void SetPalette(RGBQUAD* pPal,DWORD nColors=256); - void SetPalette(rgb_color *rgb,DWORD nColors=256); - void SetPaletteColor(BYTE idx, BYTE r, BYTE g, BYTE b, BYTE alpha=0); - void SetPaletteColor(BYTE idx, RGBQUAD c); - void SetPaletteColor(BYTE idx, COLORREF cr); - void SwapIndex(BYTE idx1, BYTE idx2); - void SetStdPalette(); -//@} - -/** \addtogroup Pixel */ //@{ - bool IsInside(long x, long y); - bool IsTransparent(long x,long y); - RGBQUAD GetPixelColor(long x,long y, bool bGetAlpha = true); - BYTE GetPixelIndex(long x,long y); - BYTE GetPixelGray(long x, long y); - void SetPixelColor(long x,long y,RGBQUAD c, bool bSetAlpha = false); - void SetPixelColor(long x,long y,COLORREF cr); - void SetPixelIndex(long x,long y,BYTE i); - void DrawLine(int StartX, int EndX, int StartY, int EndY, RGBQUAD color, bool bSetAlpha=false); - void DrawLine(int StartX, int EndX, int StartY, int EndY, COLORREF cr); - void BlendPixelColor(long x,long y,RGBQUAD c, float blend, bool bSetAlpha = false); -//@} - -protected: -/** \addtogroup Protected */ //@{ - BYTE BlindGetPixelIndex(const long x,const long y); - RGBQUAD BlindGetPixelColor(const long x,const long y); - void *BlindGetPixelPointer(const long x,const long y); -//@} - -public: - -#if CXIMAGE_SUPPORT_INTERPOLATION -/** \addtogroup Interpolation */ //@{ - //overflow methods: - enum OverflowMethod { - OM_COLOR=1, - OM_BACKGROUND=2, - OM_TRANSPARENT=3, - OM_WRAP=4, - OM_REPEAT=5, - OM_MIRROR=6 - }; - void OverflowCoordinates(float &x, float &y, OverflowMethod const ofMethod); - void OverflowCoordinates(long &x, long &y, OverflowMethod const ofMethod); - RGBQUAD GetPixelColorWithOverflow(long x, long y, OverflowMethod const ofMethod=OM_BACKGROUND, RGBQUAD* const rplColor=0); - //interpolation methods: - enum InterpolationMethod { - IM_NEAREST_NEIGHBOUR=1, - IM_BILINEAR =2, - IM_BSPLINE =3, - IM_BICUBIC =4, - IM_BICUBIC2 =5, - IM_LANCZOS =6, - IM_BOX =7, - IM_HERMITE =8, - IM_HAMMING =9, - IM_SINC =10, - IM_BLACKMAN =11, - IM_BESSEL =12, - IM_GAUSSIAN =13, - IM_QUADRATIC =14, - IM_MITCHELL =15, - IM_CATROM =16 - }; - RGBQUAD GetPixelColorInterpolated(float x,float y, InterpolationMethod const inMethod=IM_BILINEAR, OverflowMethod const ofMethod=OM_BACKGROUND, RGBQUAD* const rplColor=0); - RGBQUAD GetAreaColorInterpolated(float const xc, float const yc, float const w, float const h, InterpolationMethod const inMethod, OverflowMethod const ofMethod=OM_BACKGROUND, RGBQUAD* const rplColor=0); -//@} - -protected: -/** \addtogroup Protected */ //@{ - void AddAveragingCont(RGBQUAD const &color, float const surf, float &rr, float &gg, float &bb, float &aa); -//@} - -/** \addtogroup Kernels */ //@{ -public: - static float KernelBSpline(const float x); - static float KernelLinear(const float t); - static float KernelCubic(const float t); - static float KernelGeneralizedCubic(const float t, const float a=-1); - static float KernelLanczosSinc(const float t, const float r = 3); - static float KernelBox(const float x); - static float KernelHermite(const float x); - static float KernelHamming(const float x); - static float KernelSinc(const float x); - static float KernelBlackman(const float x); - static float KernelBessel_J1(const float x); - static float KernelBessel_P1(const float x); - static float KernelBessel_Q1(const float x); - static float KernelBessel_Order1(float x); - static float KernelBessel(const float x); - static float KernelGaussian(const float x); - static float KernelQuadratic(const float x); - static float KernelMitchell(const float x); - static float KernelCatrom(const float x); -//@} -#endif //CXIMAGE_SUPPORT_INTERPOLATION - -/** \addtogroup Painting */ //@{ -#if CXIMAGE_SUPPORT_WINCE - long Blt(HDC pDC, long x=0, long y=0); -#endif -#if CXIMAGE_SUPPORT_WINDOWS - HBITMAP MakeBitmap(HDC hdc = NULL); - HANDLE CopyToHandle(); - bool CreateFromHANDLE(HANDLE hMem); //Windows objects (clipboard) - bool CreateFromHBITMAP(HBITMAP hbmp, HPALETTE hpal=0); //Windows resource - bool CreateFromHICON(HICON hico); - long Draw(HDC hdc, long x=0, long y=0, long cx = -1, long cy = -1, RECT* pClipRect = 0, bool bSmooth = false); - long Draw(HDC hdc, const RECT& rect, RECT* pClipRect=NULL, bool bSmooth = false); - long Stretch(HDC hdc, long xoffset, long yoffset, long xsize, long ysize, DWORD dwRop = SRCCOPY); - long Stretch(HDC hdc, const RECT& rect, DWORD dwRop = SRCCOPY); - long Tile(HDC hdc, RECT *rc); - long Draw2(HDC hdc, long x=0, long y=0, long cx = -1, long cy = -1); - long Draw2(HDC hdc, const RECT& rect); - //long DrawString(HDC hdc, long x, long y, const char* text, RGBQUAD color, const char* font, long lSize=0, long lWeight=400, BYTE bItalic=0, BYTE bUnderline=0, bool bSetAlpha=false); - long DrawString(HDC hdc, long x, long y, const TCHAR* text, RGBQUAD color, const TCHAR* font, long lSize=0, long lWeight=400, BYTE bItalic=0, BYTE bUnderline=0, bool bSetAlpha=false); - // extensions - long DrawStringEx(HDC hdc, long x, long y, CXTEXTINFO *pTextType, bool bSetAlpha=false ); - void InitTextInfo( CXTEXTINFO *txt ); -#endif //CXIMAGE_SUPPORT_WINDOWS -//@} - - // file operations -#if CXIMAGE_SUPPORT_DECODE -/** \addtogroup Decode */ //@{ -#ifdef WIN32 - //bool Load(LPCWSTR filename, DWORD imagetype=0); - bool LoadResource(HRSRC hRes, DWORD imagetype, HMODULE hModule=NULL); -#endif - // For UNICODE support: char -> TCHAR - bool Load(const TCHAR* filename, DWORD imagetype=0); - //bool Load(const char * filename, DWORD imagetype=0); - bool Decode(FILE * hFile, DWORD imagetype); - bool Decode(CxFile * hFile, DWORD imagetype); - bool Decode(BYTE * buffer, DWORD size, DWORD imagetype); -//@} -#endif //CXIMAGE_SUPPORT_DECODE - -#if CXIMAGE_SUPPORT_ENCODE -protected: -/** \addtogroup Protected */ //@{ - bool EncodeSafeCheck(CxFile *hFile); -//@} - -public: -/** \addtogroup Encode */ //@{ -#ifdef WIN32 - //bool Save(LPCWSTR filename, DWORD imagetype=0); -#endif - // For UNICODE support: char -> TCHAR - bool Save(const TCHAR* filename, DWORD imagetype); - //bool Save(const char * filename, DWORD imagetype=0); - bool Encode(FILE * hFile, DWORD imagetype); - bool Encode(CxFile * hFile, DWORD imagetype); - bool Encode(CxFile * hFile, CxImage ** pImages, int pagecount, DWORD imagetype); - bool Encode(FILE *hFile, CxImage ** pImages, int pagecount, DWORD imagetype); - bool Encode(BYTE * &buffer, long &size, DWORD imagetype); - - bool Encode2RGBA(CxFile *hFile); - bool Encode2RGBA(BYTE * &buffer, long &size); -//@} -#endif //CXIMAGE_SUPPORT_ENCODE - -/** \addtogroup Attributes */ //@{ - //misc. - bool IsValid() const; - bool IsEnabled() const; - void Enable(bool enable=true); - - // frame operations - long GetNumFrames() const; - long GetFrame() const; - void SetFrame(long nFrame); -//@} - -#if CXIMAGE_SUPPORT_BASICTRANSFORMATIONS -/** \addtogroup BasicTransformations */ //@{ - bool GrayScale(); - bool Flip(); - bool Mirror(); - bool Negative(); - bool RotateLeft(CxImage* iDst = NULL); - bool RotateRight(CxImage* iDst = NULL); -//@} -#endif //CXIMAGE_SUPPORT_BASICTRANSFORMATIONS - -#if CXIMAGE_SUPPORT_TRANSFORMATION -/** \addtogroup Transformations */ //@{ - // image operations - bool Rotate(float angle, CxImage* iDst = NULL); - bool Rotate2(float angle, CxImage *iDst = NULL, InterpolationMethod inMethod=IM_BILINEAR, - OverflowMethod ofMethod=OM_BACKGROUND, RGBQUAD *replColor=0, - bool const optimizeRightAngles=true, bool const bKeepOriginalSize=false); - bool Rotate180(CxImage* iDst = NULL); - bool Resample(long newx, long newy, int mode = 1, CxImage* iDst = NULL); - bool Resample2(long newx, long newy, InterpolationMethod const inMethod=IM_BICUBIC2, - OverflowMethod const ofMethod=OM_REPEAT, CxImage* const iDst = NULL, - bool const disableAveraging=false); - bool DecreaseBpp(DWORD nbit, bool errordiffusion, RGBQUAD* ppal = 0, DWORD clrimportant = 0); - bool IncreaseBpp(DWORD nbit); - bool Dither(long method = 0); - bool Crop(long left, long top, long right, long bottom, CxImage* iDst = NULL); - bool Crop(const RECT& rect, CxImage* iDst = NULL); - bool CropRotatedRectangle( long topx, long topy, long width, long height, float angle, CxImage* iDst = NULL); - bool Skew(float xgain, float ygain, long xpivot=0, long ypivot=0, bool bEnableInterpolation = false); - bool Expand(long left, long top, long right, long bottom, RGBQUAD canvascolor, CxImage* iDst = 0); - bool Expand(long newx, long newy, RGBQUAD canvascolor, CxImage* iDst = 0); - bool Thumbnail(long newx, long newy, RGBQUAD canvascolor, CxImage* iDst = 0); - bool CircleTransform(int type,long rmax=0,float Koeff=1.0f); - bool RedEyeRemove(); - bool QIShrink(long newx, long newy, CxImage* const iDst = NULL); -//@} -#endif //CXIMAGE_SUPPORT_TRANSFORMATION - -#if CXIMAGE_SUPPORT_DSP -/** \addtogroup DSP */ //@{ - bool Contour(); - bool HistogramStretch(long method = 0); - bool HistogramEqualize(); - bool HistogramNormalize(); - bool HistogramRoot(); - bool HistogramLog(); - long Histogram(long* red, long* green = 0, long* blue = 0, long* gray = 0, long colorspace = 0); - bool Jitter(long radius=2); - bool Repair(float radius = 0.25f, long niterations = 1, long colorspace = 0); - bool Combine(CxImage* r,CxImage* g,CxImage* b,CxImage* a, long colorspace = 0); - bool FFT2(CxImage* srcReal, CxImage* srcImag, CxImage* dstReal, CxImage* dstImag, long direction = 1, bool bForceFFT = true, bool bMagnitude = true); - bool Noise(long level); - bool Median(long Ksize=3); - bool Gamma(float gamma); - bool ShiftRGB(long r, long g, long b); - bool Threshold(BYTE level); - bool Colorize(BYTE hue, BYTE sat, float blend = 1.0f); - bool Light(long brightness, long contrast = 0); - float Mean(); - bool Filter(long* kernel, long Ksize, long Kfactor, long Koffset); - bool Erode(long Ksize=2); - bool Dilate(long Ksize=2); - bool Edge(long Ksize=2); - void HuePalette(float correction=1); - enum ImageOpType { OpAdd, OpAnd, OpXor, OpOr, OpMask, OpSrcCopy, OpDstCopy, OpSub, OpSrcBlend, OpScreen }; - void Mix(CxImage & imgsrc2, ImageOpType op, long lXOffset = 0, long lYOffset = 0, bool bMixAlpha = false); - void MixFrom(CxImage & imagesrc2, long lXOffset, long lYOffset); - bool UnsharpMask(float radius = 5.0, float amount = 0.5, int threshold = 0); - bool Lut(BYTE* pLut); - bool Lut(BYTE* pLutR, BYTE* pLutG, BYTE* pLutB, BYTE* pLutA = 0); -//@} - -protected: -/** \addtogroup Protected */ //@{ - bool IsPowerof2(long x); - bool FFT(int dir,int m,double *x,double *y); - bool DFT(int dir,long m,double *x1,double *y1,double *x2,double *y2); - bool RepairChannel(CxImage *ch, float radius); - // - int gen_convolve_matrix (float radius, float **cmatrix_p); - float* gen_lookup_table (float *cmatrix, int cmatrix_length); - void blur_line (float *ctable, float *cmatrix, int cmatrix_length, BYTE* cur_col, BYTE* dest_col, int y, long bytes); -//@} - -public: -/** \addtogroup ColorSpace */ //@{ - bool SplitRGB(CxImage* r,CxImage* g,CxImage* b); - bool SplitYUV(CxImage* y,CxImage* u,CxImage* v); - bool SplitHSL(CxImage* h,CxImage* s,CxImage* l); - bool SplitYIQ(CxImage* y,CxImage* i,CxImage* q); - bool SplitXYZ(CxImage* x,CxImage* y,CxImage* z); - bool SplitCMYK(CxImage* c,CxImage* m,CxImage* y,CxImage* k); - static RGBQUAD HSLtoRGB(COLORREF cHSLColor); - static RGBQUAD RGBtoHSL(RGBQUAD lRGBColor); - static RGBQUAD HSLtoRGB(RGBQUAD lHSLColor); - static RGBQUAD YUVtoRGB(RGBQUAD lYUVColor); - static RGBQUAD RGBtoYUV(RGBQUAD lRGBColor); - static RGBQUAD YIQtoRGB(RGBQUAD lYIQColor); - static RGBQUAD RGBtoYIQ(RGBQUAD lRGBColor); - static RGBQUAD XYZtoRGB(RGBQUAD lXYZColor); - static RGBQUAD RGBtoXYZ(RGBQUAD lRGBColor); -#endif //CXIMAGE_SUPPORT_DSP - static RGBQUAD RGBtoRGBQUAD(COLORREF cr); - static COLORREF RGBQUADtoRGB (RGBQUAD c); -//@} - -#if CXIMAGE_SUPPORT_SELECTION -/** \addtogroup Selection */ //@{ - bool SelectionClear(); - bool SelectionCreate(); - bool SelectionDelete(); - bool SelectionInvert(); - bool SelectionAddRect(RECT r); - bool SelectionAddEllipse(RECT r); - bool SelectionAddPolygon(POINT *points, long npoints); - bool SelectionAddColor(RGBQUAD c); - bool SelectionAddPixel(int x, int y); - bool SelectionCopy(CxImage &from); - bool SelectionIsInside(long x, long y); - bool SelectionIsValid(); - void SelectionGetBox(RECT& r); - bool SelectionToHRGN(HRGN& region); - bool SelectionSplit(CxImage *dest); -//@} -#endif //CXIMAGE_SUPPORT_SELECTION - -#if CXIMAGE_SUPPORT_ALPHA -/** \addtogroup Alpha */ //@{ - void AlphaClear(); - void AlphaCreate(); - void AlphaDelete(); - void AlphaInvert(); - bool AlphaMirror(); - bool AlphaFlip(); - bool AlphaCopy(CxImage &from); - bool AlphaSplit(CxImage *dest); - void AlphaStrip(); - void AlphaSet(BYTE level); - bool AlphaSet(CxImage &from); - void AlphaSet(const long x,const long y,const BYTE level); - BYTE AlphaGet(const long x,const long y); - BYTE AlphaGetMax() const; - void AlphaSetMax(BYTE nAlphaMax); - bool AlphaIsValid(); - BYTE* AlphaGetPointer(const long x = 0,const long y = 0); - - void AlphaPaletteClear(); - void AlphaPaletteEnable(bool enable=true); - bool AlphaPaletteIsEnabled(); - bool AlphaPaletteIsValid(); - bool AlphaPaletteSplit(CxImage *dest); -//@} - -protected: -/** \addtogroup Protected */ //@{ - BYTE BlindAlphaGet(const long x,const long y); -//@} -#endif //CXIMAGE_SUPPORT_ALPHA - -public: -#if CXIMAGE_SUPPORT_LAYERS -/** \addtogroup Layers */ //@{ - bool LayerCreate(long position = -1); - bool LayerDelete(long position = -1); - void LayerDeleteAll(); - CxImage* GetLayer(long position); - CxImage* GetParent() const; - long GetNumLayers() const; -//@} -#endif //CXIMAGE_SUPPORT_LAYERS - -protected: -/** \addtogroup Protected */ //@{ - void Startup(DWORD imagetype = 0); - void CopyInfo(const CxImage &src); - void Ghost(CxImage *src); - void RGBtoBGR(BYTE *buffer, int length); - static float HueToRGB(float n1,float n2, float hue); - void Bitfield2RGB(BYTE *src, WORD redmask, WORD greenmask, WORD bluemask, BYTE bpp); - static int CompareColors(const void *elem1, const void *elem2); - - void* pDib; //contains the header, the palette, the pixels - BITMAPINFOHEADER head; //standard header - CXIMAGEINFO info; //extended information - BYTE* pSelection; //selected region - BYTE* pAlpha; //alpha channel - CxImage** pLayers; //generic layers -//@} -}; - -//////////////////////////////////////////////////////////////////////////// -#endif // !defined(__CXIMAGE_H) diff --git a/src/win32/dependencies/cximage/ximagif.cpp b/src/win32/dependencies/cximage/ximagif.cpp deleted file mode 100644 index e9aee917..00000000 --- a/src/win32/dependencies/cximage/ximagif.cpp +++ /dev/null @@ -1,1564 +0,0 @@ -/* - * File: ximagif.cpp - * Purpose: Platform Independent GIF Image Class Loader and Writer - * 07/Aug/2001 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximagif.h" - -#if CXIMAGE_SUPPORT_GIF - -#include "ximaiter.h" - -#if CXIMAGE_SUPPORT_WINCE - #define assert(s) -#else - #include -#endif - -//////////////////////////////////////////////////////////////////////////////// -bool CxImageGIF::Decode(CxFile *fp) -{ - /* AD - for transparency */ - struct_dscgif dscgif; - struct_image image; - struct_TabCol TabCol; - - if (fp == NULL) return false; - - fp->Read(&dscgif,/*sizeof(dscgif)*/13,1); - //if (strncmp(dscgif.header,"GIF8",3)!=0) { - if (strncmp(dscgif.header,"GIF8",4)!=0) return FALSE; - - if (info.nEscape == -1) { - // Return output dimensions only - head.biWidth = dscgif.scrwidth; - head.biHeight = dscgif.scrheight; - return true; - } - - /* AD - for interlace */ - TabCol.sogct = (short)(1 << ((dscgif.pflds & 0x07)+1)); - TabCol.colres = (short)(((dscgif.pflds & 0x70) >> 3) + 1); - - // assume that the image is a truecolor-gif if - // 1) no global color map found - // 2) (image.w, image.h) of the 1st image != (dscgif.scrwidth, dscgif.scrheight) - long bTrueColor=0; - CxImage* imaRGB=NULL; - - // Global colour map? - if (dscgif.pflds & 0x80) - fp->Read(TabCol.paleta,sizeof(struct rgb_color)*TabCol.sogct,1); - else - bTrueColor++; //first chance for a truecolor gif - - long first_transparent_index; - - int iImage = 0; - info.nNumFrames=get_num_frames(fp,&TabCol,&dscgif); - - if ((info.nFrame<0)||(info.nFrame>=info.nNumFrames)) return false; - - //it cannot be a true color GIF with only one frame - if (info.nNumFrames == 1) - bTrueColor=0; - - char ch; - bool bPreviousWasNull = true; - int prevdispmeth = 0; - - for (BOOL bContinue = TRUE; bContinue; ) - { - if (fp->Read(&ch, sizeof(ch), 1) != 1) {break;} - - if (info.nEscape > 0) return false; // - cancel decoding - if (bPreviousWasNull || ch==0) - { - switch (ch) - { - case '!': // extension - { - bContinue = DecodeExtension(fp); - break; - } - case ',': // image - { - assert(sizeof(image) == 9); - fp->Read(&image,sizeof(image),1); - //avoid byte order problems with Solaris - BYTE *byteData = (BYTE *) & image; - image.l = byteData[0]+byteData[1]*256; - image.t = byteData[2]+byteData[3]*256; - image.w = byteData[4]+byteData[5]*256; - image.h = byteData[6]+byteData[7]*256; - - if (((image.l + image.w) > dscgif.scrwidth)||((image.t + image.h) > dscgif.scrheight)) - break; - - // check if it could be a truecolor gif - if ((iImage==0) && (image.w != dscgif.scrwidth) && (image.h != dscgif.scrheight)) - bTrueColor++; - - // Local colour map? - if (image.pf & 0x80) { - TabCol.sogct = (short)(1 << ((image.pf & 0x07) +1)); - assert(3 == sizeof(struct rgb_color)); - fp->Read(TabCol.paleta,sizeof(struct rgb_color)*TabCol.sogct,1); - //log << "Local colour map" << endl; - } - - int bpp; // select the correct bit per pixel value - if (TabCol.sogct <= 2) bpp = 1; - else if (TabCol.sogct <= 16) bpp = 4; - else bpp = 8; - - CxImageGIF backimage; - backimage.CopyInfo(*this); - if (iImage==0){ - //first frame: build image background - backimage.Create(dscgif.scrwidth, dscgif.scrheight, bpp, CXIMAGE_FORMAT_GIF); - first_transparent_index = info.nBkgndIndex; - backimage.Clear((BYTE)gifgce.transpcolindex); - } else { - //generic frame: handle disposal method from previous one - /*Values : 0 - No disposal specified. The decoder is - not required to take any action. - 1 - Do not dispose. The graphic is to be left - in place. - 2 - Restore to background color. The area used by the - graphic must be restored to the background color. - 3 - Restore to previous. The decoder is required to - restore the area overwritten by the graphic with - what was there prior to rendering the graphic. - */ - backimage.Copy(*this); - if (prevdispmeth==2){ - backimage.Clear((BYTE)first_transparent_index); - } - } - - //active frame - Create(image.w, image.h, bpp, CXIMAGE_FORMAT_GIF); - - if ((image.pf & 0x80) || (dscgif.pflds & 0x80)) { - unsigned char r[256], g[256], b[256]; - int i, has_white = 0; - - for (i=0; i < TabCol.sogct; i++) { - r[i] = TabCol.paleta[i].r; - g[i] = TabCol.paleta[i].g; - b[i] = TabCol.paleta[i].b; - - if (RGB(r[i],g[i],b[i]) == 0xFFFFFF) has_white = 1; - } - - // Force transparency colour white... - //if (0) if (info.nBkgndIndex != -1) - // r[info.nBkgndIndex] = g[info.nBkgndIndex] = b[info.nBkgndIndex] = 255; - // Fill in with white // AD - if (info.nBkgndIndex != -1) { - while (i < 256) { - has_white = 1; - r[i] = g[i] = b[i] = 255; - i++; - } - } - - // Force last colour to white... // AD - //if ((info.nBkgndIndex != -1) && !has_white) { - // r[255] = g[255] = b[255] = 255; - //} - - SetPalette((info.nBkgndIndex != -1 ? 256 : TabCol.sogct), r, g, b); - } - - CImageIterator* iter = new CImageIterator(this); - iter->Upset(); - int badcode=0; - ibf = GIFBUFTAM+1; - - interlaced = image.pf & 0x40; - iheight = image.h; - istep = 8; - iypos = 0; - ipass = 0; - - long pos_start = fp->Tell(); - //if (interlaced) log << "Interlaced" << endl; - decoder(fp, iter, image.w, badcode); - delete iter; - - if (info.nEscape) return false; // - cancel decoding - - if (bTrueColor<2 ){ //standard GIF: mix frame with background - backimage.GifMix(*this,image); - backimage.SetTransIndex(first_transparent_index); - backimage.SetPalette(GetPalette()); - Transfer(backimage); - } else { //it's a truecolor gif! - //force full image decoding - info.nFrame=info.nNumFrames-1; - //build the RGB image - if (imaRGB==NULL) imaRGB = new CxImage(dscgif.scrwidth,dscgif.scrheight,24,CXIMAGE_FORMAT_GIF); - //copy the partial image into the full RGB image - for(long y=0;ySetPixelColor(x+image.l,dscgif.scrheight-1-image.t-y,GetPixelColor(x,image.h-y-1)); - } - } - } - - prevdispmeth = gifgce.dispmeth; - - //restore the correct position in the file for the next image - if (badcode){ - seek_next_image(fp,pos_start); - } else { - fp->Seek(-(ibfmax - ibf - 1), SEEK_CUR); - } - - if (info.nFrame==iImage) bContinue=false; else iImage++; - - break; - } - case ';': //terminator - bContinue=false; - break; - default: - bPreviousWasNull = (ch==0); - break; - } - } - } - - if (bTrueColor>=2 && imaRGB){ - if (gifgce.transpcolflag){ - imaRGB->SetTransColor(GetPaletteColor((BYTE)info.nBkgndIndex)); - imaRGB->SetTransIndex(0); - } - Transfer(*imaRGB); - } - delete imaRGB; - - return true; - -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImageGIF::DecodeExtension(CxFile *fp) -{ - bool bContinue; - unsigned char count; - unsigned char fc; - - bContinue = (1 == fp->Read(&fc, sizeof(fc), 1)); - if (bContinue) { - /* AD - for transparency */ - if (fc == 0xF9) { - bContinue = (1 == fp->Read(&count, sizeof(count), 1)); - if (bContinue) { - assert(sizeof(gifgce) == 4); - bContinue = (count == fp->Read(&gifgce, 1, sizeof(gifgce))); - if (bContinue) { - if (gifgce.transpcolflag) info.nBkgndIndex = gifgce.transpcolindex; - info.dwFrameDelay = gifgce.delaytime; - m_dispmeth = gifgce.dispmeth; - } } } - - if (fc == 0xFE) { // Comment block - bContinue = (1 == fp->Read(&count, sizeof(count), 1)); - if (bContinue) { - bContinue = (1 == fp->Read(m_comment, count, 1)); - m_comment[count]='\0'; - } } - - if (fc == 0xFF) { // Application Extension block - bContinue = (1 == fp->Read(&count, sizeof(count), 1)); - if (bContinue) { - bContinue = (count==11); - if (bContinue){ - char AppID[11]; - bContinue = (1 == fp->Read(AppID, count, 1)); - if (bContinue) { - bContinue = (1 == fp->Read(&count, sizeof(count), 1)); - if (bContinue) { - BYTE* dati = (BYTE*)malloc(count); - bContinue = (dati!=NULL); - if (bContinue){ - bContinue = (1 == fp->Read(dati, count, 1)); - if (count>2){ - m_loops = dati[1]+256*dati[2]; - } - } - free(dati); - } } } } } - - while (bContinue && fp->Read(&count, sizeof(count), 1) && count) { - //log << "Skipping " << count << " bytes" << endl; - fp->Seek(count, SEEK_CUR); - } - } - return bContinue; - -} - - -// - This external (machine specific) function is expected to return -// either the next BYTE from the GIF file, or a negative error number. -int CxImageGIF::get_byte(CxFile* file) -{ - if (ibf>=GIFBUFTAM){ - // FW 06/02/98 >>> - ibfmax = file->Read( buf , 1 , GIFBUFTAM) ; - if( ibfmax < GIFBUFTAM ) buf[ ibfmax ] = 255 ; - // FW 06/02/98 <<< - ibf = 0; - } - if (ibf>=ibfmax) return -1; // avoid overflows - return buf[ibf++]; -} -//////////////////////////////////////////////////////////////////////////////// -/* - This function takes a full line of pixels (one BYTE per pixel) and - * displays them (or does whatever your program wants with them...). It - * should return zero, or negative if an error or some other event occurs - * which would require aborting the decode process... Note that the length - * passed will almost always be equal to the line length passed to the - * decoder function, with the sole exception occurring when an ending code - * occurs in an odd place in the GIF file... In any case, linelen will be - * equal to the number of pixels passed... -*/ -int CxImageGIF::out_line(CImageIterator* iter, unsigned char *pixels, int linelen) -{ - // for 1 & 4 bpp images, the pixels are compressed - if (head.biBitCount < 8){ - for(long x=0;x> 3); - if (head.biBitCount==4){ - pos = (BYTE)(4*(1-x%2)); - *iDst &= ~(0x0F<SetY(iheight-iypos-1); - iter->SetRow(pixels, linelen); - - if ((iypos += istep) >= iheight) { - do { - if (ipass++ > 0) istep /= 2; - iypos = istep / 2; - } - while (iypos > iheight); - } - return 0; - } else { - if (iter->ItOK()) { - iter->SetRow(pixels, linelen); - (void)iter->PrevRow(); - return 0; - } else { - // puts("chafeo"); - return -1; - } - } -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -// SaveFile - writes GIF87a gif file -// Randy Spann 6/15/97 -// R.Spann@ConnRiver.net -bool CxImageGIF::Encode(CxFile * fp) -{ - if (EncodeSafeCheck(fp)) return false; - - if(head.biBitCount > 8) { - //strcpy(info.szLastError,"GIF Images must be 8 bit or less"); - //return FALSE; - return EncodeRGB(fp); - } - - EncodeHeader(fp); - - EncodeExtension(fp); - - EncodeComment(fp); - - EncodeBody(fp); - - fp->PutC(';'); // Write the GIF file terminator - - return true; // done! -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImageGIF::Encode(CxFile * fp, CxImage ** pImages, int pagecount, bool bLocalColorMap) -{ - try{ - if (fp==NULL) throw "invalid file pointer"; - if (pImages==NULL || pagecount==0 || pImages[0]==NULL) throw "multipage GIF, no images!"; - - CxImageGIF ghost; - - //write the first image - ghost.Ghost(pImages[0]); - ghost.EncodeHeader(fp); - - if (m_loops!=1){ - ghost.SetLoops(max(0,m_loops-1)); - ghost.EncodeLoopExtension(fp); - } - - ghost.SetDisposalMethod(GetDisposalMethod()); - ghost.EncodeExtension(fp); - - EncodeComment(fp); - - ghost.EncodeBody(fp); - - for (int i=2; i<=pagecount; i++){ - if (pImages[i-1]==NULL) throw "Bad image pointer"; - ghost.Ghost(pImages[i-1]); - - ghost.SetDisposalMethod(GetDisposalMethod()); - ghost.EncodeExtension(fp); - - ghost.EncodeBody(fp,bLocalColorMap); - } - - fp->PutC(';'); // Write the GIF file terminator - - } catch (char *message) { - strncpy(info.szLastError,message,255); - return false; - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::EncodeHeader(CxFile *fp) -{ - fp->Write("GIF89a",1,6); //GIF Header - - Putword(head.biWidth,fp); //Logical screen descriptor - Putword(head.biHeight,fp); - - BYTE Flags; - if (head.biClrUsed==0){ - Flags=0x11; - } else { - Flags = 0x80; - Flags |=(head.biBitCount - 1) << 5; - Flags |=(head.biBitCount - 1); - } - - fp->PutC(Flags); //GIF "packed fields" - fp->PutC(0); //GIF "BackGround" - fp->PutC(0); //GIF "pixel aspect ratio" - - if (head.biClrUsed!=0){ - RGBQUAD* pPal = GetPalette(); - for(DWORD i=0; iPutC(pPal[i].rgbRed); - fp->PutC(pPal[i].rgbGreen); - fp->PutC(pPal[i].rgbBlue); - } - } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::EncodeExtension(CxFile *fp) -{ - // TRK BEGIN : transparency - fp->PutC('!'); - fp->PutC(TRANSPARENCY_CODE); - - gifgce.transpcolflag = (info.nBkgndIndex != -1) ? 1 : 0; - gifgce.userinputflag = 0; - gifgce.dispmeth = m_dispmeth; - gifgce.res = 0; - gifgce.delaytime = (WORD)info.dwFrameDelay; - gifgce.transpcolindex = (BYTE)info.nBkgndIndex; - fp->PutC(sizeof(gifgce)); - fp->Write(&gifgce, sizeof(gifgce), 1); - fp->PutC(0); - // TRK END -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::EncodeLoopExtension(CxFile *fp) -{ - fp->PutC('!'); //byte 1 : 33 (hex 0x21) GIF Extension code - fp->PutC(255); //byte 2 : 255 (hex 0xFF) Application Extension Label - fp->PutC(11); //byte 3 : 11 (hex (0x0B) Length of Application Block (eleven bytes of data to follow) - fp->Write("NETSCAPE2.0",11,1); - fp->PutC(3); //byte 15 : 3 (hex 0x03) Length of Data Sub-Block (three bytes of data to follow) - fp->PutC(1); //byte 16 : 1 (hex 0x01) - Putword(m_loops,fp); //bytes 17 to 18 : 0 to 65535, an unsigned integer in lo-hi byte format. - //This indicate the number of iterations the loop should be executed. - fp->PutC(0); //bytes 19 : 0 (hex 0x00) a Data Sub-block Terminator. -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::EncodeBody(CxFile *fp, bool bLocalColorMap) -{ - curx = 0; - cury = head.biHeight - 1; //because we read the image bottom to top - CountDown = (long)head.biWidth * (long)head.biHeight; - - fp->PutC(','); - - Putword(info.xOffset,fp); - Putword(info.yOffset,fp); - Putword(head.biWidth,fp); - Putword(head.biHeight,fp); - - BYTE Flags=0x00; //non-interlaced (0x40 = interlaced) (0x80 = LocalColorMap) - if (bLocalColorMap) { Flags|=0x80; Flags|=head.biBitCount-1; } - fp->PutC(Flags); - - if (bLocalColorMap){ - Flags|=0x87; - RGBQUAD* pPal = GetPalette(); - for(DWORD i=0; iPutC(pPal[i].rgbRed); - fp->PutC(pPal[i].rgbGreen); - fp->PutC(pPal[i].rgbBlue); - } - } - - int InitCodeSize = head.biBitCount <=1 ? 2 : head.biBitCount; - // Write out the initial code size - fp->PutC((BYTE)InitCodeSize); - - // Go and actually compress the data - switch (GetCodecOption(CXIMAGE_FORMAT_GIF)) - { - case 1: //uncompressed - compressNONE(InitCodeSize+1, fp); - break; - case 2: //RLE - compressRLE(InitCodeSize+1, fp); - break; - default: //LZW - compressLZW(InitCodeSize+1, fp); - } - - // Write out a Zero-length packet (to end the series) - fp->PutC(0); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::EncodeComment(CxFile *fp) -{ - unsigned long n = (unsigned long) strlen(m_comment); - if (n>255) n=255; - if (n) { - fp->PutC('!'); //extension code: - fp->PutC(254); //comment extension - fp->PutC((BYTE)n); //size of comment - fp->Write(m_comment,n,1); - fp->PutC(0); //block terminator - } -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImageGIF::EncodeRGB(CxFile *fp) -{ - EncodeHeader(fp); - -// EncodeLoopExtension(fp); - - EncodeComment(fp); - - unsigned long w,h; - w=h=0; - const long cellw = 17; - const long cellh = 15; - CxImageGIF tmp; - for (long y=0;yPutC(';'); // Write the GIF file terminator - - return true; // done! -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -// Return the next pixel from the image -// fix for 1 & 4 bpp images -int CxImageGIF::GifNextPixel( ) -{ - if( CountDown == 0 ) return EOF; - --CountDown; - int r = GetPixelIndex(curx,cury); - // Bump the current X position - ++curx; - if( curx == head.biWidth ){ - curx = 0; - cury--; //bottom to top - } - return r; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::Putword(int w, CxFile *fp ) -{ - fp->PutC((BYTE)(w & 0xff)); - fp->PutC((BYTE)((w / 256) & 0xff)); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::compressNONE( int init_bits, CxFile* outfile) -{ - register long c; - register long ent; - - // g_init_bits - initial number of bits - // g_outfile - pointer to output file - g_init_bits = init_bits; - g_outfile = outfile; - - // Set up the necessary values - cur_accum = cur_bits = clear_flg = 0; - maxcode = (short)MAXCODE(n_bits = g_init_bits); - code_int maxmaxcode = (code_int)1 << MAXBITSCODES; - - ClearCode = (1 << (init_bits - 1)); - EOFCode = ClearCode + 1; - free_ent = (short)(ClearCode + 2); - - a_count=0; - ent = GifNextPixel( ); - - output( (code_int)ClearCode ); - - while ( ent != EOF ) { - c = GifNextPixel(); - - output ( (code_int) ent ); - ent = c; - if ( free_ent < maxmaxcode ) { - free_ent++; - } else { - free_ent=(short)(ClearCode+2); - clear_flg=1; - output((code_int)ClearCode); - } - } - // Put out the final code. - output( (code_int) EOFCode ); -} -//////////////////////////////////////////////////////////////////////////////// - -/*************************************************************************** - * - * GIFCOMPR.C - LZW GIF Image compression routines - * - ***************************************************************************/ - -void CxImageGIF::compressLZW( int init_bits, CxFile* outfile) -{ - register long fcode; - register long c; - register long ent; - register long hshift; - register long disp; - register long i; - - // g_init_bits - initial number of bits - // g_outfile - pointer to output file - g_init_bits = init_bits; - g_outfile = outfile; - - // Set up the necessary values - cur_accum = cur_bits = clear_flg = 0; - maxcode = (short)MAXCODE(n_bits = g_init_bits); - code_int maxmaxcode = (code_int)1 << MAXBITSCODES; - - ClearCode = (1 << (init_bits - 1)); - EOFCode = ClearCode + 1; - free_ent = (short)(ClearCode + 2); - - a_count=0; - ent = GifNextPixel( ); - - hshift = 0; - for ( fcode = (long) HSIZE; fcode < 65536L; fcode *= 2L ) ++hshift; - hshift = 8 - hshift; /* set hash code range bound */ - cl_hash((long)HSIZE); /* clear hash table */ - output( (code_int)ClearCode ); - - while ( (c = GifNextPixel( )) != EOF ) { - - fcode = (long) (((long) c << MAXBITSCODES) + ent); - i = (((code_int)c << hshift) ^ ent); /* xor hashing */ - - if ( HashTabOf (i) == fcode ) { - ent = CodeTabOf (i); - continue; - } else if ( (long)HashTabOf (i) < 0 ) /* empty slot */ - goto nomatch; - disp = HSIZE - i; /* secondary hash (after G. Knott) */ - if ( i == 0 ) disp = 1; -probe: - if ( (i -= disp) < 0 ) i += HSIZE; - if ( HashTabOf (i) == fcode ) { ent = CodeTabOf (i); continue; } - if ( (long)HashTabOf (i) > 0 ) goto probe; -nomatch: - output ( (code_int) ent ); - ent = c; - if ( free_ent < maxmaxcode ) { - CodeTabOf (i) = free_ent++; /* code -> hashtable */ - HashTabOf (i) = fcode; - } else { - cl_hash((long)HSIZE); - free_ent=(short)(ClearCode+2); - clear_flg=1; - output((code_int)ClearCode); - } - } - // Put out the final code. - output( (code_int)ent ); - output( (code_int) EOFCode ); -} -//////////////////////////////////////////////////////////////////////////////// - -static const unsigned long code_mask[] = { 0x0000, 0x0001, 0x0003, 0x0007, 0x000F, - 0x001F, 0x003F, 0x007F, 0x00FF, - 0x01FF, 0x03FF, 0x07FF, 0x0FFF, - 0x1FFF, 0x3FFF, 0x7FFF, 0xFFFF }; - -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::output( code_int code) -{ - cur_accum &= code_mask[ cur_bits ]; - - if( cur_bits > 0 ) - cur_accum |= ((long)code << cur_bits); - else - cur_accum = code; - - cur_bits += n_bits; - - while( cur_bits >= 8 ) { - char_out( (unsigned int)(cur_accum & 0xff) ); - cur_accum >>= 8; - cur_bits -= 8; - } - - /* - * If the next entry is going to be too big for the code size, - * then increase it, if possible. - */ - - if ( free_ent > maxcode || clear_flg ) { - if( clear_flg ) { - maxcode = (short)MAXCODE(n_bits = g_init_bits); - clear_flg = 0; - } else { - ++n_bits; - if ( n_bits == MAXBITSCODES ) - maxcode = (code_int)1 << MAXBITSCODES; /* should NEVER generate this code */ - else - maxcode = (short)MAXCODE(n_bits); - } - } - - if( code == EOFCode ) { - // At EOF, write the rest of the buffer. - while( cur_bits > 0 ) { - char_out( (unsigned int)(cur_accum & 0xff) ); - cur_accum >>= 8; - cur_bits -= 8; - } - - flush_char(); - g_outfile->Flush(); - - if(g_outfile->Error()) strcpy(info.szLastError,"Write Error in GIF file"); - } -} -//////////////////////////////////////////////////////////////////////////////// - -void CxImageGIF::cl_hash(register long hsize) - -{ - register long *htab_p = htab+hsize; - - register long i; - register long m1 = -1L; - - i = hsize - 16; - - do { - *(htab_p-16)=m1; - *(htab_p-15)=m1; - *(htab_p-14)=m1; - *(htab_p-13)=m1; - *(htab_p-12)=m1; - *(htab_p-11)=m1; - *(htab_p-10)=m1; - *(htab_p-9)=m1; - *(htab_p-8)=m1; - *(htab_p-7)=m1; - *(htab_p-6)=m1; - *(htab_p-5)=m1; - *(htab_p-4)=m1; - *(htab_p-3)=m1; - *(htab_p-2)=m1; - *(htab_p-1)=m1; - - htab_p-=16; - } while ((i-=16) >=0); - - for (i+=16;i>0;--i) - *--htab_p=m1; -} - -/******************************************************************************* -* GIF specific -*******************************************************************************/ - -void CxImageGIF::char_out(int c) -{ - accum[a_count++]=(char)c; - if (a_count >=254) - flush_char(); -} - -void CxImageGIF::flush_char() -{ - if (a_count > 0) { - g_outfile->PutC((BYTE)a_count); - g_outfile->Write(accum,1,a_count); - a_count=0; - } -} - -/******************************************************************************* -* GIF decoder -*******************************************************************************/ -/* DECODE.C - An LZW decoder for GIF - * Copyright (C) 1987, by Steven A. Bennett - * Copyright (C) 1994, C++ version by Alejandro Aguilar Sierra -* - * Permission is given by the author to freely redistribute and include - * this code in any program as long as this credit is given where due. - * - * In accordance with the above, I want to credit Steve Wilhite who wrote - * the code which this is heavily inspired by... - * - * GIF and 'Graphics Interchange Format' are trademarks (tm) of - * Compuserve, Incorporated, an H&R Block Company. - * - * Release Notes: This file contains a decoder routine for GIF images - * which is similar, structurally, to the original routine by Steve Wilhite. - * It is, however, somewhat noticably faster in most cases. - * - */ - -//////////////////////////////////////////////////////////////////////////////// - -short CxImageGIF::init_exp(short size) -{ - curr_size = (short)(size + 1); - top_slot = (short)(1 << curr_size); - clear = (short)(1 << size); - ending = (short)(clear + 1); - slot = newcodes = (short)(ending + 1); - navail_bytes = nbits_left = 0; - - memset(stack,0,MAX_CODES + 1); - memset(prefix,0,MAX_CODES + 1); - memset(suffix,0,MAX_CODES + 1); - return(0); -} -//////////////////////////////////////////////////////////////////////////////// - -/* get_next_code() - * - gets the next code from the GIF file. Returns the code, or else - * a negative number in case of file errors... - */ -short CxImageGIF::get_next_code(CxFile* file) -{ - short i, x; - DWORD ret; - - if (nbits_left == 0) { - if (navail_bytes <= 0) { - /* Out of bytes in current block, so read next block */ - pbytes = byte_buff; - if ((navail_bytes = (short)get_byte(file)) < 0) - return(navail_bytes); - else if (navail_bytes) { - for (i = 0; i < navail_bytes; ++i) { - if ((x = (short)get_byte(file)) < 0) return(x); - byte_buff[i] = (BYTE)x; - } - } - } - b1 = *pbytes++; - nbits_left = 8; - --navail_bytes; - } - - if (navail_bytes<0) return ending; // prevent deadlocks (thanks to Mike Melnikov) - - ret = b1 >> (8 - nbits_left); - while (curr_size > nbits_left){ - if (navail_bytes <= 0){ - /* Out of bytes in current block, so read next block*/ - pbytes = byte_buff; - if ((navail_bytes = (short)get_byte(file)) < 0) - return(navail_bytes); - else if (navail_bytes){ - for (i = 0; i < navail_bytes; ++i){ - if ((x = (short)get_byte(file)) < 0) return(x); - byte_buff[i] = (BYTE)x; - } - } - } - b1 = *pbytes++; - ret |= b1 << nbits_left; - nbits_left += 8; - --navail_bytes; - } - nbits_left = (short)(nbits_left-curr_size); - ret &= code_mask[curr_size]; - return((short)(ret)); -} -//////////////////////////////////////////////////////////////////////////////// - -/* short decoder(linewidth) - * short linewidth; * Pixels per line of image * - * - * - This function decodes an LZW image, according to the method used - * in the GIF spec. Every *linewidth* "characters" (ie. pixels) decoded - * will generate a call to out_line(), which is a user specific function - * to display a line of pixels. The function gets it's codes from - * get_next_code() which is responsible for reading blocks of data and - * seperating them into the proper size codes. Finally, get_byte() is - * the global routine to read the next BYTE from the GIF file. - * - * It is generally a good idea to have linewidth correspond to the actual - * width of a line (as specified in the Image header) to make your own - * code a bit simpler, but it isn't absolutely necessary. - * - * Returns: 0 if successful, else negative. (See ERRS.H) - * - */ -/* bad_code_count is incremented each time an out of range code is read. - * When this value is non-zero after a decode, your GIF file is probably - * corrupt in some way... - */ -short CxImageGIF::decoder(CxFile* file, CImageIterator* iter, short linewidth, int &bad_code_count) -{ - register BYTE *sp, *bufptr; - BYTE *buf; - register short code, fc, oc, bufcnt; - short c, size, ret; - - /* Initialize for decoding a new image... */ - bad_code_count = 0; - if ((size = (short)get_byte(file)) < 0) return(size); - if (size < 2 || 9 < size) return(BAD_CODE_SIZE); - // out_line = outline; - init_exp(size); - //printf("L %d %x\n",linewidth,size); - - /* Initialize in case they forgot to put in a clear code. - * (This shouldn't happen, but we'll try and decode it anyway...) - */ - oc = fc = 0; - - /* Allocate space for the decode buffer */ - if ((buf = new BYTE[linewidth + 1]) == NULL) return(OUT_OF_MEMORY); - - /* Set up the stack pointer and decode buffer pointer */ - sp = stack; - bufptr = buf; - bufcnt = linewidth; - - /* This is the main loop. For each code we get we pass through the - * linked list of prefix codes, pushing the corresponding "character" for - * each code onto the stack. When the list reaches a single "character" - * we push that on the stack too, and then start unstacking each - * character for output in the correct order. Special handling is - * included for the clear code, and the whole thing ends when we get - * an ending code. - */ - while ((c = get_next_code(file)) != ending) { - /* If we had a file error, return without completing the decode*/ - if (c < 0){ - delete[] buf; - return(0); - } - /* If the code is a clear code, reinitialize all necessary items.*/ - if (c == clear){ - curr_size = (short)(size + 1); - slot = newcodes; - top_slot = (short)(1 << curr_size); - - /* Continue reading codes until we get a non-clear code - * (Another unlikely, but possible case...) - */ - while ((c = get_next_code(file)) == clear); - - /* If we get an ending code immediately after a clear code - * (Yet another unlikely case), then break out of the loop. - */ - if (c == ending) break; - - /* Finally, if the code is beyond the range of already set codes, - * (This one had better NOT happen... I have no idea what will - * result from this, but I doubt it will look good...) then set it - * to color zero. - */ - if (c >= slot) c = 0; - oc = fc = c; - - /* And let us not forget to put the char into the buffer... And - * if, on the off chance, we were exactly one pixel from the end - * of the line, we have to send the buffer to the out_line() - * routine... - */ - *bufptr++ = (BYTE)c; - if (--bufcnt == 0) { - if ((ret = (short)out_line(iter, buf, linewidth)) < 0) { - delete[] buf; - return(ret); - } - bufptr = buf; - bufcnt = linewidth; - } - } else { - /* In this case, it's not a clear code or an ending code, so - * it must be a code code... So we can now decode the code into - * a stack of character codes. (Clear as mud, right?) - */ - code = c; - - /* Here we go again with one of those off chances... If, on the - * off chance, the code we got is beyond the range of those already - * set up (Another thing which had better NOT happen...) we trick - * the decoder into thinking it actually got the last code read. - * (Hmmn... I'm not sure why this works... But it does...) - */ - if (code >= slot) { - if (code > slot) ++bad_code_count; - code = oc; - *sp++ = (BYTE)fc; - } - - /* Here we scan back along the linked list of prefixes, pushing - * helpless characters (ie. suffixes) onto the stack as we do so. - */ - while (code >= newcodes) { - *sp++ = suffix[code]; - code = prefix[code]; - } - - /* Push the last character on the stack, and set up the new - * prefix and suffix, and if the required slot number is greater - * than that allowed by the current bit size, increase the bit - * size. (NOTE - If we are all full, we *don't* save the new - * suffix and prefix... I'm not certain if this is correct... - * it might be more proper to overwrite the last code... - */ - *sp++ = (BYTE)code; - if (slot < top_slot){ - suffix[slot] = (BYTE)(fc = (BYTE)code); - prefix[slot++] = oc; - oc = c; - } - if (slot >= top_slot){ - if (curr_size < 12) { - top_slot <<= 1; - ++curr_size; - } - } - - /* Now that we've pushed the decoded string (in reverse order) - * onto the stack, lets pop it off and put it into our decode - * buffer... And when the decode buffer is full, write another - * line... - */ - while (sp > stack) { - *bufptr++ = *(--sp); - if (--bufcnt == 0) { - if ((ret = (short)out_line(iter, buf, linewidth)) < 0) { - delete[] buf; - return(ret); - } - bufptr = buf; - bufcnt = linewidth; - } - } - } - } - ret = 0; - if (bufcnt != linewidth) - ret = (short)out_line(iter, buf, (linewidth - bufcnt)); - delete[] buf; - return(ret); -} -//////////////////////////////////////////////////////////////////////////////// -int CxImageGIF::get_num_frames(CxFile *fp,struct_TabCol* TabColSrc,struct_dscgif* dscgif) -{ - struct_image image; - - long pos=fp->Tell(); - int nframes=0; - - struct_TabCol TempTabCol; - memcpy(&TempTabCol,TabColSrc,sizeof(struct_TabCol)); - - char ch; - bool bPreviousWasNull = true; - - for (BOOL bContinue = TRUE; bContinue; ) - { - if (fp->Read(&ch, sizeof(ch), 1) != 1) {break;} - - if (bPreviousWasNull || ch==0) - { - switch (ch) - { - case '!': // extension - { - DecodeExtension(fp); - break; - } - case ',': // image - { - - assert(sizeof(image) == 9); - //log << "Image header" << endl; - fp->Read(&image,sizeof(image),1); - - //avoid byte order problems with Solaris - BYTE *byteData = (BYTE *) & image; - image.l = byteData[0]+byteData[1]*256; - image.t = byteData[2]+byteData[3]*256; - image.w = byteData[4]+byteData[5]*256; - image.h = byteData[6]+byteData[7]*256; - - if (((image.l + image.w) > dscgif->scrwidth)||((image.t + image.h) > dscgif->scrheight)) - break; - - nframes++; - - // Local colour map? - if (image.pf & 0x80) { - TempTabCol.sogct = (short)(1 << ((image.pf & 0x07) +1)); - assert(3 == sizeof(struct rgb_color)); - fp->Read(TempTabCol.paleta,sizeof(struct rgb_color)*TempTabCol.sogct,1); - //log << "Local colour map" << endl; - } - - int bpp; // select the correct bit per pixel value - if (TempTabCol.sogct <= 2) bpp = 1; - else if (TempTabCol.sogct <= 16) bpp = 4; - else bpp = 8; - - Create(image.w, image.h, bpp, CXIMAGE_FORMAT_GIF); - - CImageIterator* iter = new CImageIterator(this); - iter->Upset(); - int badcode=0; - ibf = GIFBUFTAM+1; - - interlaced = image.pf & 0x40; - iheight = image.h; - istep = 8; - iypos = 0; - ipass = 0; - - long pos_start = fp->Tell(); - - //if (interlaced) log << "Interlaced" << endl; - decoder(fp, iter, image.w, badcode); - delete iter; - - if (badcode){ - seek_next_image(fp,pos_start); - } else { - fp->Seek(-(ibfmax - ibf - 1), SEEK_CUR); - } - - break; - } - case ';': //terminator - bContinue=false; - break; - default: - bPreviousWasNull = (ch==0); - break; - } - } - } - - fp->Seek(pos,SEEK_SET); - return nframes; -} -//////////////////////////////////////////////////////////////////////////////// -long CxImageGIF::seek_next_image(CxFile* fp, long position) -{ - fp->Seek(position, SEEK_SET); - char ch1,ch2; - ch1=ch2=0; - while(fp->Read(&ch2,sizeof(char),1)>0){ - if (ch1 == 0 && ch2 == ','){ - fp->Seek(-1,SEEK_CUR); - return fp->Tell(); - } else { - ch1 = ch2; - } - } - return -1; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::SetDisposalMethod(int dm) -{ m_dispmeth=dm; } -//////////////////////////////////////////////////////////////////////////////// -long CxImageGIF::GetDisposalMethod() -{ return m_dispmeth; } -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::SetLoops(int loops) -{ m_loops=loops; } -//////////////////////////////////////////////////////////////////////////////// -long CxImageGIF::GetLoops() -{ return m_loops; } -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::SetComment(const char* sz_comment_in) -{ if (sz_comment_in) strncpy(m_comment,sz_comment_in,255); } -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::GetComment(char* sz_comment_out) -{ if (sz_comment_out) strncpy(sz_comment_out,m_comment,255); } -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::GifMix(CxImage & imgsrc2, struct_image & imgdesc) -{ - long ymin = max(0,(long)(GetHeight()-imgdesc.t - imgdesc.h)); - long ymax = GetHeight()-imgdesc.t; - long xmin = imgdesc.l; - long xmax = min(GetWidth(), (DWORD)(imgdesc.l + imgdesc.w)); - - long ibg2= imgsrc2.GetTransIndex(); - BYTE i2; - - for(long y = ymin; y < ymax; y++){ - for(long x = xmin; x < xmax; x++){ - i2 = imgsrc2.GetPixelIndex(x-xmin,y-ymin); - if(i2!=ibg2) SetPixelIndex(x,y,i2); - } - } -} -//////////////////////////////////////////////////////////////////////////////// -/*----------------------------------------------------------------------- - * - * miGIF Compression - mouse and ivo's GIF-compatible compression - * - * -run length encoding compression routines- - * - * Copyright (C) 1998 Hutchison Avenue Software Corporation - * http://www.hasc.com - * info@hasc.com - * - * Permission to use, copy, modify, and distribute this software and its - * documentation for any purpose and without fee is hereby granted, provided - * that the above copyright notice appear in all copies and that both that - * copyright notice and this permission notice appear in supporting - * documentation. This software is provided "AS IS." The Hutchison Avenue - * Software Corporation disclaims all warranties, either express or implied, - * including but not limited to implied warranties of merchantability and - * fitness for a particular purpose, with respect to this code and accompanying - * documentation. - * - * The miGIF compression routines do not, strictly speaking, generate files - * conforming to the GIF spec, since the image data is not LZW-compressed - * (this is the point: in order to avoid transgression of the Unisys patent - * on the LZW algorithm.) However, miGIF generates data streams that any - * reasonably sane LZW decompresser will decompress to what we want. - * - * miGIF compression uses run length encoding. It compresses horizontal runs - * of pixels of the same color. This type of compression gives good results - * on images with many runs, for example images with lines, text and solid - * shapes on a solid-colored background. It gives little or no compression - * on images with few runs, for example digital or scanned photos. - * - * der Mouse - * mouse@rodents.montreal.qc.ca - * 7D C8 61 52 5D E7 2D 39 4E F1 31 3E E8 B3 27 4B - * - * ivo@hasc.com - * - * The Graphics Interchange Format(c) is the Copyright property of - * CompuServe Incorporated. GIF(sm) is a Service Mark property of - * CompuServe Incorporated. - * - */ -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_clear(struct_RLE* rle) -{ - rle->out_bits = rle->out_bits_init; - rle->out_bump = rle->out_bump_init; - rle->out_clear = rle->out_clear_init; - rle->out_count = 0; - rle->rl_table_max = 0; - rle->just_cleared = 1; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_flush(struct_RLE* rle) -{ - if (rle->rl_count == 1){ - rle_output_plain(rle->rl_pixel,rle); - rle->rl_count = 0; - return; - } - if (rle->just_cleared){ - rle_flush_fromclear(rle->rl_count,rle); - } else if ((rle->rl_table_max < 2) || (rle->rl_table_pixel != rle->rl_pixel)) { - rle_flush_clearorrep(rle->rl_count,rle); - } else { - rle_flush_withtable(rle->rl_count,rle); - } - rle->rl_count = 0; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_output_plain(int c,struct_RLE* rle) -{ - rle->just_cleared = 0; - rle_output(c,rle); - rle->out_count++; - if (rle->out_count >= rle->out_bump){ - rle->out_bits ++; - rle->out_bump += 1 << (rle->out_bits - 1); - } - if (rle->out_count >= rle->out_clear){ - rle_output(rle->code_clear,rle); - rle_clear(rle); - } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_flush_fromclear(int count,struct_RLE* rle) -{ - int n; - - rle->out_clear = rle->max_ocodes; - rle->rl_table_pixel = rle->rl_pixel; - n = 1; - while (count > 0){ - if (n == 1){ - rle->rl_table_max = 1; - rle_output_plain(rle->rl_pixel,rle); - count --; - } else if (count >= n){ - rle->rl_table_max = n; - rle_output_plain(rle->rl_basecode+n-2,rle); - count -= n; - } else if (count == 1){ - rle->rl_table_max ++; - rle_output_plain(rle->rl_pixel,rle); - count = 0; - } else { - rle->rl_table_max ++; - rle_output_plain(rle->rl_basecode+count-2,rle); - count = 0; - } - if (rle->out_count == 0) n = 1; else n ++; - } - rle_reset_out_clear(rle); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_reset_out_clear(struct_RLE* rle) -{ - rle->out_clear = rle->out_clear_init; - if (rle->out_count >= rle->out_clear){ - rle_output(rle->code_clear,rle); - rle_clear(rle); - } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_flush_withtable(int count, struct_RLE* rle) -{ - int repmax; - int repleft; - int leftover; - - repmax = count / rle->rl_table_max; - leftover = count % rle->rl_table_max; - repleft = (leftover ? 1 : 0); - if (rle->out_count+repmax+repleft > rle->max_ocodes){ - repmax = rle->max_ocodes - rle->out_count; - leftover = count - (repmax * rle->rl_table_max); - repleft = 1 + rle_compute_triangle_count(leftover,rle->max_ocodes); - } - if (1+rle_compute_triangle_count(count,rle->max_ocodes) < (unsigned int)(repmax+repleft)){ - rle_output(rle->code_clear,rle); - rle_clear(rle); - rle_flush_fromclear(count,rle); - return; - } - rle->out_clear = rle->max_ocodes; - for (;repmax>0;repmax--) rle_output_plain(rle->rl_basecode+rle->rl_table_max-2,rle); - if (leftover){ - if (rle->just_cleared){ - rle_flush_fromclear(leftover,rle); - } else if (leftover == 1){ - rle_output_plain(rle->rl_pixel,rle); - } else { - rle_output_plain(rle->rl_basecode+leftover-2,rle); - } - } - rle_reset_out_clear(rle); -} -//////////////////////////////////////////////////////////////////////////////// -unsigned int CxImageGIF::rle_compute_triangle_count(unsigned int count, unsigned int nrepcodes) -{ - unsigned int perrep; - unsigned int cost; - - cost = 0; - perrep = (nrepcodes * (nrepcodes+1)) / 2; - while (count >= perrep){ - cost += nrepcodes; - count -= perrep; - } - if (count > 0){ - unsigned int n; - n = rle_isqrt(count); - while ((n*(n+1)) >= 2*count) n --; - while ((n*(n+1)) < 2*count) n ++; - cost += n; - } - return(cost); -} -//////////////////////////////////////////////////////////////////////////////// -unsigned int CxImageGIF::rle_isqrt(unsigned int x) -{ - unsigned int r; - unsigned int v; - - if (x < 2) return(x); - for (v=x,r=1;v;v>>=2,r<<=1) ; - while (1){ - v = ((x / r) + r) / 2; - if ((v == r) || (v == r+1)) return(r); - r = v; - } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_flush_clearorrep(int count, struct_RLE* rle) -{ - int withclr; - withclr = 1 + rle_compute_triangle_count(count,rle->max_ocodes); - if (withclr < count) { - rle_output(rle->code_clear,rle); - rle_clear(rle); - rle_flush_fromclear(count,rle); - } else { - for (;count>0;count--) rle_output_plain(rle->rl_pixel,rle); - } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_write_block(struct_RLE* rle) -{ - g_outfile->PutC((BYTE)rle->oblen); - g_outfile->Write(rle->oblock,1,rle->oblen); - rle->oblen = 0; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_block_out(unsigned char c, struct_RLE* rle) -{ - rle->oblock[rle->oblen++] = c; - if (rle->oblen >= 255) rle_write_block(rle); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_block_flush(struct_RLE* rle) -{ - if (rle->oblen > 0) rle_write_block(rle); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_output(int val, struct_RLE* rle) -{ - rle->obuf |= val << rle->obits; - rle->obits += rle->out_bits; - while (rle->obits >= 8){ - rle_block_out(rle->obuf&0xff,rle); - rle->obuf >>= 8; - rle->obits -= 8; - } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::rle_output_flush(struct_RLE* rle) -{ - if (rle->obits > 0) rle_block_out(rle->obuf,rle); - rle_block_flush(rle); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageGIF::compressRLE( int init_bits, CxFile* outfile) -{ - g_init_bits = init_bits; - g_outfile = outfile; - - struct_RLE rle; - rle.code_clear = 1 << (init_bits - 1); - rle.code_eof = rle.code_clear + 1; - rle.rl_basecode = rle.code_eof + 1; - rle.out_bump_init = (1 << (init_bits - 1)) - 1; - rle.out_clear_init = (init_bits <= 3) ? 9 : (rle.out_bump_init-1); - rle.out_bits_init = init_bits; - rle.max_ocodes = (1 << MAXBITSCODES) - ((1 << (rle.out_bits_init - 1)) + 3); - rle.rl_count = 0; - rle_clear(&rle); - rle.obuf = 0; - rle.obits = 0; - rle.oblen = 0; - - rle_output(rle.code_clear,&rle); - - int c; - while (1){ - c = GifNextPixel(); - if ((rle.rl_count > 0) && (c != rle.rl_pixel)) rle_flush(&rle); - if (c == EOF) break; - if (rle.rl_pixel == c){ - rle.rl_count++; - } else { - rle.rl_pixel = c; - rle.rl_count = 1; - } - } - rle_output(rle.code_eof,&rle); - rle_output_flush(&rle); -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_GIF diff --git a/src/win32/dependencies/cximage/ximagif.h b/src/win32/dependencies/cximage/ximagif.h deleted file mode 100644 index cd4f4516..00000000 --- a/src/win32/dependencies/cximage/ximagif.h +++ /dev/null @@ -1,248 +0,0 @@ -/* - * File: ximagif.h - * Purpose: GIF Image Class Loader and Writer - */ -/* ========================================================== - * CxImageGIF (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes - * - * original CImageGIF and CImageIterator implementation are: - * Copyright: (c) 1995, Alejandro Aguilar Sierra - * - * 6/15/97 Randy Spann: Added GIF87a writing support - * R.Spann@ConnRiver.net - * - * DECODE.C - An LZW decoder for GIF - * Copyright (C) 1987, by Steven A. Bennett - * Copyright (C) 1994, C++ version by Alejandro Aguilar Sierra - * - * In accordance with the above, I want to credit Steve Wilhite who wrote - * the code which this is heavily inspired by... - * - * GIF and 'Graphics Interchange Format' are trademarks (tm) of - * Compuserve, Incorporated, an H&R Block Company. - * - * Release Notes: This file contains a decoder routine for GIF images - * which is similar, structurally, to the original routine by Steve Wilhite. - * It is, however, somewhat noticably faster in most cases. - * - * ========================================================== - */ - -#if !defined(__ximaGIF_h) -#define __ximaGIF_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_GIF - -typedef short int code_int; - -/* Various error codes used by decoder */ -#define OUT_OF_MEMORY -10 -#define BAD_CODE_SIZE -20 -#define READ_ERROR -1 -#define WRITE_ERROR -2 -#define OPEN_ERROR -3 -#define CREATE_ERROR -4 -#define MAX_CODES 4095 -#define GIFBUFTAM 16383 -#define TRANSPARENCY_CODE 0xF9 - -//LZW GIF Image compression -#define MAXBITSCODES 12 -#define HSIZE 5003 /* 80% occupancy */ -#define MAXCODE(n_bits) (((code_int) 1 << (n_bits)) - 1) -#define HashTabOf(i) htab[i] -#define CodeTabOf(i) codetab[i] - - -class CImageIterator; -class DLL_EXP CxImageGIF: public CxImage -{ -#pragma pack(1) - -typedef struct tag_gifgce{ - BYTE transpcolflag:1; - BYTE userinputflag:1; - BYTE dispmeth:3; - BYTE res:3; - WORD delaytime; - BYTE transpcolindex; -} struct_gifgce; - -typedef struct tag_dscgif{ /* Logic Screen Descriptor */ - char header[6]; /* Firma and version */ - WORD scrwidth; - WORD scrheight; - char pflds; - char bcindx; - char pxasrat; -} struct_dscgif; - -typedef struct tag_image{ /* Image Descriptor */ - WORD l; - WORD t; - WORD w; - WORD h; - BYTE pf; -} struct_image; - -typedef struct tag_TabCol{ /* Tabla de colores */ - short colres; /* color resolution */ - short sogct; /* size of global color table */ - rgb_color paleta[256]; /* paleta */ -} struct_TabCol; - -typedef struct tag_RLE{ - int rl_pixel; - int rl_basecode; - int rl_count; - int rl_table_pixel; - int rl_table_max; - int just_cleared; - int out_bits; - int out_bits_init; - int out_count; - int out_bump; - int out_bump_init; - int out_clear; - int out_clear_init; - int max_ocodes; - int code_clear; - int code_eof; - unsigned int obuf; - int obits; - unsigned char oblock[256]; - int oblen; -} struct_RLE; -#pragma pack() - -public: - CxImageGIF(): CxImage(CXIMAGE_FORMAT_GIF) {m_loops=0; m_dispmeth=0; m_comment[0]='\0';} - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_GIF);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_GIF);} - - bool Decode(CxFile * fp); - bool Decode(FILE *fp) { CxIOFile file(fp); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * fp); - bool Encode(CxFile * fp, CxImage ** pImages, int pagecount, bool bLocalColorMap = false); - bool Encode(FILE *fp) { CxIOFile file(fp); return Encode(&file); } - bool Encode(FILE *fp, CxImage ** pImages, int pagecount, bool bLocalColorMap = false) - { CxIOFile file(fp); return Encode(&file, pImages, pagecount, bLocalColorMap); } -#endif // CXIMAGE_SUPPORT_ENCODE - - void SetLoops(int loops); - long GetLoops(); - void SetComment(const char* sz_comment_in); - void GetComment(char* sz_comment_out); - void SetDisposalMethod(int dm); - long GetDisposalMethod(); - -protected: - bool DecodeExtension(CxFile *fp); - void EncodeHeader(CxFile *fp); - void EncodeLoopExtension(CxFile *fp); - void EncodeExtension(CxFile *fp); - void EncodeBody(CxFile *fp, bool bLocalColorMap = false); - void EncodeComment(CxFile *fp); - bool EncodeRGB(CxFile *fp); - void GifMix(CxImage & imgsrc2, struct_image & imgdesc); - - struct_gifgce gifgce; - - int curx, cury; - long CountDown; - unsigned long cur_accum; - int cur_bits; - int interlaced, iypos, istep, iheight, ipass; - int ibf; - int ibfmax; - BYTE buf[GIFBUFTAM + 1]; -// Implementation - int GifNextPixel (); - void Putword (int w, CxFile* fp ); - void compressNONE (int init_bits, CxFile* outfile); - void compressLZW (int init_bits, CxFile* outfile); - void output (code_int code ); - void cl_hash (long hsize); - void char_out (int c); - void flush_char (); - short init_exp(short size); - short get_next_code(CxFile*); - short decoder(CxFile*, CImageIterator* iter, short linewidth, int &bad_code_count); - int get_byte(CxFile*); - int out_line(CImageIterator* iter, unsigned char *pixels, int linelen); - int get_num_frames(CxFile *f,struct_TabCol* TabColSrc,struct_dscgif* dscgif); - long seek_next_image(CxFile* fp, long position); - - short curr_size; /* The current code size */ - short clear; /* Value for a clear code */ - short ending; /* Value for a ending code */ - short newcodes; /* First available code */ - short top_slot; /* Highest code for current size */ - short slot; /* Last read code */ - - /* The following static variables are used - * for seperating out codes */ - short navail_bytes; /* # bytes left in block */ - short nbits_left; /* # bits left in current BYTE */ - BYTE b1; /* Current BYTE */ - BYTE byte_buff[257]; /* Current block */ - BYTE *pbytes; /* Pointer to next BYTE in block */ - /* The reason we have these seperated like this instead of using - * a structure like the original Wilhite code did, is because this - * stuff generally produces significantly faster code when compiled... - * This code is full of similar speedups... (For a good book on writing - * C for speed or for space optomisation, see Efficient C by Tom Plum, - * published by Plum-Hall Associates...) - */ - BYTE stack[MAX_CODES + 1]; /* Stack for storing pixels */ - BYTE suffix[MAX_CODES + 1]; /* Suffix table */ - WORD prefix[MAX_CODES + 1]; /* Prefix linked list */ - -//LZW GIF Image compression routines - long htab [HSIZE]; - unsigned short codetab [HSIZE]; - int n_bits; /* number of bits/code */ - code_int maxcode; /* maximum code, given n_bits */ - code_int free_ent; /* first unused entry */ - int clear_flg; - int g_init_bits; - CxFile* g_outfile; - int ClearCode; - int EOFCode; - - int a_count; - char accum[256]; - - char m_comment[256]; - int m_loops; - int m_dispmeth; - -//RLE compression routines - void compressRLE( int init_bits, CxFile* outfile); - void rle_clear(struct_RLE* rle); - void rle_flush(struct_RLE* rle); - void rle_flush_withtable(int count, struct_RLE* rle); - void rle_flush_clearorrep(int count, struct_RLE* rle); - void rle_flush_fromclear(int count,struct_RLE* rle); - void rle_output_plain(int c,struct_RLE* rle); - void rle_reset_out_clear(struct_RLE* rle); - unsigned int rle_compute_triangle_count(unsigned int count, unsigned int nrepcodes); - unsigned int rle_isqrt(unsigned int x); - void rle_write_block(struct_RLE* rle); - void rle_block_out(unsigned char c, struct_RLE* rle); - void rle_block_flush(struct_RLE* rle); - void rle_output(int val, struct_RLE* rle); - void rle_output_flush(struct_RLE* rle); -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximahist.cpp b/src/win32/dependencies/cximage/ximahist.cpp deleted file mode 100644 index 8e3542f0..00000000 --- a/src/win32/dependencies/cximage/ximahist.cpp +++ /dev/null @@ -1,649 +0,0 @@ -// xImaHist.cpp : histogram functions -/* 28/01/2004 v1.00 - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_DSP - -//////////////////////////////////////////////////////////////////////////////// -long CxImage::Histogram(long* red, long* green, long* blue, long* gray, long colorspace) -{ - if (!pDib) return 0; - RGBQUAD color; - - if (red) memset(red,0,256*sizeof(long)); - if (green) memset(green,0,256*sizeof(long)); - if (blue) memset(blue,0,256*sizeof(long)); - if (gray) memset(gray,0,256*sizeof(long)); - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - - for(long y=ymin; yn) n=red[i]; - if (green && green[i]>n) n=green[i]; - if (blue && blue[i]>n) n=blue[i]; - if (gray && gray[i]>n) n=gray[i]; - } - - return n; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * HistogramStretch - * \param method: 0 = luminance (default), 1 = linked channels , 2 = independent channels. - * \return true if everything is ok - * \author [dave] and [nipper] - */ -bool CxImage::HistogramStretch(long method) -{ - if (!pDib) return false; - - if ((head.biBitCount==8) && IsGrayScale()){ - // get min/max info - BYTE minc = 255, maxc = 0; - BYTE gray; - long y; - - double dbScaler = 50.0/head.biHeight; - - for (y=0; y maxc) maxc = gray; - } - } - - if (minc == 0 && maxc == 255) return true; - - // calculate LUT - BYTE lut[256]; - BYTE range = maxc - minc; - if (range != 0){ - for (long x = minc; x <= maxc; x++){ - lut[x] = (BYTE)(255 * (x - minc) / range); - } - } else lut[minc] = minc; - - for (y=0; y - // get min/max info - BYTE minc = 255, maxc = 0; - RGBQUAD color; - long y; - - for (y=0; y maxc) maxc = color.rgbRed; - if (color.rgbBlue > maxc) maxc = color.rgbBlue; - if (color.rgbGreen > maxc) maxc = color.rgbGreen; - } - } - - if (minc == 0 && maxc == 255) - return true; - - // calculate LUT - BYTE lut[256]; - BYTE range = maxc - minc; - - if (range != 0){ - for (long x = minc; x <= maxc; x++){ - lut[x] = (BYTE)(255 * (x - minc) / range); - } - } else lut[minc] = minc; - - // normalize image - double dbScaler = 100.0/head.biHeight; - - for (y=0; y - // get min/max info - BYTE minR = 255, maxR = 0; - BYTE minG = 255, maxG = 0; - BYTE minB = 255, maxB = 0; - RGBQUAD color; - long y; - - for (y=0; y maxR) maxR = color.rgbRed; - if (color.rgbBlue > maxB) maxB = color.rgbBlue; - if (color.rgbGreen > maxG) maxG = color.rgbGreen; - } - } - - if (minR == 0 && maxR == 255 && minG == 0 && maxG == 255 && minB == 0 && maxB == 255) - return true; - - // calculate LUT - BYTE lutR[256]; - BYTE range = maxR - minR; - if (range != 0) { - for (long x = minR; x <= maxR; x++){ - lutR[x] = (BYTE)(255 * (x - minR) / range); - } - } else lutR[minR] = minR; - - BYTE lutG[256]; - range = maxG - minG; - if (range != 0) { - for (long x = minG; x <= maxG; x++){ - lutG[x] = (BYTE)(255 * (x - minG) / range); - } - } else lutG[minG] = minG; - - BYTE lutB[256]; - range = maxB - minB; - if (range != 0) { - for (long x = minB; x <= maxB; x++){ - lutB[x] = (BYTE)(255 * (x - minB) / range); - } - } else lutB[minB] = minB; - - // normalize image - double dbScaler = 100.0/head.biHeight; - - for (y=0; y - // S = ( R - C ) ( B - A / D - C ) - double alimit = 0.0; - double blimit = 255.0; - double lowerc = 255.0; - double upperd = 0.0; - double tmpGray; - - RGBQUAD color; - RGBQUAD yuvClr; - double stretcheds; - - if ( head.biClrUsed == 0 ){ - long x, y, xmin, xmax, ymin, ymax; - xmin = ymin = 0; - xmax = head.biWidth; - ymax = head.biHeight; - - for( y = ymin; y < ymax; y++ ){ - info.nProgress = (long)(50*y/ymax); - if (info.nEscape) break; - for( x = xmin; x < xmax; x++ ){ - color = GetPixelColor( x, y ); - tmpGray = RGB2GRAY(color.rgbRed, color.rgbGreen, color.rgbBlue); - if ( tmpGray < lowerc ) lowerc = tmpGray; - if ( tmpGray > upperd ) upperd = tmpGray; - } - } - if (upperd==lowerc) return false; - - for( y = ymin; y < ymax; y++ ){ - info.nProgress = (long)(50+50*y/ymax); - if (info.nEscape) break; - for( x = xmin; x < xmax; x++ ){ - - color = GetPixelColor( x, y ); - yuvClr = RGBtoYUV(color); - - // Stretch Luminance - tmpGray = (double)yuvClr.rgbRed; - stretcheds = (double)(tmpGray - lowerc) * ( (blimit - alimit) / (upperd - lowerc) ); // + alimit; - if ( stretcheds < 0.0 ) stretcheds = 0.0; - else if ( stretcheds > 255.0 ) stretcheds = 255.0; - yuvClr.rgbRed = (BYTE)stretcheds; - - color = YUVtoRGB(yuvClr); - SetPixelColor( x, y, color ); - } - } - } else { - DWORD j; - for( j = 0; j < head.biClrUsed; j++ ){ - color = GetPaletteColor( (BYTE)j ); - tmpGray = RGB2GRAY(color.rgbRed, color.rgbGreen, color.rgbBlue); - if ( tmpGray < lowerc ) lowerc = tmpGray; - if ( tmpGray > upperd ) upperd = tmpGray; - } - if (upperd==lowerc) return false; - - for( j = 0; j < head.biClrUsed; j++ ){ - - color = GetPaletteColor( (BYTE)j ); - yuvClr = RGBtoYUV( color ); - - // Stretch Luminance - tmpGray = (double)yuvClr.rgbRed; - stretcheds = (double)(tmpGray - lowerc) * ( (blimit - alimit) / (upperd - lowerc) ); // + alimit; - if ( stretcheds < 0.0 ) stretcheds = 0.0; - else if ( stretcheds > 255.0 ) stretcheds = 255.0; - yuvClr.rgbRed = (BYTE)stretcheds; - - color = YUVtoRGB(yuvClr); - SetPaletteColor( (BYTE)j, color ); - } - } - } - } - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -// HistogramEqualize function by : dave(at)posortho(dot)com -bool CxImage::HistogramEqualize() -{ - if (!pDib) return false; - - int histogram[256]; - int map[256]; - int equalize_map[256]; - int x, y, i, j; - RGBQUAD color; - RGBQUAD yuvClr; - unsigned int YVal, high, low; - - memset( &histogram, 0, sizeof(int) * 256 ); - memset( &map, 0, sizeof(int) * 256 ); - memset( &equalize_map, 0, sizeof(int) * 256 ); - - // form histogram - for(y=0; y < head.biHeight; y++){ - info.nProgress = (long)(50*y/head.biHeight); - if (info.nEscape) break; - for(x=0; x < head.biWidth; x++){ - color = GetPixelColor( x, y ); - YVal = (unsigned int)RGB2GRAY(color.rgbRed, color.rgbGreen, color.rgbBlue); - histogram[YVal]++; - } - } - - // integrate the histogram to get the equalization map. - j = 0; - for(i=0; i <= 255; i++){ - j += histogram[i]; - map[i] = j; - } - - // equalize - low = map[0]; - high = map[255]; - if (low == high) return false; - for( i = 0; i <= 255; i++ ){ - equalize_map[i] = (unsigned int)((((double)( map[i] - low ) ) * 255) / ( high - low ) ); - } - - // stretch the histogram - if(head.biClrUsed == 0){ // No Palette - for( y = 0; y < head.biHeight; y++ ){ - info.nProgress = (long)(50+50*y/head.biHeight); - if (info.nEscape) break; - for( x = 0; x < head.biWidth; x++ ){ - - color = GetPixelColor( x, y ); - yuvClr = RGBtoYUV(color); - - yuvClr.rgbRed = (BYTE)equalize_map[yuvClr.rgbRed]; - - color = YUVtoRGB(yuvClr); - SetPixelColor( x, y, color ); - } - } - } else { // Palette - for( i = 0; i < (int)head.biClrUsed; i++ ){ - - color = GetPaletteColor((BYTE)i); - yuvClr = RGBtoYUV(color); - - yuvClr.rgbRed = (BYTE)equalize_map[yuvClr.rgbRed]; - - color = YUVtoRGB(yuvClr); - SetPaletteColor( (BYTE)i, color ); - } - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -// HistogramNormalize function by : dave(at)posortho(dot)com -bool CxImage::HistogramNormalize() -{ - if (!pDib) return false; - - int histogram[256]; - int threshold_intensity, intense; - int x, y, i; - unsigned int normalize_map[256]; - unsigned int high, low, YVal; - - RGBQUAD color; - RGBQUAD yuvClr; - - memset( &histogram, 0, sizeof( int ) * 256 ); - memset( &normalize_map, 0, sizeof( unsigned int ) * 256 ); - - // form histogram - for(y=0; y < head.biHeight; y++){ - info.nProgress = (long)(50*y/head.biHeight); - if (info.nEscape) break; - for(x=0; x < head.biWidth; x++){ - color = GetPixelColor( x, y ); - YVal = (unsigned int)RGB2GRAY(color.rgbRed, color.rgbGreen, color.rgbBlue); - histogram[YVal]++; - } - } - - // find histogram boundaries by locating the 1 percent levels - threshold_intensity = ( head.biWidth * head.biHeight) / 100; - - intense = 0; - for( low = 0; low < 255; low++ ){ - intense += histogram[low]; - if( intense > threshold_intensity ) break; - } - - intense = 0; - for( high = 255; high != 0; high--){ - intense += histogram[ high ]; - if( intense > threshold_intensity ) break; - } - - if ( low == high ){ - // Unreasonable contrast; use zero threshold to determine boundaries. - threshold_intensity = 0; - intense = 0; - for( low = 0; low < 255; low++){ - intense += histogram[low]; - if( intense > threshold_intensity ) break; - } - intense = 0; - for( high = 255; high != 0; high-- ){ - intense += histogram [high ]; - if( intense > threshold_intensity ) break; - } - } - if( low == high ) return false; // zero span bound - - // Stretch the histogram to create the normalized image mapping. - for(i = 0; i <= 255; i++){ - if ( i < (int) low ){ - normalize_map[i] = 0; - } else { - if(i > (int) high) - normalize_map[i] = 255; - else - normalize_map[i] = ( 255 - 1) * ( i - low) / ( high - low ); - } - } - - // Normalize - if( head.biClrUsed == 0 ){ - for( y = 0; y < head.biHeight; y++ ){ - info.nProgress = (long)(50+50*y/head.biHeight); - if (info.nEscape) break; - for( x = 0; x < head.biWidth; x++ ){ - - color = GetPixelColor( x, y ); - yuvClr = RGBtoYUV( color ); - - yuvClr.rgbRed = (BYTE)normalize_map[yuvClr.rgbRed]; - - color = YUVtoRGB( yuvClr ); - SetPixelColor( x, y, color ); - } - } - } else { - for(i = 0; i < (int)head.biClrUsed; i++){ - - color = GetPaletteColor( (BYTE)i ); - yuvClr = RGBtoYUV( color ); - - yuvClr.rgbRed = (BYTE)normalize_map[yuvClr.rgbRed]; - - color = YUVtoRGB( yuvClr ); - SetPaletteColor( (BYTE)i, color ); - } - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -// HistogramLog function by : dave(at)posortho(dot)com -bool CxImage::HistogramLog() -{ - if (!pDib) return false; - - //q(i,j) = 255/log(1 + |high|) * log(1 + |p(i,j)|); - int x, y, i; - RGBQUAD color; - RGBQUAD yuvClr; - - unsigned int YVal, high = 1; - - // Find Highest Luminance Value in the Image - if( head.biClrUsed == 0 ){ // No Palette - for(y=0; y < head.biHeight; y++){ - info.nProgress = (long)(50*y/head.biHeight); - if (info.nEscape) break; - for(x=0; x < head.biWidth; x++){ - color = GetPixelColor( x, y ); - YVal = (unsigned int)RGB2GRAY(color.rgbRed, color.rgbGreen, color.rgbBlue); - if (YVal > high ) high = YVal; - } - } - } else { // Palette - for(i = 0; i < (int)head.biClrUsed; i++){ - color = GetPaletteColor((BYTE)i); - YVal = (unsigned int)RGB2GRAY(color.rgbRed, color.rgbGreen, color.rgbBlue); - if (YVal > high ) high = YVal; - } - } - - // Logarithm Operator - double k = 255.0 / ::log( 1.0 + (double)high ); - if( head.biClrUsed == 0 ){ - for( y = 0; y < head.biHeight; y++ ){ - info.nProgress = (long)(50+50*y/head.biHeight); - if (info.nEscape) break; - for( x = 0; x < head.biWidth; x++ ){ - - color = GetPixelColor( x, y ); - yuvClr = RGBtoYUV( color ); - - yuvClr.rgbRed = (BYTE)(k * ::log( 1.0 + (double)yuvClr.rgbRed ) ); - - color = YUVtoRGB( yuvClr ); - SetPixelColor( x, y, color ); - } - } - } else { - for(i = 0; i < (int)head.biClrUsed; i++){ - - color = GetPaletteColor( (BYTE)i ); - yuvClr = RGBtoYUV( color ); - - yuvClr.rgbRed = (BYTE)(k * ::log( 1.0 + (double)yuvClr.rgbRed ) ); - - color = YUVtoRGB( yuvClr ); - SetPaletteColor( (BYTE)i, color ); - } - } - - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -// HistogramRoot function by : dave(at)posortho(dot)com -bool CxImage::HistogramRoot() -{ - if (!pDib) return false; - //q(i,j) = sqrt(|p(i,j)|); - - int x, y, i; - RGBQUAD color; - RGBQUAD yuvClr; - double dtmp; - unsigned int YVal, high = 1; - - // Find Highest Luminance Value in the Image - if( head.biClrUsed == 0 ){ // No Palette - for(y=0; y < head.biHeight; y++){ - info.nProgress = (long)(50*y/head.biHeight); - if (info.nEscape) break; - for(x=0; x < head.biWidth; x++){ - color = GetPixelColor( x, y ); - YVal = (unsigned int)RGB2GRAY(color.rgbRed, color.rgbGreen, color.rgbBlue); - if (YVal > high ) high = YVal; - } - } - } else { // Palette - for(i = 0; i < (int)head.biClrUsed; i++){ - color = GetPaletteColor((BYTE)i); - YVal = (unsigned int)RGB2GRAY(color.rgbRed, color.rgbGreen, color.rgbBlue); - if (YVal > high ) high = YVal; - } - } - - // Root Operator - double k = 128.0 / ::log( 1.0 + (double)high ); - if( head.biClrUsed == 0 ){ - for( y = 0; y < head.biHeight; y++ ){ - info.nProgress = (long)(50+50*y/head.biHeight); - if (info.nEscape) break; - for( x = 0; x < head.biWidth; x++ ){ - - color = GetPixelColor( x, y ); - yuvClr = RGBtoYUV( color ); - - dtmp = k * ::sqrt( (double)yuvClr.rgbRed ); - if ( dtmp > 255.0 ) dtmp = 255.0; - if ( dtmp < 0 ) dtmp = 0; - yuvClr.rgbRed = (BYTE)dtmp; - - color = YUVtoRGB( yuvClr ); - SetPixelColor( x, y, color ); - } - } - } else { - for(i = 0; i < (int)head.biClrUsed; i++){ - - color = GetPaletteColor( (BYTE)i ); - yuvClr = RGBtoYUV( color ); - - dtmp = k * ::sqrt( (double)yuvClr.rgbRed ); - if ( dtmp > 255.0 ) dtmp = 255.0; - if ( dtmp < 0 ) dtmp = 0; - yuvClr.rgbRed = (BYTE)dtmp; - - color = YUVtoRGB( yuvClr ); - SetPaletteColor( (BYTE)i, color ); - } - } - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif diff --git a/src/win32/dependencies/cximage/ximaico.cpp b/src/win32/dependencies/cximage/ximaico.cpp deleted file mode 100644 index 4523ccf3..00000000 --- a/src/win32/dependencies/cximage/ximaico.cpp +++ /dev/null @@ -1,299 +0,0 @@ -/* - * File: ximaico.cpp - * Purpose: Platform Independent ICON Image Class Loader and Writer (MS version) - * 07/Aug/2001 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximaico.h" - -#if CXIMAGE_SUPPORT_ICO - -//////////////////////////////////////////////////////////////////////////////// -bool CxImageICO::Decode(CxFile *hFile) -{ - if (hFile==NULL) return false; - - DWORD off = hFile->Tell(); // - int page=info.nFrame; //internal icon structure indexes - - // read the first part of the header - ICONHEADER icon_header; - hFile->Read(&icon_header,sizeof(ICONHEADER),1); - // check if it's an icon or a cursor - if ((icon_header.idReserved == 0) && ((icon_header.idType == 1)||(icon_header.idType == 2))) { - - info.nNumFrames = icon_header.idCount; - - // load the icon descriptions - ICONDIRENTRY *icon_list = (ICONDIRENTRY *)malloc(icon_header.idCount * sizeof(ICONDIRENTRY)); - int c; - for (c = 0; c < icon_header.idCount; c++) - hFile->Read(icon_list + c, sizeof(ICONDIRENTRY), 1); - - if ((page>=0)&&(page - BITMAPINFOHEADER bih; - hFile->Seek(off + icon_list[page].dwImageOffset, SEEK_SET); - hFile->Read(&bih,sizeof(BITMAPINFOHEADER),1); - c = bih.biBitCount; - - // allocate memory for one icon - Create(icon_list[page].bWidth,icon_list[page].bHeight, c, CXIMAGE_FORMAT_ICO); //image creation - - // read the palette - RGBQUAD pal[256]; - hFile->Read(pal,head.biClrUsed*sizeof(RGBQUAD), 1); - SetPalette(pal,head.biClrUsed); //palette assign - - //read the icon - if (c<=24){ - hFile->Read(info.pImage, head.biSizeImage, 1); - } else { // 32 bit icon - BYTE* dst = info.pImage; - BYTE* buf=(BYTE*)malloc(4*head.biHeight*head.biWidth); - BYTE* src = buf; - hFile->Read(buf, 4*head.biHeight*head.biWidth, 1); -#if CXIMAGE_SUPPORT_ALPHA - if (!AlphaIsValid()) AlphaCreate(); -#endif //CXIMAGE_SUPPORT_ALPHA - for (long y = 0; y < head.biHeight; y++) { - for(long x=0;xRead(mask, masksize, 1)){ - - bool bGoodMask=false; - for (int im=0;im>3)]>>(7-x%8))&0x01)){ - AlphaSet(x,y,0); - bNeedAlpha=true; - } - } - } - if (!bNeedAlpha) AlphaDelete(); -#endif //CXIMAGE_SUPPORT_ALPHA - - if (c==24){ //check if there is only one transparent color - RGBQUAD cc,ct; - long* pcc = (long*)&cc; - long* pct = (long*)&ct; - int nTransColors=0; - for (int y = 0; y < head.biHeight; y++){ - for (int x = 0; x < head.biWidth; x++){ - if (((mask[y*maskwdt+(x>>3)] >> (7-x%8)) & 0x01)){ - cc = GetPixelColor(x,y,false); - if (nTransColors==0){ - nTransColors++; - ct = cc; - } else { - if (*pct!=*pcc){ - nTransColors++; - } - } - } - } - } - if (nTransColors==1){ - SetTransColor(ct); - SetTransIndex(0); -#if CXIMAGE_SUPPORT_ALPHA - AlphaDelete(); //because we have a unique transparent color in the image -#endif //CXIMAGE_SUPPORT_ALPHA - } - } - - // - Transparency support w/o Alpha support - if (c <= 8){ // only for icons with less than 256 colors (XP icons need alpha). - - // find a color index, which is not used in the image - // it is almost sure to find one, bcs. nobody uses all possible colors for an icon - - BYTE colorsUsed[256]; - memset(colorsUsed, 0, sizeof(colorsUsed)); - - for (int y = 0; y < head.biHeight; y++){ - for (int x = 0; x < head.biWidth; x++){ - colorsUsed[GetPixelIndex(x,y)] = 1; - } - } - - int iTransIdx = -1; - for (int x = 0; x < (int)head.biClrUsed; x++){ - if (colorsUsed[x] == 0){ - iTransIdx = x; // this one is not in use. we may use it as transparent color - break; - } - } - - // Go thru image and set unused color as transparent index if needed - if (iTransIdx >= 0){ - bool bNeedTrans = false; - for (int y = 0; y < head.biHeight; y++){ - for (int x = 0; x < head.biWidth; x++){ - // AND mask (Each Byte represents 8 Pixels) - if (((mask[y*maskwdt+(x>>3)] >> (7-x%8)) & 0x01)){ - // AND mask is set (!=0). This is a transparent part - SetPixelIndex(x, y, iTransIdx); - bNeedTrans = true; - } - } - } - // set transparent index if needed - if (bNeedTrans) SetTransIndex(iTransIdx); -#if CXIMAGE_SUPPORT_ALPHA - AlphaDelete(); //because we have a transparent color in the palette -#endif //CXIMAGE_SUPPORT_ALPHA - } - } - } else { - SetTransIndex(0); //empty mask, set black as transparent color - Negative(); - } - } - free(mask); - - free(icon_list); - // icon has been loaded successfully! - return true; - } - free(icon_list); - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageICO::Encode(CxFile * hFile) -{ - if (EncodeSafeCheck(hFile)) return false; - - //check format limits - if ((head.biWidth>255)||(head.biHeight>255)){ - strcpy(info.szLastError,"Can't save this image as icon"); - return false; - } - - //prepare the palette struct - RGBQUAD* pal=GetPalette(); - if (head.biBitCount<=8 && pal==NULL) return false; - - int maskwdt=((head.biWidth+31)/32)*4; //mask line width - int masksize=head.biHeight * maskwdt; //size of mask - int bitcount=head.biBitCount; - int imagesize=head.biSizeImage; -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid() && head.biClrUsed==0){ - bitcount=32; - imagesize=4*head.biHeight*head.biWidth; - } -#endif - - //fill the icon headers - ICONHEADER icon_header={0,1,1}; - ICONDIRENTRY icon_list={(BYTE)head.biWidth,(BYTE)head.biHeight,(BYTE)head.biClrUsed ,0,0,(WORD)bitcount, - sizeof(BITMAPINFOHEADER)+head.biClrUsed*sizeof(RGBQUAD)+ - imagesize+masksize, - sizeof(ICONHEADER)+sizeof(ICONDIRENTRY)}; - BITMAPINFOHEADER bi={sizeof(BITMAPINFOHEADER),head.biWidth,2*head.biHeight,1,(WORD)bitcount, - 0,imagesize,0,0,0,0}; - - hFile->Write(&icon_header,sizeof(ICONHEADER),1); //write the headers - hFile->Write(&icon_list,sizeof(ICONDIRENTRY),1); - hFile->Write(&bi,sizeof(BITMAPINFOHEADER),1); - if (pal) hFile->Write(pal,head.biClrUsed*sizeof(RGBQUAD),1); //write palette - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid() && head.biClrUsed==0){ - BYTE* src = info.pImage; - BYTE* buf=(BYTE*)malloc(imagesize); - BYTE* dst = buf; - for (long y = 0; y < head.biHeight; y++) { - for(long x=0;xWrite(buf,imagesize, 1); - free(buf); - } else { - hFile->Write(info.pImage,imagesize,1); //write image - } -#else - hFile->Write(info.pImage,imagesize,1); //write image -#endif - - //save transparency mask - BYTE* mask=(BYTE*)calloc(masksize,1); //create empty AND/XOR masks - if (!mask) return false; - - //prepare the variables to build the mask - BYTE* iDst; - int pos,i; - RGBQUAD c={0,0,0,0}; - RGBQUAD ct = GetTransColor(); - long* pc = (long*)&c; - long* pct= (long*)&ct; - bool bTransparent = info.nBkgndIndex != -1; -#if CXIMAGE_SUPPORT_ALPHA - bool bAlphaPaletteIsValid = AlphaPaletteIsValid(); - bool bAlphaIsValid = AlphaIsValid(); -#endif - //build the mask - for (int y = 0; y < head.biHeight; y++) { - for (int x = 0; x < head.biWidth; x++) { - i=0; -#if CXIMAGE_SUPPORT_ALPHA - if (bAlphaIsValid && AlphaGet(x,y)==0) i=1; - if (bAlphaPaletteIsValid && GetPixelColor(x,y).rgbReserved==0) i=1; -#endif - c=GetPixelColor(x,y,false); - if (bTransparent && *pc==*pct) i=1; - iDst = mask + y*maskwdt + (x>>3); - pos = 7-x%8; - *iDst &= ~(0x01<Write(mask,masksize,1); - free(mask); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ICO - diff --git a/src/win32/dependencies/cximage/ximaico.h b/src/win32/dependencies/cximage/ximaico.h deleted file mode 100644 index 8f63e060..00000000 --- a/src/win32/dependencies/cximage/ximaico.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * File: ximaico.h - * Purpose: ICON Image Class Loader and Writer - */ -/* ========================================================== - * CxImageICO (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * ========================================================== - */ -#if !defined(__ximaICO_h) -#define __ximaICO_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_ICO - -class CxImageICO: public CxImage -{ -typedef struct tagIconDirectoryEntry { - BYTE bWidth; - BYTE bHeight; - BYTE bColorCount; - BYTE bReserved; - WORD wPlanes; - WORD wBitCount; - DWORD dwBytesInRes; - DWORD dwImageOffset; -} ICONDIRENTRY; - -typedef struct tagIconDir { - WORD idReserved; - WORD idType; - WORD idCount; -} ICONHEADER; - -public: - CxImageICO(): CxImage(CXIMAGE_FORMAT_ICO) {} - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_ICO);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_ICO);} - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximainfo.cpp b/src/win32/dependencies/cximage/ximainfo.cpp deleted file mode 100644 index 6535ddea..00000000 --- a/src/win32/dependencies/cximage/ximainfo.cpp +++ /dev/null @@ -1,388 +0,0 @@ -// ximainfo.cpp : main attributes -/* 03/10/2004 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -//////////////////////////////////////////////////////////////////////////////// -/** - * \return the color used for transparency, and/or for background color - */ -RGBQUAD CxImage::GetTransColor() -{ - if (head.biBitCount<24 && info.nBkgndIndex != -1) return GetPaletteColor((BYTE)info.nBkgndIndex); - return info.nBkgndColor; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Gets the index used for transparency. Returns -1 for no transparancy. - */ -long CxImage::GetTransIndex() const -{ - return info.nBkgndIndex; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Sets the index used for transparency with 1, 4 and 8 bpp images. Set to -1 to remove the effect. - */ -void CxImage::SetTransIndex(long idx) -{ - info.nBkgndIndex = idx; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Sets the color used for transparency with 24 bpp images. - * You must call SetTransIndex(0) to enable the effect, SetTransIndex(-1) to disable it. - */ -void CxImage::SetTransColor(RGBQUAD rgb) -{ - rgb.rgbReserved=0; - info.nBkgndColor = rgb; -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::IsTransparent() const -{ - return info.nBkgndIndex>=0; // -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Returns true if the image has 256 colors or less. - */ -bool CxImage::IsIndexed() const -{ - return head.biClrUsed!=0; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \return 1 = indexed, 2 = RGB, 4 = RGBA - */ -BYTE CxImage::GetColorType() -{ - BYTE b = (BYTE)((head.biBitCount>8) ? 2 /*COLORTYPE_COLOR*/ : 1 /*COLORTYPE_PALETTE*/); -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) b = 4 /*COLORTYPE_ALPHA*/; -#endif //CXIMAGE_SUPPORT_ALPHA - return b; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \return Resolution for TIFF, JPEG, PNG and BMP formats. - */ -long CxImage::GetXDPI() const -{ - return info.xDPI; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \return Resolution for TIFF, JPEG, PNG and BMP formats. - */ -long CxImage::GetYDPI() const -{ - return info.yDPI; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Set resolution for TIFF, JPEG, PNG and BMP formats. - */ -void CxImage::SetXDPI(long dpi) -{ - if (dpi<=0) dpi=96; - info.xDPI = dpi; - head.biXPelsPerMeter = (long) floor(dpi * 10000.0 / 254.0 + 0.5); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Set resolution for TIFF, JPEG, PNG and BMP formats. - */ -void CxImage::SetYDPI(long dpi) -{ - if (dpi<=0) dpi=96; - info.yDPI = dpi; - head.biYPelsPerMeter = (long) floor(dpi * 10000.0 / 254.0 + 0.5); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \sa SetFlags - */ -DWORD CxImage::GetFlags() const -{ - return info.dwFlags; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Image flags, for future use - * \param flags - * - 0x??00000 = reserved for 16 bit, CMYK, multilayer - * - 0x00??0000 = blend modes - * - 0x0000???? = layer id or user flags - * - * \param bLockReservedFlags protects the "reserved" and "blend modes" flags - */ -void CxImage::SetFlags(DWORD flags, bool bLockReservedFlags) -{ - if (bLockReservedFlags) info.dwFlags = flags & 0x0000ffff; - else info.dwFlags = flags; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \sa SetCodecOption - */ -DWORD CxImage::GetCodecOption(DWORD imagetype) -{ - if (imagetype=head.biWidth) x=head.biWidth-(x % head.biWidth + 1); - if (y<0) y=((-y) % head.biHeight); - else if (y>=head.biHeight) y=head.biHeight-(y % head.biHeight + 1); - break; - default: - return; - }//switch -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * See OverflowCoordinates for integer version - * \author ***bd*** 2.2004 - */ -void CxImage::OverflowCoordinates(float &x, float &y, OverflowMethod const ofMethod) -{ - if (x>=0 && x=0 && y=head.biWidth) x=head.biWidth-((float)fmod(x, (float) head.biWidth) + 1); - if (y<0) y=(float)fmod(-y, (float) head.biHeight); - else if (y>=head.biHeight) y=head.biHeight-((float)fmod(y, (float) head.biHeight) + 1); - break; - default: - return; - }//switch -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * Method return pixel color. Different methods are implemented for out of bounds pixels. - * If an image has alpha channel, alpha value is returned in .RGBReserved. - * - * \param x,y : pixel coordinates - * \param ofMethod : out-of-bounds method: - * - OF_WRAP - wrap over to pixels on other side of the image - * - OF_REPEAT - repeat last pixel on the edge - * - OF_COLOR - return input value of color - * - OF_BACKGROUND - return background color (if not set, return input color) - * - OF_TRANSPARENT - return transparent pixel - * - * \param rplColor : input color (returned for out-of-bound coordinates in OF_COLOR mode and if other mode is not applicable) - * - * \return color : color of pixel - * \author ***bd*** 2.2004 - */ -RGBQUAD CxImage::GetPixelColorWithOverflow(long x, long y, OverflowMethod const ofMethod, RGBQUAD* const rplColor) -{ - RGBQUAD color; //color to return - if ((!IsInside(x,y)) || pDib==NULL) { //is pixel within bouns?: - //pixel is out of bounds or no DIB - if (rplColor!=NULL) - color=*rplColor; - else { - color.rgbRed=color.rgbGreen=color.rgbBlue=255; color.rgbReserved=0; //default replacement colour: white transparent - }//if - if (pDib==NULL) return color; - //pixel is out of bounds: - switch (ofMethod) { - case OM_TRANSPARENT: -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) { - //alpha transparency is supported and image has alpha layer - color.rgbReserved=0; - } else { -#endif //CXIMAGE_SUPPORT_ALPHA - //no alpha transparency - if (GetTransIndex()>=0) { - color=GetTransColor(); //single color transparency enabled (return transparent color) - }//if -#if CXIMAGE_SUPPORT_ALPHA - }//if -#endif //CXIMAGE_SUPPORT_ALPHA - return color; - case OM_BACKGROUND: - //return background color (if it exists, otherwise input value) - if (info.nBkgndIndex != -1) { - if (head.biBitCount<24) color = GetPaletteColor((BYTE)info.nBkgndIndex); - else color = info.nBkgndColor; - }//if - return color; - case OM_REPEAT: - case OM_WRAP: - case OM_MIRROR: - OverflowCoordinates(x,y,ofMethod); - break; - default: - //simply return replacement color (OM_COLOR and others) - return color; - }//switch - }//if - //just return specified pixel (it's within bounds) - return BlindGetPixelColor(x,y); -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * This method reconstructs image according to chosen interpolation method and then returns pixel (x,y). - * (x,y) can lie between actual image pixels. If (x,y) lies outside of image, method returns value - * according to overflow method. - * This method is very useful for geometrical image transformations, where destination pixel - * can often assume color value lying between source pixels. - * - * \param (x,y) - coordinates of pixel to return - * GPCI method recreates "analogue" image back from digital data, so x and y - * are float values and color value of point (1.1,1) will generally not be same - * as (1,1). Center of first pixel is at (0,0) and center of pixel right to it is (1,0). - * (0.5,0) is half way between these two pixels. - * \param inMethod - interpolation (reconstruction) method (kernel) to use: - * - IM_NEAREST_NEIGHBOUR - returns colour of nearest lying pixel (causes stairy look of - * processed images) - * - IM_BILINEAR - interpolates colour from four neighbouring pixels (softens image a bit) - * - IM_BICUBIC - interpolates from 16 neighbouring pixels (can produce "halo" artifacts) - * - IM_BICUBIC2 - interpolates from 16 neighbouring pixels (perhaps a bit less halo artifacts - than IM_BICUBIC) - * - IM_BSPLINE - interpolates from 16 neighbouring pixels (softens image, washes colours) - * (As far as I know, image should be prefiltered for this method to give - * good results... some other time :) ) - * This method uses bicubic interpolation kernel from CXImage 5.99a and older - * versions. - * - IM_LANCZOS - interpolates from 12*12 pixels (slow, ringing artifacts) - * - * \param ofMethod - overflow method (see comments at GetPixelColorWithOverflow) - * \param rplColor - pointer to color used for out of borders pixels in OM_COLOR mode - * (and other modes if colour can't calculated in a specified way) - * - * \return interpolated color value (including interpolated alpha value, if image has alpha layer) - * - * \author ***bd*** 2.2004 - */ -RGBQUAD CxImage::GetPixelColorInterpolated( - float x,float y, - InterpolationMethod const inMethod, - OverflowMethod const ofMethod, - RGBQUAD* const rplColor) -{ - //calculate nearest pixel - int xi=(int)(x); if (x<0) xi--; //these replace (incredibly slow) floor (Visual c++ 2003, AMD Athlon) - int yi=(int)(y); if (y<0) yi--; - RGBQUAD color; //calculated colour - - switch (inMethod) { - case IM_NEAREST_NEIGHBOUR: - return GetPixelColorWithOverflow((long)(x+0.5f), (long)(y+0.5f), ofMethod, rplColor); - default: { - //bilinear interpolation - if (xi<-1 || xi>=head.biWidth || yi<-1 || yi>=head.biHeight) { //all 4 points are outside bounds?: - switch (ofMethod) { - case OM_COLOR: case OM_TRANSPARENT: case OM_BACKGROUND: - //we don't need to interpolate anything with all points outside in this case - return GetPixelColorWithOverflow(-999, -999, ofMethod, rplColor); - default: - //recalculate coordinates and use faster method later on - OverflowCoordinates(x,y,ofMethod); - xi=(int)(x); if (x<0) xi--; //x and/or y have changed ... recalculate xi and yi - yi=(int)(y); if (y<0) yi--; - }//switch - }//if - //get four neighbouring pixels - if ((xi+1)=0 && (yi+1)=0 && head.biClrUsed==0) { - //all pixels are inside RGB24 image... optimize reading (and use fixed point arithmetic) - WORD wt1=(WORD)((x-xi)*256.0f), wt2=(WORD)((y-yi)*256.0f); - WORD wd=wt1*wt2>>8; - WORD wb=wt1-wd; - WORD wc=wt2-wd; - WORD wa=256-wt1-wc; - WORD wrr,wgg,wbb; - BYTE *pxptr=(BYTE*)info.pImage+yi*info.dwEffWidth+xi*3; - wbb=wa*(*pxptr++); wgg=wa*(*pxptr++); wrr=wa*(*pxptr++); - wbb+=wb*(*pxptr++); wgg+=wb*(*pxptr++); wrr+=wb*(*pxptr); - pxptr+=(info.dwEffWidth-5); //move to next row - wbb+=wc*(*pxptr++); wgg+=wc*(*pxptr++); wrr+=wc*(*pxptr++); - wbb+=wd*(*pxptr++); wgg+=wd*(*pxptr++); wrr+=wd*(*pxptr); - color.rgbRed=(BYTE) (wrr>>8); color.rgbGreen=(BYTE) (wgg>>8); color.rgbBlue=(BYTE) (wbb>>8); -#if CXIMAGE_SUPPORT_ALPHA - if (pAlpha) { - WORD waa; - //image has alpha layer... we have to do the same for alpha data - pxptr=AlphaGetPointer(xi,yi); //pointer to first byte - waa=wa*(*pxptr++); waa+=wb*(*pxptr); //first two pixels - pxptr+=(head.biWidth-1); //move to next row - waa+=wc*(*pxptr++); waa+=wd*(*pxptr); //and second row pixels - color.rgbReserved=(BYTE) (waa>>8); - } else -#endif - { //Alpha not supported or no alpha at all - color.rgbReserved = 0; - } - return color; - } else { - //default (slower) way to get pixels (not RGB24 or some pixels out of borders) - float t1=x-xi, t2=y-yi; - float d=t1*t2; - float b=t1-d; - float c=t2-d; - float a=1-t1-c; - RGBQUAD rgb11,rgb21,rgb12,rgb22; - rgb11=GetPixelColorWithOverflow(xi, yi, ofMethod, rplColor); - rgb21=GetPixelColorWithOverflow(xi+1, yi, ofMethod, rplColor); - rgb12=GetPixelColorWithOverflow(xi, yi+1, ofMethod, rplColor); - rgb22=GetPixelColorWithOverflow(xi+1, yi+1, ofMethod, rplColor); - //calculate linear interpolation - color.rgbRed=(BYTE) (a*rgb11.rgbRed+b*rgb21.rgbRed+c*rgb12.rgbRed+d*rgb22.rgbRed); - color.rgbGreen=(BYTE) (a*rgb11.rgbGreen+b*rgb21.rgbGreen+c*rgb12.rgbGreen+d*rgb22.rgbGreen); - color.rgbBlue=(BYTE) (a*rgb11.rgbBlue+b*rgb21.rgbBlue+c*rgb12.rgbBlue+d*rgb22.rgbBlue); -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) - color.rgbReserved=(BYTE) (a*rgb11.rgbReserved+b*rgb21.rgbReserved+c*rgb12.rgbReserved+d*rgb22.rgbReserved); - else -#endif - { //Alpha not supported or no alpha at all - color.rgbReserved = 0; - } - return color; - }//if - }//default - case IM_BICUBIC: - case IM_BICUBIC2: - case IM_BSPLINE: - case IM_BOX: - case IM_HERMITE: - case IM_HAMMING: - case IM_SINC: - case IM_BLACKMAN: - case IM_BESSEL: - case IM_GAUSSIAN: - case IM_QUADRATIC: - case IM_MITCHELL: - case IM_CATROM: - //bicubic interpolation(s) - if (((xi+2)<0) || ((xi-1)>=head.biWidth) || ((yi+2)<0) || ((yi-1)>=head.biHeight)) { //all points are outside bounds?: - switch (ofMethod) { - case OM_COLOR: case OM_TRANSPARENT: case OM_BACKGROUND: - //we don't need to interpolate anything with all points outside in this case - return GetPixelColorWithOverflow(-999, -999, ofMethod, rplColor); - break; - default: - //recalculate coordinates and use faster method later on - OverflowCoordinates(x,y,ofMethod); - xi=(int)(x); if (x<0) xi--; //x and/or y have changed ... recalculate xi and yi - yi=(int)(y); if (y<0) yi--; - }//switch - }//if - - //some variables needed from here on - int xii,yii; //x any y integer indexes for loops - float kernel, kernelyc; //kernel cache - float kernelx[12], kernely[4]; //precalculated kernel values - float rr,gg,bb,aa; //accumulated color values - //calculate multiplication factors for all pixels - int i; - switch (inMethod) { - case IM_BICUBIC: - for (i=0; i<4; i++) { - kernelx[i]=KernelCubic((float)(xi+i-1-x)); - kernely[i]=KernelCubic((float)(yi+i-1-y)); - }//for i - break; - case IM_BICUBIC2: - for (i=0; i<4; i++) { - kernelx[i]=KernelGeneralizedCubic((float)(xi+i-1-x), -0.5); - kernely[i]=KernelGeneralizedCubic((float)(yi+i-1-y), -0.5); - }//for i - break; - case IM_BSPLINE: - for (i=0; i<4; i++) { - kernelx[i]=KernelBSpline((float)(xi+i-1-x)); - kernely[i]=KernelBSpline((float)(yi+i-1-y)); - }//for i - break; - case IM_BOX: - for (i=0; i<4; i++) { - kernelx[i]=KernelBox((float)(xi+i-1-x)); - kernely[i]=KernelBox((float)(yi+i-1-y)); - }//for i - break; - case IM_HERMITE: - for (i=0; i<4; i++) { - kernelx[i]=KernelHermite((float)(xi+i-1-x)); - kernely[i]=KernelHermite((float)(yi+i-1-y)); - }//for i - break; - case IM_HAMMING: - for (i=0; i<4; i++) { - kernelx[i]=KernelHamming((float)(xi+i-1-x)); - kernely[i]=KernelHamming((float)(yi+i-1-y)); - }//for i - break; - case IM_SINC: - for (i=0; i<4; i++) { - kernelx[i]=KernelSinc((float)(xi+i-1-x)); - kernely[i]=KernelSinc((float)(yi+i-1-y)); - }//for i - break; - case IM_BLACKMAN: - for (i=0; i<4; i++) { - kernelx[i]=KernelBlackman((float)(xi+i-1-x)); - kernely[i]=KernelBlackman((float)(yi+i-1-y)); - }//for i - break; - case IM_BESSEL: - for (i=0; i<4; i++) { - kernelx[i]=KernelBessel((float)(xi+i-1-x)); - kernely[i]=KernelBessel((float)(yi+i-1-y)); - }//for i - break; - case IM_GAUSSIAN: - for (i=0; i<4; i++) { - kernelx[i]=KernelGaussian((float)(xi+i-1-x)); - kernely[i]=KernelGaussian((float)(yi+i-1-y)); - }//for i - break; - case IM_QUADRATIC: - for (i=0; i<4; i++) { - kernelx[i]=KernelQuadratic((float)(xi+i-1-x)); - kernely[i]=KernelQuadratic((float)(yi+i-1-y)); - }//for i - break; - case IM_MITCHELL: - for (i=0; i<4; i++) { - kernelx[i]=KernelMitchell((float)(xi+i-1-x)); - kernely[i]=KernelMitchell((float)(yi+i-1-y)); - }//for i - break; - case IM_CATROM: - for (i=0; i<4; i++) { - kernelx[i]=KernelCatrom((float)(xi+i-1-x)); - kernely[i]=KernelCatrom((float)(yi+i-1-y)); - }//for i - break; - }//switch - rr=gg=bb=aa=0; - if (((xi+2)=1 && ((yi+2)=1) && !IsIndexed()) { - //optimized interpolation (faster pixel reads) for RGB24 images with all pixels inside bounds - BYTE *pxptr, *pxptra; - for (yii=yi-1; yii255) rr=255; if (rr<0) rr=0; color.rgbRed=(BYTE) rr; - if (gg>255) gg=255; if (gg<0) gg=0; color.rgbGreen=(BYTE) gg; - if (bb>255) bb=255; if (bb<0) bb=0; color.rgbBlue=(BYTE) bb; -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) { - if (aa>255) aa=255; if (aa<0) aa=0; color.rgbReserved=(BYTE) aa; - } else -#endif - { //Alpha not supported or no alpha at all - color.rgbReserved = 0; - } - return color; - case IM_LANCZOS: - //lanczos window (16*16) sinc interpolation - if (((xi+6)<0) || ((xi-5)>=head.biWidth) || ((yi+6)<0) || ((yi-5)>=head.biHeight)) { - //all points are outside bounds - switch (ofMethod) { - case OM_COLOR: case OM_TRANSPARENT: case OM_BACKGROUND: - //we don't need to interpolate anything with all points outside in this case - return GetPixelColorWithOverflow(-999, -999, ofMethod, rplColor); - break; - default: - //recalculate coordinates and use faster method later on - OverflowCoordinates(x,y,ofMethod); - xi=(int)(x); if (x<0) xi--; //x and/or y have changed ... recalculate xi and yi - yi=(int)(y); if (y<0) yi--; - }//switch - }//if - - for (xii=xi-5; xii=0) && ((yi+6)=0) && !IsIndexed()) { - //optimized interpolation (faster pixel reads) for RGB24 images with all pixels inside bounds - BYTE *pxptr, *pxptra; - for (yii=yi-5; yii255) rr=255; if (rr<0) rr=0; color.rgbRed=(BYTE) rr; - if (gg>255) gg=255; if (gg<0) gg=0; color.rgbGreen=(BYTE) gg; - if (bb>255) bb=255; if (bb<0) bb=0; color.rgbBlue=(BYTE) bb; -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) { - if (aa>255) aa=255; if (aa<0) aa=0; color.rgbReserved=(BYTE) aa; - } else -#endif - { //Alpha not supported or no alpha at all - color.rgbReserved = 0; - } - return color; - }//switch -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Helper function for GetAreaColorInterpolated. - * Adds 'surf' portion of image pixel with color 'color' to (rr,gg,bb,aa). - */ -void CxImage::AddAveragingCont(RGBQUAD const &color, float const surf, float &rr, float &gg, float &bb, float &aa) -{ - rr+=color.rgbRed*surf; - gg+=color.rgbGreen*surf; - bb+=color.rgbBlue*surf; -#if CXIMAGE_SUPPORT_ALPHA - aa+=color.rgbReserved*surf; -#endif -} -//////////////////////////////////////////////////////////////////////////////// -/** - * This method is similar to GetPixelColorInterpolated, but this method also properly handles - * subsampling. - * If you need to sample original image with interval of more than 1 pixel (as when shrinking an image), - * you should use this method instead of GetPixelColorInterpolated or aliasing will occur. - * When area width and height are both less than pixel, this method gets pixel color by interpolating - * color of frame center with selected (inMethod) interpolation by calling GetPixelColorInterpolated. - * If width and height are more than 1, method calculates color by averaging color of pixels within area. - * Interpolation method is not used in this case. Pixel color is interpolated by averaging instead. - * If only one of both is more than 1, method uses combination of interpolation and averaging. - * Chosen interpolation method is used, but since it is averaged later on, there is little difference - * between IM_BILINEAR (perhaps best for this case) and better methods. IM_NEAREST_NEIGHBOUR again - * leads to aliasing artifacts. - * This method is a bit slower than GetPixelColorInterpolated and when aliasing is not a problem, you should - * simply use the later. - * - * \param xc, yc - center of (rectangular) area - * \param w, h - width and height of area - * \param inMethod - interpolation method that is used, when interpolation is used (see above) - * \param ofMethod - overflow method used when retrieving individual pixel colors - * \param rplColor - replacement colour to use, in OM_COLOR - * - * \author ***bd*** 2.2004 - */ -RGBQUAD CxImage::GetAreaColorInterpolated( - float const xc, float const yc, float const w, float const h, - InterpolationMethod const inMethod, - OverflowMethod const ofMethod, - RGBQUAD* const rplColor) -{ - RGBQUAD color; //calculated colour - - if (h<=1 && w<=1) { - //both width and height are less than one... we will use interpolation of center point - return GetPixelColorInterpolated(xc, yc, inMethod, ofMethod, rplColor); - } else { - //area is wider and/or taller than one pixel: - CxRect2 area(xc-w/2.0f, yc-h/2.0f, xc+w/2.0f, yc+h/2.0f); //area - int xi1=(int)(area.botLeft.x+0.49999999f); //low x - int yi1=(int)(area.botLeft.y+0.49999999f); //low y - - - int xi2=(int)(area.topRight.x+0.5f); //top x - int yi2=(int)(area.topRight.y+0.5f); //top y (for loops) - - float rr,gg,bb,aa; //red, green, blue and alpha components - rr=gg=bb=aa=0; - int x,y; //loop counters - float s=0; //surface of all pixels - float cps; //surface of current crosssection - if (h>1 && w>1) { - //width and height of area are greater than one pixel, so we can employ "ordinary" averaging - CxRect2 intBL, intTR; //bottom left and top right intersection - intBL=area.CrossSection(CxRect2(((float)xi1)-0.5f, ((float)yi1)-0.5f, ((float)xi1)+0.5f, ((float)yi1)+0.5f)); - intTR=area.CrossSection(CxRect2(((float)xi2)-0.5f, ((float)yi2)-0.5f, ((float)xi2)+0.5f, ((float)yi2)+0.5f)); - float wBL, wTR, hBL, hTR; - wBL=intBL.Width(); //width of bottom left pixel-area intersection - hBL=intBL.Height(); //height of bottom left... - wTR=intTR.Width(); //width of top right... - hTR=intTR.Height(); //height of top right... - - AddAveragingCont(GetPixelColorWithOverflow(xi1,yi1,ofMethod,rplColor), wBL*hBL, rr, gg, bb, aa); //bottom left pixel - AddAveragingCont(GetPixelColorWithOverflow(xi2,yi1,ofMethod,rplColor), wTR*hBL, rr, gg, bb, aa); //bottom right pixel - AddAveragingCont(GetPixelColorWithOverflow(xi1,yi2,ofMethod,rplColor), wBL*hTR, rr, gg, bb, aa); //top left pixel - AddAveragingCont(GetPixelColorWithOverflow(xi2,yi2,ofMethod,rplColor), wTR*hTR, rr, gg, bb, aa); //top right pixel - //bottom and top row - for (x=xi1+1; x255) rr=255; if (rr<0) rr=0; color.rgbRed=(BYTE) rr; - if (gg>255) gg=255; if (gg<0) gg=0; color.rgbGreen=(BYTE) gg; - if (bb>255) bb=255; if (bb<0) bb=0; color.rgbBlue=(BYTE) bb; -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) { - if (aa>255) aa=255; if (aa<0) aa=0; color.rgbReserved=(BYTE) aa; - }//if -#endif - }//if - return color; -} - -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelBSpline(const float x) -{ - if (x>2.0f) return 0.0f; - // thanks to Kristian Kratzenstein - float a, b, c, d; - float xm1 = x - 1.0f; // Was calculatet anyway cause the "if((x-1.0f) < 0)" - float xp1 = x + 1.0f; - float xp2 = x + 2.0f; - - if ((xp2) <= 0.0f) a = 0.0f; else a = xp2*xp2*xp2; // Only float, not float -> double -> float - if ((xp1) <= 0.0f) b = 0.0f; else b = xp1*xp1*xp1; - if (x <= 0) c = 0.0f; else c = x*x*x; - if ((xm1) <= 0.0f) d = 0.0f; else d = xm1*xm1*xm1; - - return (0.16666666666666666667f * (a - (4.0f * b) + (6.0f * c) - (4.0f * d))); - - /* equivalent - if (x < -2.0) - return(0.0f); - if (x < -1.0) - return((2.0f+x)*(2.0f+x)*(2.0f+x)*0.16666666666666666667f); - if (x < 0.0) - return((4.0f+x*x*(-6.0f-3.0f*x))*0.16666666666666666667f); - if (x < 1.0) - return((4.0f+x*x*(-6.0f+3.0f*x))*0.16666666666666666667f); - if (x < 2.0) - return((2.0f-x)*(2.0f-x)*(2.0f-x)*0.16666666666666666667f); - return(0.0f); - */ -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * Bilinear interpolation kernel: - \verbatim - / - | 1-t , if 0 <= t <= 1 - h(t) = | t+1 , if -1 <= t < 0 - | 0 , otherwise - \ - \endverbatim - * ***bd*** 2.2004 - */ -float CxImage::KernelLinear(const float t) -{ -// if (0<=t && t<=1) return 1-t; -// if (-1<=t && t<0) return 1+t; -// return 0; - - // - if (t < -1.0f) - return 0.0f; - if (t < 0.0f) - return 1.0f+t; - if (t < 1.0f) - return 1.0f-t; - return 0.0f; -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * Bicubic interpolation kernel (a=-1): - \verbatim - / - | 1-2|t|**2+|t|**3 , if |t| < 1 - h(t) = | 4-8|t|+5|t|**2-|t|**3 , if 1<=|t|<2 - | 0 , otherwise - \ - \endverbatim - * ***bd*** 2.2004 - */ -float CxImage::KernelCubic(const float t) -{ - float abs_t = (float)fabs(t); - float abs_t_sq = abs_t * abs_t; - if (abs_t<1) return 1-2*abs_t_sq+abs_t_sq*abs_t; - if (abs_t<2) return 4 - 8*abs_t +5*abs_t_sq - abs_t_sq*abs_t; - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * Bicubic kernel (for a=-1 it is the same as BicubicKernel): - \verbatim - / - | (a+2)|t|**3 - (a+3)|t|**2 + 1 , |t| <= 1 - h(t) = | a|t|**3 - 5a|t|**2 + 8a|t| - 4a , 1 < |t| <= 2 - | 0 , otherwise - \ - \endverbatim - * Often used values for a are -1 and -1/2. - */ -float CxImage::KernelGeneralizedCubic(const float t, const float a) -{ - float abs_t = (float)fabs(t); - float abs_t_sq = abs_t * abs_t; - if (abs_t<1) return (a+2)*abs_t_sq*abs_t - (a+3)*abs_t_sq + 1; - if (abs_t<2) return a*abs_t_sq*abs_t - 5*a*abs_t_sq + 8*a*abs_t - 4*a; - return 0; -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * Lanczos windowed sinc interpolation kernel with radius r. - \verbatim - / - h(t) = | sinc(t)*sinc(t/r) , if |t| r) return 0; - if (t==0) return 1; - float pit=PI*t; - float pitd=pit/r; - return (float)((sin(pit)/pit) * (sin(pitd)/pitd)); -} - -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelBox(const float x) -{ - if (x < -0.5f) - return 0.0f; - if (x < 0.5f) - return 1.0f; - return 0.0f; -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelHermite(const float x) -{ - if (x < -1.0f) - return 0.0f; - if (x < 0.0f) - return (-2.0f*x-3.0f)*x*x+1.0f; - if (x < 1.0f) - return (2.0f*x-3.0f)*x*x+1.0f; - return 0.0f; -// if (fabs(x)>1) return 0.0f; -// return(0.5f+0.5f*(float)cos(PI*x)); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelHamming(const float x) -{ - if (x < -1.0f) - return 0.0f; - if (x < 0.0f) - return 0.92f*(-2.0f*x-3.0f)*x*x+1.0f; - if (x < 1.0f) - return 0.92f*(2.0f*x-3.0f)*x*x+1.0f; - return 0.0f; -// if (fabs(x)>1) return 0.0f; -// return(0.54f+0.46f*(float)cos(PI*x)); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelSinc(const float x) -{ - if (x == 0.0) - return(1.0); - return((float)sin(PI*x)/(PI*x)); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelBlackman(const float x) -{ - //if (fabs(x)>1) return 0.0f; - return (0.42f+0.5f*(float)cos(PI*x)+0.08f*(float)cos(2.0f*PI*x)); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelBessel_J1(const float x) -{ - double p, q; - - register long i; - - static const double - Pone[] = - { - 0.581199354001606143928050809e+21, - -0.6672106568924916298020941484e+20, - 0.2316433580634002297931815435e+19, - -0.3588817569910106050743641413e+17, - 0.2908795263834775409737601689e+15, - -0.1322983480332126453125473247e+13, - 0.3413234182301700539091292655e+10, - -0.4695753530642995859767162166e+7, - 0.270112271089232341485679099e+4 - }, - Qone[] = - { - 0.11623987080032122878585294e+22, - 0.1185770712190320999837113348e+20, - 0.6092061398917521746105196863e+17, - 0.2081661221307607351240184229e+15, - 0.5243710262167649715406728642e+12, - 0.1013863514358673989967045588e+10, - 0.1501793594998585505921097578e+7, - 0.1606931573481487801970916749e+4, - 0.1e+1 - }; - - p = Pone[8]; - q = Qone[8]; - for (i=7; i >= 0; i--) - { - p = p*x*x+Pone[i]; - q = q*x*x+Qone[i]; - } - return (float)(p/q); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelBessel_P1(const float x) -{ - double p, q; - - register long i; - - static const double - Pone[] = - { - 0.352246649133679798341724373e+5, - 0.62758845247161281269005675e+5, - 0.313539631109159574238669888e+5, - 0.49854832060594338434500455e+4, - 0.2111529182853962382105718e+3, - 0.12571716929145341558495e+1 - }, - Qone[] = - { - 0.352246649133679798068390431e+5, - 0.626943469593560511888833731e+5, - 0.312404063819041039923015703e+5, - 0.4930396490181088979386097e+4, - 0.2030775189134759322293574e+3, - 0.1e+1 - }; - - p = Pone[5]; - q = Qone[5]; - for (i=4; i >= 0; i--) - { - p = p*(8.0/x)*(8.0/x)+Pone[i]; - q = q*(8.0/x)*(8.0/x)+Qone[i]; - } - return (float)(p/q); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelBessel_Q1(const float x) -{ - double p, q; - - register long i; - - static const double - Pone[] = - { - 0.3511751914303552822533318e+3, - 0.7210391804904475039280863e+3, - 0.4259873011654442389886993e+3, - 0.831898957673850827325226e+2, - 0.45681716295512267064405e+1, - 0.3532840052740123642735e-1 - }, - Qone[] = - { - 0.74917374171809127714519505e+4, - 0.154141773392650970499848051e+5, - 0.91522317015169922705904727e+4, - 0.18111867005523513506724158e+4, - 0.1038187585462133728776636e+3, - 0.1e+1 - }; - - p = Pone[5]; - q = Qone[5]; - for (i=4; i >= 0; i--) - { - p = p*(8.0/x)*(8.0/x)+Pone[i]; - q = q*(8.0/x)*(8.0/x)+Qone[i]; - } - return (float)(p/q); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelBessel_Order1(float x) -{ - float p, q; - - if (x == 0.0) - return (0.0f); - p = x; - if (x < 0.0) - x=(-x); - if (x < 8.0) - return(p*KernelBessel_J1(x)); - q = (float)sqrt(2.0f/(PI*x))*(float)(KernelBessel_P1(x)*(1.0f/sqrt(2.0f)*(sin(x)-cos(x)))-8.0f/x*KernelBessel_Q1(x)* - (-1.0f/sqrt(2.0f)*(sin(x)+cos(x)))); - if (p < 0.0f) - q = (-q); - return (q); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelBessel(const float x) -{ - if (x == 0.0f) - return(PI/4.0f); - return(KernelBessel_Order1(PI*x)/(2.0f*x)); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelGaussian(const float x) -{ - return (float)(exp(-2.0f*x*x)*0.79788456080287f/*sqrt(2.0f/PI)*/); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelQuadratic(const float x) -{ - if (x < -1.5f) - return(0.0f); - if (x < -0.5f) - return(0.5f*(x+1.5f)*(x+1.5f)); - if (x < 0.5f) - return(0.75f-x*x); - if (x < 1.5f) - return(0.5f*(x-1.5f)*(x-1.5f)); - return(0.0f); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelMitchell(const float x) -{ -#define KM_B (1.0f/3.0f) -#define KM_C (1.0f/3.0f) -#define KM_P0 (( 6.0f - 2.0f * KM_B ) / 6.0f) -#define KM_P2 ((-18.0f + 12.0f * KM_B + 6.0f * KM_C) / 6.0f) -#define KM_P3 (( 12.0f - 9.0f * KM_B - 6.0f * KM_C) / 6.0f) -#define KM_Q0 (( 8.0f * KM_B + 24.0f * KM_C) / 6.0f) -#define KM_Q1 ((-12.0f * KM_B - 48.0f * KM_C) / 6.0f) -#define KM_Q2 (( 6.0f * KM_B + 30.0f * KM_C) / 6.0f) -#define KM_Q3 (( -1.0f * KM_B - 6.0f * KM_C) / 6.0f) - - if (x < -2.0) - return(0.0f); - if (x < -1.0) - return(KM_Q0-x*(KM_Q1-x*(KM_Q2-x*KM_Q3))); - if (x < 0.0f) - return(KM_P0+x*x*(KM_P2-x*KM_P3)); - if (x < 1.0f) - return(KM_P0+x*x*(KM_P2+x*KM_P3)); - if (x < 2.0f) - return(KM_Q0+x*(KM_Q1+x*(KM_Q2+x*KM_Q3))); - return(0.0f); -} -//////////////////////////////////////////////////////////////////////////////// -float CxImage::KernelCatrom(const float x) -{ - if (x < -2.0) - return(0.0f); - if (x < -1.0) - return(0.5f*(4.0f+x*(8.0f+x*(5.0f+x)))); - if (x < 0.0) - return(0.5f*(2.0f+x*x*(-5.0f-3.0f*x))); - if (x < 1.0) - return(0.5f*(2.0f+x*x*(-5.0f+3.0f*x))); - if (x < 2.0) - return(0.5f*(4.0f+x*(-8.0f+x*(5.0f-x)))); - return(0.0f); -} -//////////////////////////////////////////////////////////////////////////////// - -#endif diff --git a/src/win32/dependencies/cximage/ximaiter.h b/src/win32/dependencies/cximage/ximaiter.h deleted file mode 100644 index 39fc5afd..00000000 --- a/src/win32/dependencies/cximage/ximaiter.h +++ /dev/null @@ -1,252 +0,0 @@ -/* - * File: ImaIter.h - * Purpose: Declaration of the Platform Independent Image Base Class - * Author: Alejandro Aguilar Sierra - * Created: 1995 - * Copyright: (c) 1995, Alejandro Aguilar Sierra - * - * 07/08/2001 Davide Pizzolato - www.xdp.it - * - removed slow loops - * - added safe checks - * - * Permission is given by the author to freely redistribute and include - * this code in any program as long as this credit is given where due. - * - * COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS" BASIS, WITHOUT WARRANTY - * OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES - * THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE - * OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED - * CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT - * THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY - * SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL - * PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER - * THIS DISCLAIMER. - * - * Use at your own risk! - * ========================================================== - */ - -#if !defined(__ImaIter_h) -#define __ImaIter_h - -#include "ximage.h" -#include "ximadef.h" - -class CImageIterator -{ -friend class CxImage; -protected: - int Itx, Ity; // Counters - int Stepx, Stepy; - BYTE* IterImage; // Image pointer - CxImage *ima; -public: - // Constructors - CImageIterator ( void ); - CImageIterator ( CxImage *image ); - operator CxImage* (); - - // Iterators - BOOL ItOK (); - void Reset (); - void Upset (); - void SetRow(BYTE *buf, int n); - void GetRow(BYTE *buf, int n); - BYTE GetByte( ) { return IterImage[Itx]; } - void SetByte(BYTE b) { IterImage[Itx] = b; } - BYTE* GetRow(void); - BYTE* GetRow(int n); - BOOL NextRow(); - BOOL PrevRow(); - BOOL NextByte(); - BOOL PrevByte(); - - void SetSteps(int x, int y=0) { Stepx = x; Stepy = y; } - void GetSteps(int *x, int *y) { *x = Stepx; *y = Stepy; } - BOOL NextStep(); - BOOL PrevStep(); - - void SetY(int y); /* AD - for interlace */ - int GetY() {return Ity;} - BOOL GetCol(BYTE* pCol, DWORD x); - BOOL SetCol(BYTE* pCol, DWORD x); -}; - -///////////////////////////////////////////////////////////////////// -inline -CImageIterator::CImageIterator(void) -{ - ima = 0; - IterImage = 0; - Itx = Ity = 0; - Stepx = Stepy = 0; -} -///////////////////////////////////////////////////////////////////// -inline -CImageIterator::CImageIterator(CxImage *imageImpl): ima(imageImpl) -{ - if (ima) IterImage = ima->GetBits(); - Itx = Ity = 0; - Stepx = Stepy = 0; -} -///////////////////////////////////////////////////////////////////// -inline -CImageIterator::operator CxImage* () -{ - return ima; -} -///////////////////////////////////////////////////////////////////// -inline BOOL CImageIterator::ItOK () -{ - if (ima) return ima->IsInside(Itx, Ity); - else return FALSE; -} -///////////////////////////////////////////////////////////////////// -inline void CImageIterator::Reset() -{ - if (ima) IterImage = ima->GetBits(); - else IterImage=0; - Itx = Ity = 0; -} -///////////////////////////////////////////////////////////////////// -inline void CImageIterator::Upset() -{ - Itx = 0; - Ity = ima->GetHeight()-1; - IterImage = ima->GetBits() + ima->GetEffWidth()*(ima->GetHeight()-1); -} -///////////////////////////////////////////////////////////////////// -inline BOOL CImageIterator::NextRow() -{ - if (++Ity >= (int)ima->GetHeight()) return 0; - IterImage += ima->GetEffWidth(); - return 1; -} -///////////////////////////////////////////////////////////////////// -inline BOOL CImageIterator::PrevRow() -{ - if (--Ity < 0) return 0; - IterImage -= ima->GetEffWidth(); - return 1; -} -/* AD - for interlace */ -inline void CImageIterator::SetY(int y) -{ - if ((y < 0) || (y > (int)ima->GetHeight())) return; - Ity = y; - IterImage = ima->GetBits() + ima->GetEffWidth()*y; -} -///////////////////////////////////////////////////////////////////// -inline void CImageIterator::SetRow(BYTE *buf, int n) -{ - if (n<0) n = (int)ima->GetEffWidth(); - else n = min(n,(int)ima->GetEffWidth()); - - if ((IterImage!=NULL)&&(buf!=NULL)&&(n>0)) memcpy(IterImage,buf,n); -} -///////////////////////////////////////////////////////////////////// -inline void CImageIterator::GetRow(BYTE *buf, int n) -{ - if ((IterImage!=NULL)&&(buf!=NULL)&&(n>0)) memcpy(buf,IterImage,n); -} -///////////////////////////////////////////////////////////////////// -inline BYTE* CImageIterator::GetRow() -{ - return IterImage; -} -///////////////////////////////////////////////////////////////////// -inline BYTE* CImageIterator::GetRow(int n) -{ - SetY(n); - return IterImage; -} -///////////////////////////////////////////////////////////////////// -inline BOOL CImageIterator::NextByte() -{ - if (++Itx < (int)ima->GetEffWidth()) return 1; - else - if (++Ity < (int)ima->GetHeight()){ - IterImage += ima->GetEffWidth(); - Itx = 0; - return 1; - } else - return 0; -} -///////////////////////////////////////////////////////////////////// -inline BOOL CImageIterator::PrevByte() -{ - if (--Itx >= 0) return 1; - else - if (--Ity >= 0){ - IterImage -= ima->GetEffWidth(); - Itx = 0; - return 1; - } else - return 0; -} -///////////////////////////////////////////////////////////////////// -inline BOOL CImageIterator::NextStep() -{ - Itx += Stepx; - if (Itx < (int)ima->GetEffWidth()) return 1; - else { - Ity += Stepy; - if (Ity < (int)ima->GetHeight()){ - IterImage += ima->GetEffWidth(); - Itx = 0; - return 1; - } else - return 0; - } -} -///////////////////////////////////////////////////////////////////// -inline BOOL CImageIterator::PrevStep() -{ - Itx -= Stepx; - if (Itx >= 0) return 1; - else { - Ity -= Stepy; - if (Ity >= 0 && Ity < (int)ima->GetHeight()) { - IterImage -= ima->GetEffWidth(); - Itx = 0; - return 1; - } else - return 0; - } -} -///////////////////////////////////////////////////////////////////// -inline BOOL CImageIterator::GetCol(BYTE* pCol, DWORD x) -{ - if ((pCol==0)||(ima->GetBpp()<8)||(x>=ima->GetWidth())) - return 0; - DWORD h = ima->GetHeight(); - //DWORD line = ima->GetEffWidth(); - BYTE bytes = ima->GetBpp()>>3; - BYTE* pSrc; - for (DWORD y=0;yGetBits(y) + x*bytes; - for (BYTE w=0;wGetBpp()<8)||(x>=ima->GetWidth())) - return 0; - DWORD h = ima->GetHeight(); - //DWORD line = ima->GetEffWidth(); - BYTE bytes = ima->GetBpp()>>3; - BYTE* pSrc; - for (DWORD y=0;yGetBits(y) + x*bytes; - for (BYTE w=0;wSize(); - src=(BYTE*)malloc(len); - hFile->Read(src, len, 1); - - if (!j2k_decode(src, len, &img, &cp)) { - free(src); - throw "failed to decode J2K image!"; - } - - free(src); - - if (img->numcomps==3 && - img->comps[0].dx==img->comps[1].dx && - img->comps[1].dx==img->comps[2].dx && - img->comps[0].dy==img->comps[1].dy && - img->comps[1].dy==img->comps[2].dy && - img->comps[0].prec==img->comps[1].prec && - img->comps[1].prec==img->comps[2].prec) - { - w=CEILDIV(img->x1-img->x0, img->comps[0].dx); - h=CEILDIV(img->y1-img->y0, img->comps[0].dy); - max=(1<comps[0].prec)-1; - - Create(w,h,24,CXIMAGE_FORMAT_J2K); - - RGBQUAD c; - for (i=0,y=0; ycomps[0].data[i]; - c.rgbGreen = img->comps[1].data[i]; - c.rgbBlue = img->comps[2].data[i]; - SetPixelColor(x,h-1-y,c); - } - } - } else { - int compno; - info.nNumFrames = img->numcomps; - if ((info.nFrame<0)||(info.nFrame>=info.nNumFrames)){ - j2k_destroy(&img,&cp); - throw "wrong frame!"; - } - for (compno=0; compno<=info.nFrame; compno++) { - w=CEILDIV(img->x1-img->x0, img->comps[compno].dx); - h=CEILDIV(img->y1-img->y0, img->comps[compno].dy); - max=(1<comps[compno].prec)-1; - Create(w,h,8,CXIMAGE_FORMAT_J2K); - SetGrayPalette(); - for (i=0,y=0; ycomps[compno].data[i]); - } - } - } - } - - j2k_destroy(&img,&cp); - - } catch (char *message) { - strncpy(info.szLastError,message,255); - return FALSE; - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImageJ2K::Encode(CxFile * hFile) -{ - if (EncodeSafeCheck(hFile)) return false; - - if (head.biClrUsed!=0 && !IsGrayScale()){ - strcpy(info.szLastError,"J2K can save only RGB or GrayScale images"); - return false; - } - - int i,x,y; - j2k_image_t *img; - j2k_cp_t *cp; - j2k_tcp_t *tcp; - j2k_tccp_t *tccp; - - img = (j2k_image_t *)calloc(sizeof(j2k_image_t),1); - cp = (j2k_cp_t *)calloc(sizeof(j2k_cp_t),1); - - cp->tx0=0; cp->ty0=0; - cp->tw=1; cp->th=1; - cp->tcps=(j2k_tcp_t*)calloc(sizeof(j2k_tcp_t),1); - tcp=&cp->tcps[0]; - - long w=head.biWidth; - long h=head.biHeight; - - tcp->numlayers=1; - for (i=0;inumlayers;i++) tcp->rates[i]=(w*h*GetJpegQuality())/600; - - - if (IsGrayScale()) { - img->x0=0; - img->y0=0; - img->x1=w; - img->y1=h; - img->numcomps=1; - img->comps=(j2k_comp_t*)calloc(sizeof(j2k_comp_t),1); - img->comps[0].data=(int*)calloc(w*h*sizeof(int),1); - img->comps[0].prec=8; - img->comps[0].sgnd=0; - img->comps[0].dx=1; - img->comps[0].dy=1; - for (i=0,y=0; ycomps[0].data[i]=GetPixelIndex(x,h-1-y); - } - } - } else if (!IsIndexed()) { - img->x0=0; - img->y0=0; - img->x1=w; - img->y1=h; - img->numcomps=3; - img->comps=(j2k_comp_t*)calloc(img->numcomps*sizeof(j2k_comp_t),1); - for (i=0; inumcomps; i++) { - img->comps[i].data=(int*)calloc(w*h*sizeof(int),1); - img->comps[i].prec=8; - img->comps[i].sgnd=0; - img->comps[i].dx=1; - img->comps[i].dy=1; - } - RGBQUAD c; - for (i=0,y=0; ycomps[0].data[i]=c.rgbRed; - img->comps[1].data[i]=c.rgbGreen; - img->comps[2].data[i]=c.rgbBlue; - } - } - } else { - return 0; - } - - cp->tdx=img->x1-img->x0; - cp->tdy=img->y1-img->y0; - - tcp->csty=0; - tcp->prg=0; - tcp->mct=img->numcomps==3?1:0; - tcp->tccps=(j2k_tccp_t*)calloc(img->numcomps*sizeof(j2k_tccp_t),1); - - int ir=0; /* or 1 ???*/ - - for (i=0; inumcomps; i++) { - tccp=&tcp->tccps[i]; - tccp->csty=0; - tccp->numresolutions=6; - tccp->cblkw=6; - tccp->cblkh=6; - tccp->cblksty=0; - tccp->qmfbid=ir?0:1; - tccp->qntsty=ir?J2K_CCP_QNTSTY_SEQNT:J2K_CCP_QNTSTY_NOQNT; - tccp->numgbits=2; - tccp->roishift=0; - j2k_calc_explicit_stepsizes(tccp, img->comps[i].prec); - } - - BYTE* dest=(BYTE*)calloc(tcp->rates[tcp->numlayers-1]+2,1); - long len = j2k_encode(img, cp, dest, tcp->rates[tcp->numlayers-1]+2); - - if (len==0) { - strcpy(info.szLastError,"J2K failed to encode image"); - } else { - hFile->Write(dest, len, 1); - } - - free(dest); - j2k_destroy(&img,&cp); - - return (len!=0); -} -//////////////////////////////////////////////////////////////////////////////// - -static const double dwt_norms_97[4][10]={ - {1.000, 1.965, 4.177, 8.403, 16.90, 33.84, 67.69, 135.3, 270.6, 540.9}, - {2.022, 3.989, 8.355, 17.04, 34.27, 68.63, 137.3, 274.6, 549.0}, - {2.022, 3.989, 8.355, 17.04, 34.27, 68.63, 137.3, 274.6, 549.0}, - {2.080, 3.865, 8.307, 17.18, 34.71, 69.59, 139.3, 278.6, 557.2} -}; - -//////////////////////////////////////////////////////////////////////////////// -void CxImageJ2K::j2k_calc_explicit_stepsizes(j2k_tccp_t *tccp, int prec) { - int numbands, bandno; - numbands=3*tccp->numresolutions-2; - for (bandno=0; bandnonumresolutions-1-resno; - gain=tccp->qmfbid==0?0:(orient==0?0:(orient==1||orient==2?1:2)); - if (tccp->qntsty==J2K_CCP_QNTSTY_NOQNT) { - stepsize=1.0; - } else { - double norm=dwt_norms_97[orient][level]; - stepsize=(1<<(gain+1))/norm; - } - j2k_encode_stepsize((int)floor(stepsize*8192.0), prec+gain, &tccp->stepsizes[bandno].expn, &tccp->stepsizes[bandno].mant); - } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageJ2K::j2k_encode_stepsize(int stepsize, int numbps, int *expn, int *mant) { - int p, n; - p=j2k_floorlog2(stepsize)-13; - n=11-j2k_floorlog2(stepsize); - *mant=(n<0?stepsize>>-n:stepsize<1; l++) { - a>>=1; - } - return l; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_J2K diff --git a/src/win32/dependencies/cximage/ximaj2k.h b/src/win32/dependencies/cximage/ximaj2k.h deleted file mode 100644 index 9f2642eb..00000000 --- a/src/win32/dependencies/cximage/ximaj2k.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * File: ximaj2k.h - * Purpose: J2K Image Class Loader and Writer - */ -/* ========================================================== - * CxImageJ2K (c) 04/Aug/2002 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * based on LIBJ2K Copyright (c) 2001-2002, David Janssens - All rights reserved. - * ========================================================== - */ -#if !defined(__ximaJ2K_h) -#define __ximaJ2K_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_J2K - -#define LIBJ2K_EXPORTS -extern "C" { -#include "../j2k/j2k.h" -}; - -class CxImageJ2K: public CxImage -{ -public: - CxImageJ2K(): CxImage(CXIMAGE_FORMAT_J2K) {} - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_J2K);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_J2K);} - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE -protected: - void j2k_calc_explicit_stepsizes(j2k_tccp_t *tccp, int prec); - void j2k_encode_stepsize(int stepsize, int numbps, int *expn, int *mant); - int j2k_floorlog2(int a); -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximajas.cpp b/src/win32/dependencies/cximage/ximajas.cpp deleted file mode 100644 index fff99463..00000000 --- a/src/win32/dependencies/cximage/ximajas.cpp +++ /dev/null @@ -1,265 +0,0 @@ -/* - * File: ximajas.cpp - * Purpose: Platform Independent JasPer Image Class Loader and Writer - * 12/Apr/2003 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximajas.h" - -#if CXIMAGE_SUPPORT_JASPER - -//////////////////////////////////////////////////////////////////////////////// -bool CxImageJAS::Decode(CxFile *hFile, DWORD imagetype) -{ - if (hFile == NULL) return false; - - jas_image_t *image=0; - jas_stream_t *in=0; - jas_matrix_t **bufs=0; - long i,error=0; - //jas_setdbglevel(0); - - try - { - if (jas_init()) - throw "cannot initialize jasper"; - - if (!(in = jas_stream_fdopen(0, "rb"))) - throw "error: cannot open standard input"; - - CxFileJas src(hFile,in); - - if (!(image = jas_image_decode(in, -1, 0))) - throw "error: cannot load image data"; - - long x,y,w,h,depth,cmptno; - - w = jas_image_cmptwidth(image,0); - h = jas_image_cmptheight(image,0); - depth = jas_image_cmptprec(image,0); - - if (image->numcmpts_ > 64 || image->numcmpts_ < 0) - throw "error: too much components"; - - if (depth!=1 && depth!=4 && depth!=8){ - jas_image_t *newimage; - jas_cmprof_t *outprof; - //jas_eprintf("forcing conversion to sRGB\n"); - if (!(outprof = jas_cmprof_createfromclrspc(JAS_CLRSPC_SRGB))) { - throw "cannot create sRGB profile"; - } - if (!(newimage = jas_image_chclrspc(image, outprof, JAS_CMXFORM_INTENT_PER))) { - throw "cannot convert to sRGB"; - } - jas_image_destroy(image); - jas_cmprof_destroy(outprof); - image = newimage; - } - - bufs = (jas_matrix_t **)calloc(image->numcmpts_, sizeof(jas_matrix_t**)); - for (i = 0; i < image->numcmpts_; ++i) { - if (!(bufs[i] = jas_matrix_create(1, w))) { - throw "error: cannot allocate memory"; - } - } - - if (image->numcmpts_==3 && - image->cmpts_[0]->width_ == image->cmpts_[1]->width_ && - image->cmpts_[1]->width_ == image->cmpts_[2]->width_ && - image->cmpts_[0]->height_ == image->cmpts_[1]->height_ && - image->cmpts_[1]->height_ == image->cmpts_[2]->height_ && - image->cmpts_[0]->prec_ == image->cmpts_[1]->prec_ && - image->cmpts_[1]->prec_ == image->cmpts_[2]->prec_ ) - { - - if(!Create(w,h,24,imagetype)) - throw "Can't allocate memory"; - - RGBQUAD c; - for (y=0; ynumcmpts_; ++cmptno) { - jas_image_readcmpt(image, cmptno, 0, y, w, 1, bufs[cmptno]); - } - - for (x=0; xnumcmpts_; - if ((info.nFrame<0)||(info.nFrame>=info.nNumFrames)){ - throw "wrong frame!"; - } - for (cmptno=0; cmptno<=info.nFrame; cmptno++) { - w = jas_image_cmptwidth(image,cmptno); - h = jas_image_cmptheight(image,cmptno); - depth = jas_image_cmptprec(image,cmptno); - if (depth>8) depth=8; - if(!Create(w,h,depth,imagetype)) - throw "Can't allocate memory"; - SetGrayPalette(); - for (y=0; ynumcmpts_; ++i){ if (bufs[i]) jas_matrix_destroy(bufs[i]);} - free(bufs); - } - jas_cleanup(); - if (image) jas_image_destroy(image); - if (in) jas_stream_close(in); - return (error==0); -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageJAS::Encode(CxFile * hFile, DWORD imagetype) -{ - if (EncodeSafeCheck(hFile)) return false; - - if (head.biClrUsed!=0 && !IsGrayScale()){ - strcpy(info.szLastError,"JasPer can save only RGB or GrayScale images"); - return false; - } - - jas_image_t *image=0; - jas_stream_t *out=0; - jas_matrix_t *cmpts[3]; - long x,y,yflip,error=0; - uint_fast16_t cmptno, numcmpts; - jas_image_cmptparm_t cmptparms[3], *cmptparm; - - try - { - - if (jas_init()) - throw "cannot initialize jasper"; - - if (!(out = jas_stream_fdopen(0, "wb"))) - throw "error: cannot open standard output"; - - CxFileJas src(hFile,out); - - numcmpts = head.biClrUsed==0 ? 3 : 1; - - for (cmptno = 0, cmptparm = cmptparms; cmptno < numcmpts; ++cmptno, ++cmptparm) { - cmptparm->tlx = 0; - cmptparm->tly = 0; - cmptparm->hstep = 1; - cmptparm->vstep = 1; - cmptparm->width = head.biWidth; - cmptparm->height = head.biHeight; - cmptparm->prec = 8; - cmptparm->sgnd = false; - } - - /* Create image object. */ - if (!(image = jas_image_create(numcmpts, cmptparms, JAS_CLRSPC_UNKNOWN))) - throw "error : jas_image_create"; - - if (numcmpts == 3) { - jas_image_setclrspc(image, JAS_CLRSPC_SRGB); - jas_image_setcmpttype(image, 0, - JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_R)); - jas_image_setcmpttype(image, 1, - JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_G)); - jas_image_setcmpttype(image, 2, - JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_RGB_B)); - } else { - jas_image_setclrspc(image, JAS_CLRSPC_SGRAY); - jas_image_setcmpttype(image, 0, - JAS_IMAGE_CT_COLOR(JAS_CLRSPC_CHANIND_GRAY_Y)); - } - - - for (x = 0; x < numcmpts; ++x) { cmpts[x] = 0; } - /* Create temporary matrices to hold component data. */ - for (x = 0; x < numcmpts; ++x) { - if (!(cmpts[x] = jas_matrix_create(1, head.biWidth))) { - throw "error : can't allocate memory"; - } - } - - RGBQUAD c; - for (y = 0; y < head.biHeight; ++y) { - for (x = 0; x < head.biWidth; ++x) { - if (head.biClrUsed==0){ - c = GetPixelColor(x,y); - jas_matrix_setv(cmpts[0], x, c.rgbRed); - jas_matrix_setv(cmpts[1], x, c.rgbGreen); - jas_matrix_setv(cmpts[2], x, c.rgbBlue); - } else { - jas_matrix_setv(cmpts[0], x, GetPixelIndex(x,y)); - } - } - yflip = head.biHeight - 1 - y; - for (cmptno = 0; cmptno < numcmpts; ++cmptno) { - if (jas_image_writecmpt(image, cmptno, 0, yflip, head.biWidth, 1, cmpts[cmptno])) { - throw "error : jas_image_writecmpt"; - } - } - } - - char szfmt[4]; - *szfmt = '\0'; -#if CXIMAGE_SUPPORT_JP2 - if (imagetype == CXIMAGE_FORMAT_JP2) strcpy(szfmt,"jp2"); -#endif -#if CXIMAGE_SUPPORT_JPC - if (imagetype == CXIMAGE_FORMAT_JPC) strcpy(szfmt,"jpc"); -#endif -#if CXIMAGE_SUPPORT_RAS - if (imagetype == CXIMAGE_FORMAT_RAS) strcpy(szfmt,"ras"); -#endif -#if CXIMAGE_SUPPORT_PNM - if (imagetype == CXIMAGE_FORMAT_PNM) strcpy(szfmt,"pnm"); -#endif -#if CXIMAGE_SUPPORT_PGX - if (imagetype == CXIMAGE_FORMAT_PGX){ - strcpy(szfmt,"pgx"); - if (head.biClrUsed==0) throw "PGX can save only GrayScale images"; - } -#endif - int outfmt = jas_image_strtofmt(szfmt); - - char szoutopts[16]; - sprintf(szoutopts,"rate=%.3f", info.nQuality/100.0f); - - if (jas_image_encode(image, out, outfmt, szoutopts)) { - throw "error: cannot encode image\n"; - } - jas_stream_flush(out); - - } catch (char *message) { - strncpy(info.szLastError,message,255); - error = 1; - } - - for (x = 0; x < numcmpts; ++x) { if (cmpts[x]) { jas_matrix_destroy(cmpts[x]); } } - jas_cleanup(); - if (image) jas_image_destroy(image); - if (out) jas_stream_close(out); - - return (error==0); -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_JASPER - diff --git a/src/win32/dependencies/cximage/ximajas.h b/src/win32/dependencies/cximage/ximajas.h deleted file mode 100644 index 3fd1414a..00000000 --- a/src/win32/dependencies/cximage/ximajas.h +++ /dev/null @@ -1,84 +0,0 @@ -/* - * File: ximajas.h - * Purpose: Jasper Image Class Loader and Writer - */ -/* ========================================================== - * CxImageJAS (c) 12/Apr/2003 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * based on JasPer Copyright (c) 2001-2003 Michael David Adams - All rights reserved. - * ========================================================== - */ -#if !defined(__ximaJAS_h) -#define __ximaJAS_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_JASPER - -#include "../jasper/include/jasper/jasper.h" - -class CxImageJAS: public CxImage -{ -public: - CxImageJAS(): CxImage((DWORD)0) {} // cast to DWORD - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,0);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,0);} - bool Decode(CxFile * hFile, DWORD imagetype = 0); - bool Decode(FILE *hFile, DWORD imagetype = 0) { CxIOFile file(hFile); return Decode(&file,imagetype); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile, DWORD imagetype = 0); - bool Encode(FILE *hFile, DWORD imagetype = 0) { CxIOFile file(hFile); return Encode(&file,imagetype); } -#endif // CXIMAGE_SUPPORT_ENCODE -protected: - - class CxFileJas - { - public: - CxFileJas(CxFile* pFile,jas_stream_t *stream) - { - if (stream->obj_) jas_free(stream->obj_); - stream->obj_ = pFile; - - // - cannot set the stream->ops_->functions here, - // because this overwrites a static structure in the Jasper library. - // This structure is used by Jasper for internal operations too, e.g. tempfile. - // However the ops_ pointer in the stream can be overwritten. - - //stream->ops_->close_ = JasClose; - //stream->ops_->read_ = JasRead; - //stream->ops_->seek_ = JasSeek; - //stream->ops_->write_ = JasWrite; - - jas_stream_CxFile.close_ = JasClose; - jas_stream_CxFile.read_ = JasRead; - jas_stream_CxFile.seek_ = JasSeek; - jas_stream_CxFile.write_ = JasWrite; - - stream->ops_ = &jas_stream_CxFile; - - // - end - } - static int JasRead(jas_stream_obj_t *obj, char *buf, int cnt) - { return ((CxFile*)obj)->Read(buf,1,cnt); } - static int JasWrite(jas_stream_obj_t *obj, char *buf, int cnt) - { return ((CxFile*)obj)->Write(buf,1,cnt); } - static long JasSeek(jas_stream_obj_t *obj, long offset, int origin) - { return ((CxFile*)obj)->Seek(offset,origin); } - static int JasClose(jas_stream_obj_t *obj) - { return 1; } - - // - private: - jas_stream_ops_t jas_stream_CxFile; - // - end - - }; - -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximajbg.cpp b/src/win32/dependencies/cximage/ximajbg.cpp deleted file mode 100644 index 1866b3ed..00000000 --- a/src/win32/dependencies/cximage/ximajbg.cpp +++ /dev/null @@ -1,162 +0,0 @@ -/* - * File: ximajbg.cpp - * Purpose: Platform Independent JBG Image Class Loader and Writer - * 18/Aug/2002 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximajbg.h" - -#if CXIMAGE_SUPPORT_JBG - -#include "ximaiter.h" - -#define JBIG_BUFSIZE 8192 - -//////////////////////////////////////////////////////////////////////////////// -bool CxImageJBG::Decode(CxFile *hFile) -{ - if (hFile == NULL) return false; - - struct jbg_dec_state jbig_state; - unsigned long xmax = 4294967295UL, ymax = 4294967295UL; - unsigned int len, cnt; - BYTE *buffer,*p; - int result; - - try - { - jbg_dec_init(&jbig_state); - jbg_dec_maxsize(&jbig_state, xmax, ymax); - - buffer = (BYTE*)malloc(JBIG_BUFSIZE); - if (!buffer) throw "Sorry, not enough memory available!"; - - result = JBG_EAGAIN; - do { - len = hFile->Read(buffer, 1, JBIG_BUFSIZE); - if (!len) break; - cnt = 0; - p = buffer; - while (len > 0 && (result == JBG_EAGAIN || result == JBG_EOK)) { - result = jbg_dec_in(&jbig_state, p, len, &cnt); - p += cnt; - len -= cnt; - } - } while (result == JBG_EAGAIN || result == JBG_EOK); - - if (hFile->Error()) - throw "Problem while reading input file"; - if (result != JBG_EOK && result != JBG_EOK_INTR) - throw "Problem with input file"; - - int w, h, bpp, planes, ew; - - w = jbg_dec_getwidth(&jbig_state); - h = jbg_dec_getheight(&jbig_state); - planes = jbg_dec_getplanes(&jbig_state); - bpp = (planes+7)>>3; - ew = (w + 7)>>3; - - switch (planes){ - case 1: - { - BYTE* binary_image = jbg_dec_getimage(&jbig_state, 0); - - if (!Create(w,h,1,CXIMAGE_FORMAT_JBG)) - throw "Can't allocate memory"; - - SetPaletteColor(0,255,255,255); - SetPaletteColor(1,0,0,0); - - CImageIterator iter(this); - iter.Upset(); - for (int i=0;i>3; - ew = (w + 7)>>3; - - BYTE mask; - RGBQUAD *rgb = GetPalette(); - if (CompareColors(&rgb[0],&rgb[1])<0) mask=255; else mask=0; - - BYTE *buffer = (BYTE*)malloc(ew*h*2); - if (!buffer) { - strcpy(info.szLastError,"Sorry, not enough memory available!"); - return false; - } - - for (y=0; yError()){ - strcpy(info.szLastError,"Problem while writing JBG file"); - return false; - } - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_JBG - diff --git a/src/win32/dependencies/cximage/ximajbg.h b/src/win32/dependencies/cximage/ximajbg.h deleted file mode 100644 index bf1fdca7..00000000 --- a/src/win32/dependencies/cximage/ximajbg.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * File: ximajbg.h - * Purpose: JBG Image Class Loader and Writer - */ -/* ========================================================== - * CxImageJBG (c) 18/Aug/2002 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * based on LIBJBG Copyright (c) 2002, Markus Kuhn - All rights reserved. - * ========================================================== - */ -#if !defined(__ximaJBG_h) -#define __ximaJBG_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_JBG - -extern "C" { -#include "../jbig/jbig.h" -}; - -class CxImageJBG: public CxImage -{ -public: - CxImageJBG(): CxImage(CXIMAGE_FORMAT_JBG) {} - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_JBG);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_JBG);} - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE -protected: - static void jbig_data_out(BYTE *buffer, unsigned int len, void *file) - {((CxFile*)file)->Write(buffer,len,1);} -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximajpg.cpp b/src/win32/dependencies/cximage/ximajpg.cpp deleted file mode 100644 index e1e2f36a..00000000 --- a/src/win32/dependencies/cximage/ximajpg.cpp +++ /dev/null @@ -1,454 +0,0 @@ -/* - * File: ximajpg.cpp - * Purpose: Platform Independent JPEG Image Class Loader and Writer - * 07/Aug/2001 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximajpg.h" - -#if CXIMAGE_SUPPORT_JPG - -#include "../jpeg/jmorecfg.h" - -#include "ximaiter.h" - -#include - -struct jpg_error_mgr { - struct jpeg_error_mgr pub; /* "public" fields */ - jmp_buf setjmp_buffer; /* for return to caller */ - char* buffer; /* error message */ -}; -typedef jpg_error_mgr *jpg_error_ptr; - -//////////////////////////////////////////////////////////////////////////////// -// Here's the routine that will replace the standard error_exit method: -//////////////////////////////////////////////////////////////////////////////// -static void -ima_jpeg_error_exit (j_common_ptr cinfo) -{ - /* cinfo->err really points to a my_error_mgr struct, so coerce pointer */ - jpg_error_ptr myerr = (jpg_error_ptr) cinfo->err; - /* Create the message */ - myerr->pub.format_message (cinfo, myerr->buffer); - /* Send it to stderr, adding a newline */ - /* Return control to the setjmp point */ - longjmp(myerr->setjmp_buffer, 1); -} -//////////////////////////////////////////////////////////////////////////////// -CxImageJPG::CxImageJPG(): CxImage(CXIMAGE_FORMAT_JPG) -{ -#if CXIMAGEJPG_SUPPORT_EXIF - m_exif = NULL; - memset(&m_exifinfo, 0, sizeof(EXIFINFO)); -#endif -} -//////////////////////////////////////////////////////////////////////////////// -CxImageJPG::~CxImageJPG() -{ -#if CXIMAGEJPG_SUPPORT_EXIF - if (m_exif) delete m_exif; -#endif -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGEJPG_SUPPORT_EXIF -bool CxImageJPG::DecodeExif(CxFile * hFile) -{ - m_exif = new CxExifInfo(&m_exifinfo); - if (m_exif){ - long pos=hFile->Tell(); - m_exif->DecodeExif(hFile); - hFile->Seek(pos,SEEK_SET); - return m_exif->m_exifinfo->IsExif; - } else { - return false; - } -} -#endif //CXIMAGEJPG_SUPPORT_EXIF -//////////////////////////////////////////////////////////////////////////////// -bool CxImageJPG::Decode(CxFile * hFile) -{ - - bool is_exif = false; -#if CXIMAGEJPG_SUPPORT_EXIF - is_exif = DecodeExif(hFile); -#endif - - CImageIterator iter(this); - /* This struct contains the JPEG decompression parameters and pointers to - * working space (which is allocated as needed by the JPEG library). - */ - struct jpeg_decompress_struct cinfo; - /* We use our private extension JPEG error handler. */ - struct jpg_error_mgr jerr; - jerr.buffer=info.szLastError; - /* More stuff */ - JSAMPARRAY buffer; /* Output row buffer */ - int row_stride; /* physical row width in output buffer */ - - /* In this example we want to open the input file before doing anything else, - * so that the setjmp() error recovery below can assume the file is open. - * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that - * requires it in order to read binary files. - */ - - /* Step 1: allocate and initialize JPEG decompression object */ - /* We set up the normal JPEG error routines, then override error_exit. */ - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = ima_jpeg_error_exit; - - /* Establish the setjmp return context for my_error_exit to use. */ - if (setjmp(jerr.setjmp_buffer)) { - /* If we get here, the JPEG code has signaled an error. - * We need to clean up the JPEG object, close the input file, and return. - */ - jpeg_destroy_decompress(&cinfo); - return 0; - } - /* Now we can initialize the JPEG decompression object. */ - jpeg_create_decompress(&cinfo); - - /* Step 2: specify data source (eg, a file) */ - //jpeg_stdio_src(&cinfo, infile); - CxFileJpg src(hFile); - cinfo.src = &src; - - /* Step 3: read file parameters with jpeg_read_header() */ - (void) jpeg_read_header(&cinfo, TRUE); - - /* Step 4 handle decoder options*/ - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & DECODE_GRAYSCALE) != 0) - cinfo.out_color_space = JCS_GRAYSCALE; - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & DECODE_QUANTIZE) != 0) { - cinfo.quantize_colors = TRUE; - cinfo.desired_number_of_colors = info.nQuality; - } - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & DECODE_DITHER) != 0) - cinfo.dither_mode = m_nDither; - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & DECODE_ONEPASS) != 0) - cinfo.two_pass_quantize = FALSE; - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & DECODE_NOSMOOTH) != 0) - cinfo.do_fancy_upsampling = FALSE; - -//: Load true color images as RGB (no quantize) -/* Step 4: set parameters for decompression */ -/* if (cinfo.jpeg_color_space!=JCS_GRAYSCALE) { - * cinfo.quantize_colors = TRUE; - * cinfo.desired_number_of_colors = 128; - *} - */ // - - // Set the scale - cinfo.scale_denom = GetJpegScale(); - - // Borrowed the idea from GIF implementation - if (info.nEscape == -1) { - // Return output dimensions only - jpeg_calc_output_dimensions(&cinfo); - head.biWidth = cinfo.output_width; - head.biHeight = cinfo.output_height; - jpeg_destroy_decompress(&cinfo); - return true; - } - - /* Step 5: Start decompressor */ - jpeg_start_decompress(&cinfo); - - /* We may need to do some setup of our own at this point before reading - * the data. After jpeg_start_decompress() we have the correct scaled - * output image dimensions available, as well as the output colormap - * if we asked for color quantization. - */ - //Create the image using output dimensions - //Create(cinfo.image_width, cinfo.image_height, 8*cinfo.output_components, CXIMAGE_FORMAT_JPG); - Create(cinfo.output_width, cinfo.output_height, 8*cinfo.output_components, CXIMAGE_FORMAT_JPG); - - if (!pDib) longjmp(jerr.setjmp_buffer, 1); // check if the image has been created - - if (is_exif){ -#if CXIMAGEJPG_SUPPORT_EXIF - if ((m_exifinfo.Xresolution != 0.0) && (m_exifinfo.ResolutionUnit != 0)) - SetXDPI((long)(m_exifinfo.Xresolution/m_exifinfo.ResolutionUnit)); - if ((m_exifinfo.Yresolution != 0.0) && (m_exifinfo.ResolutionUnit != 0)) - SetYDPI((long)(m_exifinfo.Yresolution/m_exifinfo.ResolutionUnit)); -#endif - } else { - if (cinfo.density_unit==2){ - SetXDPI((long)floor(cinfo.X_density * 254.0 / 10000.0 + 0.5)); - SetYDPI((long)floor(cinfo.Y_density * 254.0 / 10000.0 + 0.5)); - } else { - SetXDPI(cinfo.X_density); - SetYDPI(cinfo.Y_density); - } - } - - if (cinfo.out_color_space==JCS_GRAYSCALE){ - SetGrayPalette(); - head.biClrUsed =256; - } else { - if (cinfo.quantize_colors==TRUE){ - SetPalette(cinfo.actual_number_of_colors, cinfo.colormap[0], cinfo.colormap[1], cinfo.colormap[2]); - head.biClrUsed=cinfo.actual_number_of_colors; - } else { - head.biClrUsed=0; - } - } - - /* JSAMPLEs per row in output buffer */ - row_stride = cinfo.output_width * cinfo.output_components; - - /* Make a one-row-high sample array that will go away when done with image */ - buffer = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, row_stride, 1); - - /* Step 6: while (scan lines remain to be read) */ - /* jpeg_read_scanlines(...); */ - /* Here we use the library's state variable cinfo.output_scanline as the - * loop counter, so that we don't have to keep track ourselves. - */ - iter.Upset(); - while (cinfo.output_scanline < cinfo.output_height) { - - if (info.nEscape) longjmp(jerr.setjmp_buffer, 1); // - cancel decoding - - (void) jpeg_read_scanlines(&cinfo, buffer, 1); - // info.nProgress = (long)(100*cinfo.output_scanline/cinfo.output_height); - // Step 6a: CMYK->RGB */ - if ((cinfo.num_components==4)&&(cinfo.quantize_colors==FALSE)){ - BYTE k,*dst,*src; - dst=iter.GetRow(); - src=buffer[0]; - for(long x3=0,x4=0; x3<(long)info.dwEffWidth && x4 Step 7A: Swap red and blue components - // not necessary if swapped red and blue definition in jmorecfg.h;ln322 - if ((cinfo.num_components==3)&&(cinfo.quantize_colors==FALSE)){ - BYTE* r0=GetBits(); - for(long y=0;y - cancel decoding - RGBtoBGR(r0,3*head.biWidth); - r0+=info.dwEffWidth; - } - } - - /* Step 8: Release JPEG decompression object */ - /* This is an important step since it will release a good deal of memory. */ - jpeg_destroy_decompress(&cinfo); - - /* At this point you may want to check to see whether any corrupt-data - * warnings occurred (test whether jerr.pub.num_warnings is nonzero). - */ - - /* And we're done! */ - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageJPG::Encode(CxFile * hFile) -{ - if (EncodeSafeCheck(hFile)) return false; - - if (head.biClrUsed!=0 && !IsGrayScale()){ - strcpy(info.szLastError,"JPEG can save only RGB or GreyScale images"); - return false; - } - - // necessary for EXIF, and for roll backs - long pos=hFile->Tell(); - - /* This struct contains the JPEG compression parameters and pointers to - * working space (which is allocated as needed by the JPEG library). - * It is possible to have several such structures, representing multiple - * compression/decompression processes, in existence at once. We refer - * to any one struct (and its associated working data) as a "JPEG object". - */ - struct jpeg_compress_struct cinfo; - /* This struct represents a JPEG error handler. It is declared separately - * because applications often want to supply a specialized error handler - * (see the second half of this file for an example). But here we just - * take the easy way out and use the standard error handler, which will - * print a message on stderr and call exit() if compression fails. - * Note that this struct must live as long as the main JPEG parameter - * struct, to avoid dangling-pointer problems. - */ - //struct jpeg_error_mgr jerr; - /* We use our private extension JPEG error handler. */ - struct jpg_error_mgr jerr; - jerr.buffer=info.szLastError; - /* More stuff */ - int row_stride; /* physical row width in image buffer */ - JSAMPARRAY buffer; /* Output row buffer */ - - /* Step 1: allocate and initialize JPEG compression object */ - /* We have to set up the error handler first, in case the initialization - * step fails. (Unlikely, but it could happen if you are out of memory.) - * This routine fills in the contents of struct jerr, and returns jerr's - * address which we place into the link field in cinfo. - */ - //cinfo.err = jpeg_std_error(&jerr); - /* We set up the normal JPEG error routines, then override error_exit. */ - cinfo.err = jpeg_std_error(&jerr.pub); - jerr.pub.error_exit = ima_jpeg_error_exit; - - /* Establish the setjmp return context for my_error_exit to use. */ - if (setjmp(jerr.setjmp_buffer)) { - /* If we get here, the JPEG code has signaled an error. - * We need to clean up the JPEG object, close the input file, and return. - */ - strcpy(info.szLastError, jerr.buffer); // - jpeg_destroy_compress(&cinfo); - return 0; - } - - /* Now we can initialize the JPEG compression object. */ - jpeg_create_compress(&cinfo); - /* Step 2: specify data destination (eg, a file) */ - /* Note: steps 2 and 3 can be done in either order. */ - /* Here we use the library-supplied code to send compressed data to a - * stdio stream. You can also write your own code to do something else. - * VERY IMPORTANT: use "b" option to fopen() if you are on a machine that - * requires it in order to write binary files. - */ - - //jpeg_stdio_dest(&cinfo, outfile); - CxFileJpg dest(hFile); - cinfo.dest = &dest; - - /* Step 3: set parameters for compression */ - /* First we supply a description of the input image. - * Four fields of the cinfo struct must be filled in: - */ - cinfo.image_width = GetWidth(); // image width and height, in pixels - cinfo.image_height = GetHeight(); - - if (IsGrayScale()){ - cinfo.input_components = 1; // # of color components per pixel - cinfo.in_color_space = JCS_GRAYSCALE; /* colorspace of input image */ - } else { - cinfo.input_components = 3; // # of color components per pixel - cinfo.in_color_space = JCS_RGB; /* colorspace of input image */ - } - - /* Now use the library's routine to set default compression parameters. - * (You must set at least cinfo.in_color_space before calling this, - * since the defaults depend on the source color space.) - */ - jpeg_set_defaults(&cinfo); - /* Now you can set any non-default parameters you wish to. - * Here we just illustrate the use of quality (quantization table) scaling: - */ - -//#ifdef C_ARITH_CODING_SUPPORTED - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & ENCODE_ARITHMETIC) != 0) - cinfo.arith_code = TRUE; -//#endif - -//#ifdef ENTROPY_OPT_SUPPORTED - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & ENCODE_OPTIMIZE) != 0) - cinfo.optimize_coding = TRUE; -//#endif - - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & ENCODE_GRAYSCALE) != 0) - jpeg_set_colorspace(&cinfo, JCS_GRAYSCALE); - - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & ENCODE_SMOOTHING) != 0) - cinfo.smoothing_factor = m_nSmoothing; - - jpeg_set_quality(&cinfo, GetJpegQuality(), (GetCodecOption(CXIMAGE_FORMAT_JPG) & ENCODE_BASELINE) != 0); - -//#ifdef C_PROGRESSIVE_SUPPORTED - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & ENCODE_PROGRESSIVE) != 0) - jpeg_simple_progression(&cinfo); -//#endif - -#ifdef C_LOSSLESS_SUPPORTED - if ((GetCodecOption(CXIMAGE_FORMAT_JPG) & ENCODE_LOSSLESS) != 0) - jpeg_simple_lossless(&cinfo, m_nPredictor, m_nPointTransform); -#endif - - cinfo.density_unit=1; - cinfo.X_density=(unsigned short)GetXDPI(); - cinfo.Y_density=(unsigned short)GetYDPI(); - - /* Step 4: Start compressor */ - /* TRUE ensures that we will write a complete interchange-JPEG file. - * Pass TRUE unless you are very sure of what you're doing. - */ - jpeg_start_compress(&cinfo, TRUE); - - /* Step 5: while (scan lines remain to be written) */ - /* jpeg_write_scanlines(...); */ - /* Here we use the library's state variable cinfo.next_scanline as the - * loop counter, so that we don't have to keep track ourselves. - * To keep things simple, we pass one scanline per call; you can pass - * more if you wish, though. - */ - row_stride = info.dwEffWidth; /* JSAMPLEs per row in image_buffer */ - - // "8+row_stride" fix heap deallocation problem during debug??? - buffer = (*cinfo.mem->alloc_sarray) - ((j_common_ptr) &cinfo, JPOOL_IMAGE, 8+row_stride, 1); - - CImageIterator iter(this); - - iter.Upset(); - while (cinfo.next_scanline < cinfo.image_height) { - // info.nProgress = (long)(100*cinfo.next_scanline/cinfo.image_height); - iter.GetRow(buffer[0], row_stride); - // not necessary if swapped red and blue definition in jmorecfg.h;ln322 - if (head.biClrUsed==0){ // swap R & B for RGB images - RGBtoBGR(buffer[0], row_stride); // Lance : 1998/09/01 : Bug ID: EXP-2.1.1-9 - } - iter.PrevRow(); - (void) jpeg_write_scanlines(&cinfo, buffer, 1); - } - - /* Step 6: Finish compression */ - jpeg_finish_compress(&cinfo); - - /* Step 7: release JPEG compression object */ - /* This is an important step since it will release a good deal of memory. */ - jpeg_destroy_compress(&cinfo); - - -#if CXIMAGEJPG_SUPPORT_EXIF - if (m_exif && m_exif->m_exifinfo->IsExif){ - // discard useless sections (if any) read from original image - m_exif->DiscardAllButExif(); - // read new created image, to split the sections - hFile->Seek(pos,SEEK_SET); - m_exif->DecodeExif(hFile,EXIF_READ_IMAGE); - // save back the image, adding EXIF section - hFile->Seek(pos,SEEK_SET); - m_exif->EncodeExif(hFile); - } -#endif - - - /* And we're done! */ - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_JPG - diff --git a/src/win32/dependencies/cximage/ximajpg.h b/src/win32/dependencies/cximage/ximajpg.h deleted file mode 100644 index 8d5f5cec..00000000 --- a/src/win32/dependencies/cximage/ximajpg.h +++ /dev/null @@ -1,315 +0,0 @@ -/* - * File: ximajpg.h - * Purpose: JPG Image Class Loader and Writer - */ -/* ========================================================== - * CxImageJPG (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes - * - * Special thanks to Chris Shearer Cooper for CxFileJpg tips & code - * - * EXIF support based on jhead-1.8 by Matthias Wandel - * - * original CImageJPG and CImageIterator implementation are: - * Copyright: (c) 1995, Alejandro Aguilar Sierra - * - * This software is based in part on the work of the Independent JPEG Group. - * Copyright (C) 1991-1998, Thomas G. Lane. - * ========================================================== - */ -#if !defined(__ximaJPEG_h) -#define __ixmaJPEG_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_JPG - -#define CXIMAGEJPG_SUPPORT_EXIF 1 - -extern "C" { - #include "../jpeg/jpeglib.h" - #include "../jpeg/jerror.h" -} - -class DLL_EXP CxImageJPG: public CxImage -{ -public: - CxImageJPG(); - ~CxImageJPG(); - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_JPG);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_JPG);} - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE - -/* - * EXIF support based on jhead-1.8 by Matthias Wandel - */ - -#if CXIMAGEJPG_SUPPORT_EXIF - -#define MAX_COMMENT 1000 -#define MAX_SECTIONS 20 - -typedef struct tag_ExifInfo { - char Version [5]; - char CameraMake [32]; - char CameraModel [40]; - char DateTime [20]; - int Height, Width; - int Orientation; - int IsColor; - int Process; - int FlashUsed; - float FocalLength; - float ExposureTime; - float ApertureFNumber; - float Distance; - float CCDWidth; - float ExposureBias; - int Whitebalance; - int MeteringMode; - int ExposureProgram; - int ISOequivalent; - int CompressionLevel; - float FocalplaneXRes; - float FocalplaneYRes; - float FocalplaneUnits; - float Xresolution; - float Yresolution; - float ResolutionUnit; - float Brightness; - char Comments[MAX_COMMENT]; - - unsigned char * ThumbnailPointer; /* Pointer at the thumbnail */ - unsigned ThumbnailSize; /* Size of thumbnail. */ - - bool IsExif; -} EXIFINFO; - -//-------------------------------------------------------------------------- -// JPEG markers consist of one or more 0xFF bytes, followed by a marker -// code byte (which is not an FF). Here are the marker codes of interest -// in this program. (See jdmarker.c for a more complete list.) -//-------------------------------------------------------------------------- - -#define M_SOF0 0xC0 // Start Of Frame N -#define M_SOF1 0xC1 // N indicates which compression process -#define M_SOF2 0xC2 // Only SOF0-SOF2 are now in common use -#define M_SOF3 0xC3 -#define M_SOF5 0xC5 // NB: codes C4 and CC are NOT SOF markers -#define M_SOF6 0xC6 -#define M_SOF7 0xC7 -#define M_SOF9 0xC9 -#define M_SOF10 0xCA -#define M_SOF11 0xCB -#define M_SOF13 0xCD -#define M_SOF14 0xCE -#define M_SOF15 0xCF -#define M_SOI 0xD8 // Start Of Image (beginning of datastream) -#define M_EOI 0xD9 // End Of Image (end of datastream) -#define M_SOS 0xDA // Start Of Scan (begins compressed data) -#define M_JFIF 0xE0 // Jfif marker -#define M_EXIF 0xE1 // Exif marker -#define M_COM 0xFE // COMment - -#define PSEUDO_IMAGE_MARKER 0x123; // Extra value. - -#define EXIF_READ_EXIF 0x01 -#define EXIF_READ_IMAGE 0x02 -#define EXIF_READ_ALL 0x03 - -class DLL_EXP CxExifInfo -{ - -typedef struct tag_Section_t{ - BYTE* Data; - int Type; - unsigned Size; -} Section_t; - -public: - EXIFINFO* m_exifinfo; - char m_szLastError[256]; - CxExifInfo(EXIFINFO* info = NULL); - ~CxExifInfo(); - bool DecodeExif(CxFile * hFile, int nReadMode = EXIF_READ_EXIF); - bool EncodeExif(CxFile * hFile); - void DiscardAllButExif(); -protected: - bool process_EXIF(unsigned char * CharBuf, unsigned int length); - void process_COM (const BYTE * Data, int length); - void process_SOFn (const BYTE * Data, int marker); - int Get16u(void * Short); - int Get16m(void * Short); - long Get32s(void * Long); - unsigned long Get32u(void * Long); - double ConvertAnyFormat(void * ValuePtr, int Format); - void* FindSection(int SectionType); - bool ProcessExifDir(unsigned char * DirStart, unsigned char * OffsetBase, unsigned ExifLength, - EXIFINFO * const pInfo, unsigned char ** const LastExifRefdP); - int ExifImageWidth; - int MotorolaOrder; - Section_t Sections[MAX_SECTIONS]; - int SectionsRead; - bool freeinfo; -}; - - CxExifInfo* m_exif; - EXIFINFO m_exifinfo; - bool DecodeExif(CxFile * hFile); - bool DecodeExif(FILE * hFile) { CxIOFile file(hFile); return DecodeExif(&file); } - -#endif //CXIMAGEJPG_SUPPORT_EXIF - -//////////////////////////////////////////////////////////////////////////////////////// -////////////////////// C x F i l e J p g //////////////////////////////// -//////////////////////////////////////////////////////////////////////////////////////// - -// thanks to Chris Shearer Cooper -class CxFileJpg : public jpeg_destination_mgr, public jpeg_source_mgr - { -public: - enum { eBufSize = 4096 }; - - CxFileJpg(CxFile* pFile) - { - m_pFile = pFile; - - init_destination = InitDestination; - empty_output_buffer = EmptyOutputBuffer; - term_destination = TermDestination; - - init_source = InitSource; - fill_input_buffer = FillInputBuffer; - skip_input_data = SkipInputData; - resync_to_restart = jpeg_resync_to_restart; // use default method - term_source = TermSource; - next_input_byte = NULL; //* => next byte to read from buffer - bytes_in_buffer = 0; //* # of bytes remaining in buffer - - m_pBuffer = new unsigned char[eBufSize]; - } - ~CxFileJpg() - { - delete [] m_pBuffer; - } - - static void InitDestination(j_compress_ptr cinfo) - { - CxFileJpg* pDest = (CxFileJpg*)cinfo->dest; - pDest->next_output_byte = pDest->m_pBuffer; - pDest->free_in_buffer = eBufSize; - } - - static boolean EmptyOutputBuffer(j_compress_ptr cinfo) - { - CxFileJpg* pDest = (CxFileJpg*)cinfo->dest; - if (pDest->m_pFile->Write(pDest->m_pBuffer,1,eBufSize)!=(size_t)eBufSize) - ERREXIT(cinfo, JERR_FILE_WRITE); - pDest->next_output_byte = pDest->m_pBuffer; - pDest->free_in_buffer = eBufSize; - return TRUE; - } - - static void TermDestination(j_compress_ptr cinfo) - { - CxFileJpg* pDest = (CxFileJpg*)cinfo->dest; - size_t datacount = eBufSize - pDest->free_in_buffer; - /* Write any data remaining in the buffer */ - if (datacount > 0) { - if (!pDest->m_pFile->Write(pDest->m_pBuffer,1,datacount)) - ERREXIT(cinfo, JERR_FILE_WRITE); - } - pDest->m_pFile->Flush(); - /* Make sure we wrote the output file OK */ - if (pDest->m_pFile->Error()) ERREXIT(cinfo, JERR_FILE_WRITE); - return; - } - - static void InitSource(j_decompress_ptr cinfo) - { - CxFileJpg* pSource = (CxFileJpg*)cinfo->src; - pSource->m_bStartOfFile = TRUE; - } - - static boolean FillInputBuffer(j_decompress_ptr cinfo) - { - size_t nbytes; - CxFileJpg* pSource = (CxFileJpg*)cinfo->src; - nbytes = pSource->m_pFile->Read(pSource->m_pBuffer,1,eBufSize); - if (nbytes <= 0){ - if (pSource->m_bStartOfFile) //* Treat empty input file as fatal error - ERREXIT(cinfo, JERR_INPUT_EMPTY); - WARNMS(cinfo, JWRN_JPEG_EOF); - // Insert a fake EOI marker - pSource->m_pBuffer[0] = (JOCTET) 0xFF; - pSource->m_pBuffer[1] = (JOCTET) JPEG_EOI; - nbytes = 2; - } - pSource->next_input_byte = pSource->m_pBuffer; - pSource->bytes_in_buffer = nbytes; - pSource->m_bStartOfFile = FALSE; - return TRUE; - } - - static void SkipInputData(j_decompress_ptr cinfo, long num_bytes) - { - CxFileJpg* pSource = (CxFileJpg*)cinfo->src; - if (num_bytes > 0){ - while (num_bytes > (long)pSource->bytes_in_buffer){ - num_bytes -= (long)pSource->bytes_in_buffer; - FillInputBuffer(cinfo); - // note we assume that fill_input_buffer will never return FALSE, - // so suspension need not be handled. - } - pSource->next_input_byte += (size_t) num_bytes; - pSource->bytes_in_buffer -= (size_t) num_bytes; - } - } - - static void TermSource(j_decompress_ptr cinfo) - { - return; - } -protected: - CxFile *m_pFile; - unsigned char *m_pBuffer; - bool m_bStartOfFile; -}; - -public: - enum CODEC_OPTION - { - ENCODE_BASELINE = 0x1, - ENCODE_ARITHMETIC = 0x2, - ENCODE_GRAYSCALE = 0x4, - ENCODE_OPTIMIZE = 0x8, - ENCODE_PROGRESSIVE = 0x10, - ENCODE_LOSSLESS = 0x20, - ENCODE_SMOOTHING = 0x40, - DECODE_GRAYSCALE = 0x80, - DECODE_QUANTIZE = 0x100, - DECODE_DITHER = 0x200, - DECODE_ONEPASS = 0x400, - DECODE_NOSMOOTH = 0x800 - }; - - int m_nPredictor; - int m_nPointTransform; - int m_nSmoothing; - int m_nQuantize; - J_DITHER_MODE m_nDither; - -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximalpha.cpp b/src/win32/dependencies/cximage/ximalpha.cpp deleted file mode 100644 index b92f33bc..00000000 --- a/src/win32/dependencies/cximage/ximalpha.cpp +++ /dev/null @@ -1,321 +0,0 @@ -// xImalpha.cpp : Alpha channel functions -/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_ALPHA - -//////////////////////////////////////////////////////////////////////////////// -/** - * \sa AlphaSetMax - */ -BYTE CxImage::AlphaGetMax() const -{ - return info.nAlphaMax; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Sets global Alpha (opacity) value applied to the whole image, - * valid only for painting functions. - * \param nAlphaMax: can be from 0 to 255 - */ -void CxImage::AlphaSetMax(BYTE nAlphaMax) -{ - info.nAlphaMax=nAlphaMax; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Checks if the image has a valid alpha channel. - */ -bool CxImage::AlphaIsValid() -{ - return pAlpha!=0; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Enables the alpha palette, so the Draw() function changes its behavior. - */ -void CxImage::AlphaPaletteEnable(bool enable) -{ - info.bAlphaPaletteEnabled=enable; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * True if the alpha palette is enabled for painting. - */ -bool CxImage::AlphaPaletteIsEnabled() -{ - return info.bAlphaPaletteEnabled; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Inverts the alpha channel. - */ -void CxImage::AlphaClear() -{ - if (pAlpha) memset(pAlpha,0,head.biWidth * head.biHeight); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Sets the alpha level for the whole image - */ -void CxImage::AlphaSet(BYTE level) -{ - if (pAlpha) memset(pAlpha,level,head.biWidth * head.biHeight); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Allocates an empty (opaque) alpha channel. - */ -void CxImage::AlphaCreate() -{ - if (pAlpha==NULL) { - pAlpha = (BYTE*)malloc(head.biWidth * head.biHeight); - if (pAlpha) memset(pAlpha,255,head.biWidth * head.biHeight); - } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImage::AlphaDelete() -{ - if (pAlpha) { free(pAlpha); pAlpha=0; } -} -//////////////////////////////////////////////////////////////////////////////// -void CxImage::AlphaInvert() -{ - if (pAlpha) { - BYTE *iSrc=pAlpha; - long n=head.biHeight*head.biWidth; - for(long i=0; i < n; i++){ - *iSrc=(BYTE)~(*(iSrc)); - iSrc++; - } - } -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Imports an existing alpa channel from another image with the same width and height. - */ -bool CxImage::AlphaCopy(CxImage &from) -{ - if (from.pAlpha == NULL || head.biWidth != from.head.biWidth || head.biHeight != from.head.biHeight) return false; - if (pAlpha==NULL) pAlpha = (BYTE*)malloc(head.biWidth * head.biHeight); - if (pAlpha==NULL) return false; - memcpy(pAlpha,from.pAlpha,head.biWidth * head.biHeight); - info.nAlphaMax=from.info.nAlphaMax; - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Creates the alpha channel from a gray scale image. - */ -bool CxImage::AlphaSet(CxImage &from) -{ - if (!from.IsGrayScale() || head.biWidth != from.head.biWidth || head.biHeight != from.head.biHeight) return false; - if (pAlpha==NULL) pAlpha = (BYTE*)malloc(head.biWidth * head.biHeight); - BYTE* src = from.info.pImage; - BYTE* dst = pAlpha; - if (src==NULL || dst==NULL) return false; - for (long y=0; yTransfer(tmp); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Exports the alpha palette channel in a 8bpp grayscale image. - */ -bool CxImage::AlphaPaletteSplit(CxImage *dest) -{ - if (!AlphaPaletteIsValid() || !dest) return false; - - CxImage tmp(head.biWidth,head.biHeight,8); - if (!tmp.IsValid()) return false; - - for(long y=0; yTransfer(tmp); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_ALPHA diff --git a/src/win32/dependencies/cximage/ximalyr.cpp b/src/win32/dependencies/cximage/ximalyr.cpp deleted file mode 100644 index 04301232..00000000 --- a/src/win32/dependencies/cximage/ximalyr.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// xImaLyr.cpp : Layers functions -/* 21/04/2003 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_LAYERS - -//////////////////////////////////////////////////////////////////////////////// -/** - * If the object is an internal layer, GetParent return its parent in the hierarchy. - */ -CxImage* CxImage::GetParent() const -{ - return info.pParent; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Number of layers allocated directly by the object. - */ -long CxImage::GetNumLayers() const -{ - return info.nNumLayers; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Creates an empty layer. If position is less than 0, the new layer will be placed in the last position - */ -bool CxImage::LayerCreate(long position) -{ - if ( position < 0 || position > info.nNumLayers ) position = info.nNumLayers; - - CxImage** ptmp = (CxImage**)malloc((info.nNumLayers + 1)*sizeof(CxImage**)); - if (ptmp==0) return false; - - int i=0; - for (int n=0; ninfo.pParent = this; - } else { - free(ptmp); - return false; - } - - info.nNumLayers++; - if (pLayers) free(pLayers); - pLayers = ptmp; - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Deletes a layer. If position is less than 0, the last layer will be deleted - */ -bool CxImage::LayerDelete(long position) -{ - if ( position >= info.nNumLayers ) return false; - if ( position < 0) position = info.nNumLayers - 1; - - CxImage** ptmp = (CxImage**)malloc((info.nNumLayers - 1)*sizeof(CxImage**)); - if (ptmp==0) return false; - - int i=0; - for (int n=0; n<(info.nNumLayers - 1); n++){ - if (position == n){ - delete pLayers[n]; - i=1; - } - ptmp[n]=pLayers[n+i]; - } - if (i==0) delete pLayers[info.nNumLayers - 1]; - - info.nNumLayers--; - if (pLayers) free(pLayers); - pLayers = ptmp; - return true; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImage::LayerDeleteAll() -{ - if (pLayers) { - for(long n=0; n= info.nNumLayers ) return 0; - if ( position < 0) position = info.nNumLayers - 1; - return pLayers[position]; -} -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_LAYERS diff --git a/src/win32/dependencies/cximage/ximamng.cpp b/src/win32/dependencies/cximage/ximamng.cpp deleted file mode 100644 index 1c43aa9a..00000000 --- a/src/win32/dependencies/cximage/ximamng.cpp +++ /dev/null @@ -1,366 +0,0 @@ -/* - * File: ximamng.cpp - * Purpose: Platform Independent MNG Image Class Loader and Writer - * Author: 07/Aug/2001 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximamng.h" - -#if CXIMAGE_SUPPORT_MNG - -//////////////////////////////////////////////////////////////////////////////// -// callbacks for the mng decoder: -//////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -// memory allocation; data must be zeroed -static mng_ptr -mymngalloc( mng_uint32 size ) -{ - return (mng_ptr)calloc(1, size); -} - -//////////////////////////////////////////////////////////////////////////////// -// memory deallocation -static void mymngfree(mng_ptr p, mng_uint32 size) -{ - free(p); -} - -//////////////////////////////////////////////////////////////////////////////// -// Stream open/close: -// since the user is responsible for opening and closing the file, -// we leave the default implementation open -static mng_bool mymngopenstream(mng_handle mng) { return MNG_TRUE; } -static mng_bool mymngopenstreamwrite(mng_handle mng) { return MNG_TRUE; } -static mng_bool mymngclosestream(mng_handle mng) { return MNG_TRUE; } - -//////////////////////////////////////////////////////////////////////////////// -// feed data to the decoder -static mng_bool mymngreadstream(mng_handle mng, mng_ptr buffer, mng_uint32 size, mng_uint32 *bytesread) -{ - mngstuff *mymng = (mngstuff *)mng_get_userdata(mng); - // read the requested amount of data from the file - *bytesread = mymng->file->Read( buffer, sizeof(BYTE), size); - return MNG_TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// -static mng_bool mymngwritestream (mng_handle mng, mng_ptr pBuf, mng_uint32 iSize, mng_uint32 *iWritten) -{ - mngstuff *mymng = (mngstuff *)mng_get_userdata(mng); - // write it - *iWritten = mymng->file->Write (pBuf, 1, iSize); - return MNG_TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// -// the header's been read. set up the display stuff -static mng_bool mymngprocessheader( mng_handle mng, mng_uint32 width, mng_uint32 height ) -{ - // normally the image buffer is allocated here, - // but in this module we don't know nothing about - // the final environment. - - mngstuff *mymng = (mngstuff *)mng_get_userdata(mng); - - mymng->width = width; - mymng->height = height; - mymng->bpp = 24; - mymng->effwdt = ((((width * mymng->bpp) + 31) >> 5) << 2); - - if (mng->bUseBKGD){ - mymng->nBkgndIndex = 0; - mymng->nBkgndColor.rgbRed = mng->iBGred >> 8; - mymng->nBkgndColor.rgbGreen =mng->iBGgreen >> 8; - mymng->nBkgndColor.rgbBlue = mng->iBGblue >> 8; - } - - mymng->image = (BYTE*)malloc(height * mymng->effwdt); - - // tell the mng decoder about our bit-depth choice - mng_set_canvasstyle( mng, MNG_CANVAS_BGR8 ); - return MNG_TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// -// return a row pointer for the decoder to fill -static mng_ptr mymnggetcanvasline( mng_handle mng, mng_uint32 line ) -{ - mngstuff *mymng = (mngstuff *)mng_get_userdata(mng); - return (mng_ptr)(mymng->image + (mymng->effwdt * (mymng->height - 1 - line))); -} - -//////////////////////////////////////////////////////////////////////////////// -// timer -static mng_uint32 mymnggetticks(mng_handle mng) -{ -#ifdef WIN32 - return (mng_uint32)GetTickCount(); -#else - return 0; -#endif -} - -//////////////////////////////////////////////////////////////////////////////// -// Refresh: actual frame need to be updated (Invalidate) -static mng_bool mymngrefresh(mng_handle mng, mng_uint32 x, mng_uint32 y, mng_uint32 w, mng_uint32 h) -{ -// mngstuff *mymng = (mngstuff *)mng_get_userdata(mng); - return MNG_TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// -// interframe delay callback -static mng_bool mymngsettimer(mng_handle mng, mng_uint32 msecs) -{ - mngstuff *mymng = (mngstuff *)mng_get_userdata(mng); - mymng->delay = msecs; // set the timer for when the decoder wants to be woken - return MNG_TRUE; -} - -//////////////////////////////////////////////////////////////////////////////// -static mng_bool mymngerror(mng_handle mng, mng_int32 code, mng_int8 severity, mng_chunkid chunktype, mng_uint32 chunkseq, mng_int32 extra1, mng_int32 extra2, mng_pchar text) -{ - //throw (const char *)text; - return mng_cleanup(&mng); // -} - -//////////////////////////////////////////////////////////////////////////////// -// CxImage members -//////////////////////////////////////////////////////////////////////////////// -CxImageMNG::CxImageMNG(): CxImage(CXIMAGE_FORMAT_MNG) -{ - hmng = NULL; - memset(&mnginfo,0,sizeof(mngstuff)); - mnginfo.nBkgndIndex = -1; - mnginfo.speed = 1.0f; -} -//////////////////////////////////////////////////////////////////////////////// -CxImageMNG::~CxImageMNG() -{ - // cleanup and return - if (mnginfo.thread){ //close the animation thread - mnginfo.animation_enabled=0; - ResumeThread(mnginfo.thread); - WaitForSingleObject(mnginfo.thread,500); - CloseHandle(mnginfo.thread); - } - // free objects - if (mnginfo.image) free(mnginfo.image); - if (hmng) mng_cleanup(&hmng); //be sure it's not needed any more. (active timers ?) -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageMNG::SetCallbacks(mng_handle mng) -{ - // set the callbacks - mng_setcb_errorproc(mng, mymngerror); - mng_setcb_openstream(mng, mymngopenstream); - mng_setcb_closestream(mng, mymngclosestream); - mng_setcb_readdata(mng, mymngreadstream); - mng_setcb_processheader(mng, mymngprocessheader); - mng_setcb_getcanvasline(mng, mymnggetcanvasline); - mng_setcb_refresh(mng, mymngrefresh); - mng_setcb_gettickcount(mng, mymnggetticks); - mng_setcb_settimer(mng, mymngsettimer); - mng_setcb_refresh(mng, mymngrefresh); -} -//////////////////////////////////////////////////////////////////////////////// -// can't use the CxImage implementation because it looses mnginfo -bool CxImageMNG::Load(const char * imageFileName){ - FILE* hFile; //file handle to read the image - if ((hFile=fopen(imageFileName,"rb"))==NULL) return false; - bool bOK = Decode(hFile); - fclose(hFile); - return bOK; -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImageMNG::Decode(CxFile *hFile) -{ - if (hFile == NULL) return false; - - try { - // set up the mng decoder for our stream - hmng = mng_initialize(&mnginfo, mymngalloc, mymngfree, MNG_NULL); - if (hmng == NULL) throw "could not initialize libmng"; - - // set the file we want to play - mnginfo.file = hFile; - - // Set the colorprofile, lcms uses this: - mng_set_srgb(hmng, MNG_TRUE ); - // Set white as background color: - WORD Red,Green,Blue; - Red = Green = Blue = (255 << 8) + 255; - mng_set_bgcolor(hmng, Red, Green, Blue ); - // If PNG Background is available, use it: - mng_set_usebkgd(hmng, MNG_TRUE ); - - // No need to store chunks: - mng_set_storechunks(hmng, MNG_FALSE); - // No need to wait: straight reading - mng_set_suspensionmode(hmng, MNG_FALSE); - - SetCallbacks(hmng); - - mng_datap pData = (mng_datap)hmng; - - // read in the image - info.nNumFrames=0; - mng_readdisplay(hmng); - - // read all - int retval=MNG_NOERROR; - while(pData->bReading){ - retval = mng_display_resume(hmng); - info.nNumFrames++; - } - - // single frame check: - if (retval != MNG_NEEDTIMERWAIT){ - info.nNumFrames--; - } else { - mnginfo.animation=1; - } - - if (info.nNumFrames<=0) info.nNumFrames=1; - - if (mnginfo.animation_enabled==0){ - // select the frame - if (info.nFrame>=0 && info.nFramewidth,OffsetH=mymng->height; - - BYTE *tmpbuffer = new BYTE[ (mymng->effwdt+1) * mymng->height]; - if( tmpbuffer == 0 ) return; - - // Write DEFI chunk. - mng_putchunk_defi( hMNG, 0, 0, 0, MNG_TRUE, OffsetX, OffsetY, MNG_FALSE, 0, 0, 0, 0 ); - - // Write Header: - mng_putchunk_ihdr( - hMNG, - OffsetW, OffsetH, - MNG_BITDEPTH_8, - MNG_COLORTYPE_RGB, - MNG_COMPRESSION_DEFLATE, - MNG_FILTER_ADAPTIVE, - MNG_INTERLACE_NONE - ); - - // transfer data, add Filterbyte: - for( int Row=0; Row No Filter. - tmpbuffer[Row*(mymng->effwdt+1)]=0; - // Copy the scanline: (reverse order) - memcpy(tmpbuffer+Row*(mymng->effwdt+1)+1, - mymng->image+((OffsetH-1-(OffsetY+Row))*(mymng->effwdt))+OffsetX,mymng->effwdt); - // swap red and blue components - RGBtoBGR(tmpbuffer+Row*(mymng->effwdt+1)+1,mymng->effwdt); - } - - // Compress data with ZLib (Deflate): - BYTE *dstbuffer = new BYTE[(mymng->effwdt+1)*OffsetH]; - if( dstbuffer == 0 ) return; - DWORD dstbufferSize=(mymng->effwdt+1)*OffsetH; - - // Compress data: - if(Z_OK != compress2((Bytef *)dstbuffer,(ULONG *)&dstbufferSize,(const Bytef*)tmpbuffer, - (ULONG) (mymng->effwdt+1)*OffsetH,9 )) return; - - // Write Data into MNG File: - mng_putchunk_idat( hMNG, dstbufferSize, (mng_ptr*)dstbuffer); - mng_putchunk_iend(hMNG); - - // Free the stuff: - delete [] tmpbuffer; - delete [] dstbuffer; -} -//////////////////////////////////////////////////////////////////////////////// -long CxImageMNG::Resume() -{ - if (MNG_NEEDTIMERWAIT == mng_display_resume(hmng)){ - if (info.pImage==NULL) Create(mnginfo.width,mnginfo.height,mnginfo.bpp, CXIMAGE_FORMAT_MNG); - if (IsValid()) memcpy(GetBits(), mnginfo.image, mnginfo.effwdt * mnginfo.height); - } else { - mnginfo.animation_enabled = 0; - } - return mnginfo.animation_enabled; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageMNG::SetSpeed(float speed) -{ - if (speed>10.0) mnginfo.speed = 10.0f; - else if (speed<0.1) mnginfo.speed = 0.1f; - else mnginfo.speed=speed; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_MNG diff --git a/src/win32/dependencies/cximage/ximamng.h b/src/win32/dependencies/cximage/ximamng.h deleted file mode 100644 index 1b23d4c0..00000000 --- a/src/win32/dependencies/cximage/ximamng.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - * File: ximamng.h - * Purpose: Declaration of the MNG Image Class - * Author: Davide Pizzolato - www.xdp.it - * Created: 2001 - */ -/* ========================================================== - * CxImageMNG (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * Special thanks to Frank Haug for suggestions and code. - * - * original mng.cpp code created by Nikolaus Brennig, November 14th, 2000. - * - * LIBMNG Copyright (c) 2000,2001 Gerard Juyn (gerard@libmng.com) - * ========================================================== - */ - -#if !defined(__ximaMNG_h) -#define __ximaMNG_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_MNG - -//#define MNG_NO_CMS -#define MNG_SUPPORT_DISPLAY -#define MNG_SUPPORT_READ -#define MNG_SUPPORT_WRITE -#define MNG_ACCESS_CHUNKS -#define MNG_STORE_CHUNKS - -extern "C" { -#include "../mng/libmng.h" -#include "../mng/libmng_data.h" -} - -//unsigned long _stdcall RunMNGThread(void *lpParam); - -typedef struct tagmngstuff -{ - CxFile *file; - BYTE *image; - HANDLE thread; - mng_uint32 delay; - mng_uint32 width; - mng_uint32 height; - mng_uint32 effwdt; - mng_int16 bpp; - mng_bool animation; - mng_bool animation_enabled; - float speed; - long nBkgndIndex; - RGBQUAD nBkgndColor; -} mngstuff; - -class CxImageMNG: public CxImage -{ -public: - CxImageMNG(); - ~CxImageMNG(); - - bool Load(const char * imageFileName); - bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_MNG);} - - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE - - long Resume(); - void SetSpeed(float speed); - - mng_handle hmng; - mngstuff mnginfo; -protected: - void WritePNG(mng_handle hMNG, int Frame, int FrameCount ); - void SetCallbacks(mng_handle mng); -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximapal.cpp b/src/win32/dependencies/cximage/ximapal.cpp deleted file mode 100644 index 78cd7053..00000000 --- a/src/win32/dependencies/cximage/ximapal.cpp +++ /dev/null @@ -1,707 +0,0 @@ -// xImaPal.cpp : Palette and Pixel functions -/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -//////////////////////////////////////////////////////////////////////////////// -/** - * returns the palette dimension in byte - */ -DWORD CxImage::GetPaletteSize() -{ - return (head.biClrUsed * sizeof(RGBQUAD)); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImage::SetPaletteColor(BYTE idx, BYTE r, BYTE g, BYTE b, BYTE alpha) -{ - if ((pDib)&&(head.biClrUsed)){ - BYTE* iDst = (BYTE*)(pDib) + sizeof(BITMAPINFOHEADER); - if (idx=head.biWidth)||(y>=head.biHeight)) { - if (info.nBkgndIndex != -1) return (BYTE)info.nBkgndIndex; - else return *info.pImage; - } - if (head.biBitCount==8){ - return info.pImage[y*info.dwEffWidth + x]; - } else { - BYTE pos; - BYTE iDst= info.pImage[y*info.dwEffWidth + (x*head.biBitCount >> 3)]; - if (head.biBitCount==4){ - pos = (BYTE)(4*(1-x%2)); - iDst &= (0x0F<> pos); - } else if (head.biBitCount==1){ - pos = (BYTE)(7-x%8); - iDst &= (0x01<> pos); - } - } - return 0; -} -//////////////////////////////////////////////////////////////////////////////// -BYTE CxImage::BlindGetPixelIndex(const long x,const long y) -{ -#ifdef _DEBUG - if ((pDib==NULL) || (head.biClrUsed==0) || !IsInside(x,y)) throw 0; -#endif - - if (head.biBitCount==8){ - return info.pImage[y*info.dwEffWidth + x]; - } else { - BYTE pos; - BYTE iDst= info.pImage[y*info.dwEffWidth + (x*head.biBitCount >> 3)]; - if (head.biBitCount==4){ - pos = (BYTE)(4*(1-x%2)); - iDst &= (0x0F<> pos); - } else if (head.biBitCount==1){ - pos = (BYTE)(7-x%8); - iDst &= (0x01<> pos); - } - } - return 0; -} -//////////////////////////////////////////////////////////////////////////////// -RGBQUAD CxImage::GetPixelColor(long x,long y, bool bGetAlpha) -{ -// RGBQUAD rgb={0,0,0,0}; - RGBQUAD rgb=info.nBkgndColor; // - if ((pDib==NULL)||(x<0)||(y<0)|| - (x>=head.biWidth)||(y>=head.biHeight)){ - if (info.nBkgndIndex != -1){ - if (head.biBitCount<24) return GetPaletteColor((BYTE)info.nBkgndIndex); - else return info.nBkgndColor; - } else if (pDib) return GetPixelColor(0,0); - return rgb; - } - - if (head.biClrUsed){ - rgb = GetPaletteColor(GetPixelIndex(x,y)); - } else { - BYTE* iDst = info.pImage + y*info.dwEffWidth + x*3; - rgb.rgbBlue = *iDst++; - rgb.rgbGreen= *iDst++; - rgb.rgbRed = *iDst; - } -#if CXIMAGE_SUPPORT_ALPHA - if (pAlpha && bGetAlpha) rgb.rgbReserved = AlphaGet(x,y); -#else - rgb.rgbReserved = 0; -#endif //CXIMAGE_SUPPORT_ALPHA - return rgb; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * This is (a bit) faster version of GetPixelColor. - * It tests bounds only in debug mode (_DEBUG defined). - * - * It is an error to request out-of-borders pixel with this method. - * In DEBUG mode an exception will be thrown, and data will be violated in non-DEBUG mode. - * \author ***bd*** 2.2004 - */ -RGBQUAD CxImage::BlindGetPixelColor(const long x,const long y) -{ - RGBQUAD rgb; -#ifdef _DEBUG - if ((pDib==NULL) || !IsInside(x,y)) throw 0; -#endif - - if (head.biClrUsed){ - return GetPaletteColor(BlindGetPixelIndex(x,y)); - } - - BYTE* iDst = info.pImage + y*info.dwEffWidth + x*3; - rgb.rgbBlue = *iDst++; - rgb.rgbGreen= *iDst++; - rgb.rgbRed = *iDst; -#if CXIMAGE_SUPPORT_ALPHA - if (pAlpha) rgb.rgbReserved = pAlpha[x+y*head.biWidth]; -#else - rgb.rgbReserved = 0; -#endif //CXIMAGE_SUPPORT_ALPHA - return rgb; -} -//////////////////////////////////////////////////////////////////////////////// -BYTE CxImage::GetPixelGray(long x, long y) -{ - RGBQUAD color = GetPixelColor(x,y); - return (BYTE)RGB2GRAY(color.rgbRed,color.rgbGreen,color.rgbBlue); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImage::SetPixelIndex(long x,long y,BYTE i) -{ - if ((pDib==NULL)||(head.biClrUsed==0)|| - (x<0)||(y<0)||(x>=head.biWidth)||(y>=head.biHeight)) return ; - - if (head.biBitCount==8){ - info.pImage[y*info.dwEffWidth + x]=i; - return; - } else { - BYTE pos; - BYTE* iDst= info.pImage + y*info.dwEffWidth + (x*head.biBitCount >> 3); - if (head.biBitCount==4){ - pos = (BYTE)(4*(1-x%2)); - *iDst &= ~(0x0F<=head.biWidth)||(y>=head.biHeight)) return; - if (head.biClrUsed) - SetPixelIndex(x,y,GetNearestIndex(c)); - else { - BYTE* iDst = info.pImage + y*info.dwEffWidth + x*3; - *iDst++ = c.rgbBlue; - *iDst++ = c.rgbGreen; - *iDst = c.rgbRed; -#if CXIMAGE_SUPPORT_ALPHA - if (bSetAlpha) AlphaSet(x,y,c.rgbReserved); -#endif //CXIMAGE_SUPPORT_ALPHA - } -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Blends the current pixel color with a new color. - * \param x,y = pixel - * \param c = new color - * \param blend = can be from 0 (no effect) to 1 (full effect). - * \param bSetAlpha = if true, blends also the alpha component stored in c.rgbReserved - */ -void CxImage::BlendPixelColor(long x,long y,RGBQUAD c, float blend, bool bSetAlpha) -{ - if ((pDib==NULL)||(x<0)||(y<0)|| - (x>=head.biWidth)||(y>=head.biHeight)) return; - - int a0 = (int)(256*blend); - int a1 = 256 - a0; - - RGBQUAD c0 = BlindGetPixelColor(x,y); - c.rgbRed = (BYTE)((c.rgbRed * a0 + c0.rgbRed * a1)>>8); - c.rgbBlue = (BYTE)((c.rgbBlue * a0 + c0.rgbBlue * a1)>>8); - c.rgbGreen = (BYTE)((c.rgbGreen * a0 + c0.rgbGreen * a1)>>8); - - if (head.biClrUsed) - SetPixelIndex(x,y,GetNearestIndex(c)); - else { - BYTE* iDst = info.pImage + y*info.dwEffWidth + x*3; - *iDst++ = c.rgbBlue; - *iDst++ = c.rgbGreen; - *iDst = c.rgbRed; -#if CXIMAGE_SUPPORT_ALPHA - if (bSetAlpha) AlphaSet(x,y,c.rgbReserved); -#endif //CXIMAGE_SUPPORT_ALPHA - } -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Returns the best palette index that matches a specified color. - */ -BYTE CxImage::GetNearestIndex(RGBQUAD c) -{ - if ((pDib==NULL)||(head.biClrUsed==0)) return 0; - - // check matching with the previous result - if (info.last_c_isvalid && (*(long*)&info.last_c == *(long*)&c)) return info.last_c_index; - info.last_c = c; - info.last_c_isvalid = true; - - BYTE* iDst = (BYTE*)(pDib) + sizeof(BITMAPINFOHEADER); - long distance=200000; - int i,j = 0; - long k,l; - int m = (int)(head.biClrImportant==0 ? head.biClrUsed : head.biClrImportant); - for(i=0,l=0;i100) perc=100; - for(i=0;i=0){ - if (head.biClrUsed){ - if (GetPixelIndex(x,y) == info.nBkgndIndex) return true; - } else { - RGBQUAD ct = info.nBkgndColor; - RGBQUAD c = GetPixelColor(x,y,false); - if (*(long*)&c==*(long*)&ct) return true; - } - } - -#if CXIMAGE_SUPPORT_ALPHA - if (pAlpha) return AlphaGet(x,y)==0; -#endif - - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Checks if image has the same palette, if any. - * \param img = image to compare. - * \param bCheckAlpha = check also the rgbReserved field. - */ -bool CxImage::IsSamePalette(CxImage &img, bool bCheckAlpha) -{ - if (head.biClrUsed != img.head.biClrUsed) - return false; - if (head.biClrUsed == 0) - return false; - - RGBQUAD c1,c2; - for (DWORD n=0; n256) { - head.biClrImportant = 0; - return; - } - - switch(head.biBitCount){ - case 1: - head.biClrImportant = min(ncolors,2); - break; - case 4: - head.biClrImportant = min(ncolors,16); - break; - case 8: - head.biClrImportant = ncolors; - break; - } - return; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Returns pointer to pixel. Currently implemented only for truecolor images. - * - * \param x,y - coordinates - * - * \return pointer to first byte of pixel data - * - * \author ***bd*** 2.2004 - */ -void* CxImage::BlindGetPixelPointer(const long x, const long y) -{ - if (!IsIndexed()) - return info.pImage + y*info.dwEffWidth + x*3; - else - return 0; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImage::DrawLine(int StartX, int EndX, int StartY, int EndY, COLORREF cr) -{ - DrawLine(StartX, EndX, StartY, EndY, RGBtoRGBQUAD(cr)); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImage::DrawLine(int StartX, int EndX, int StartY, int EndY, RGBQUAD color, bool bSetAlpha) -{ - if (!pDib) return; - ////////////////////////////////////////////////////// - // Draws a line using the Bresenham line algorithm - // Thanks to Jordan DeLozier - ////////////////////////////////////////////////////// - int x1 = StartX; - int y1 = StartY; - int x = x1; // Start x off at the first pixel - int y = y1; // Start y off at the first pixel - int x2 = EndX; - int y2 = EndY; - - int xinc1,xinc2,yinc1,yinc2; // Increasing values - int den, num, numadd,numpixels; - int deltax = abs(x2 - x1); // The difference between the x's - int deltay = abs(y2 - y1); // The difference between the y's - - // Get Increasing Values - if (x2 >= x1) { // The x-values are increasing - xinc1 = 1; - xinc2 = 1; - } else { // The x-values are decreasing - xinc1 = -1; - xinc2 = -1; - } - - if (y2 >= y1) { // The y-values are increasing - yinc1 = 1; - yinc2 = 1; - } else { // The y-values are decreasing - yinc1 = -1; - yinc2 = -1; - } - - // Actually draw the line - if (deltax >= deltay) // There is at least one x-value for every y-value - { - xinc1 = 0; // Don't change the x when numerator >= denominator - yinc2 = 0; // Don't change the y for every iteration - den = deltax; - num = deltax / 2; - numadd = deltay; - numpixels = deltax; // There are more x-values than y-values - } - else // There is at least one y-value for every x-value - { - xinc2 = 0; // Don't change the x for every iteration - yinc1 = 0; // Don't change the y when numerator >= denominator - den = deltay; - num = deltay / 2; - numadd = deltax; - numpixels = deltay; // There are more y-values than x-values - } - - for (int curpixel = 0; curpixel <= numpixels; curpixel++) - { - // Draw the current pixel - SetPixelColor(x,y,color,bSetAlpha); - - num += numadd; // Increase the numerator by the top of the fraction - if (num >= den) // Check if numerator >= denominator - { - num -= den; // Calculate the new numerator value - x += xinc1; // Change the x as appropriate - y += yinc1; // Change the y as appropriate - } - x += xinc2; // Change the x as appropriate - y += yinc2; // Change the y as appropriate - } -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Sets a palette with standard colors for 4 and 8 bpp images. - */ -void CxImage::SetStdPalette() -{ - if (!pDib) return; - switch (head.biBitCount){ - case 8: - { - const BYTE pal256[1024] = {0,0,0,0,0,0,128,0,0,128,0,0,0,128,128,0,128,0,0,0,128,0,128,0,128,128,0,0,192,192,192,0, - 192,220,192,0,240,202,166,0,212,240,255,0,177,226,255,0,142,212,255,0,107,198,255,0, - 72,184,255,0,37,170,255,0,0,170,255,0,0,146,220,0,0,122,185,0,0,98,150,0,0,74,115,0,0, - 50,80,0,212,227,255,0,177,199,255,0,142,171,255,0,107,143,255,0,72,115,255,0,37,87,255,0,0, - 85,255,0,0,73,220,0,0,61,185,0,0,49,150,0,0,37,115,0,0,25,80,0,212,212,255,0,177,177,255,0, - 142,142,255,0,107,107,255,0,72,72,255,0,37,37,255,0,0,0,254,0,0,0,220,0,0,0,185,0,0,0,150,0, - 0,0,115,0,0,0,80,0,227,212,255,0,199,177,255,0,171,142,255,0,143,107,255,0,115,72,255,0, - 87,37,255,0,85,0,255,0,73,0,220,0,61,0,185,0,49,0,150,0,37,0,115,0,25,0,80,0,240,212,255,0, - 226,177,255,0,212,142,255,0,198,107,255,0,184,72,255,0,170,37,255,0,170,0,255,0,146,0,220,0, - 122,0,185,0,98,0,150,0,74,0,115,0,50,0,80,0,255,212,255,0,255,177,255,0,255,142,255,0,255,107,255,0, - 255,72,255,0,255,37,255,0,254,0,254,0,220,0,220,0,185,0,185,0,150,0,150,0,115,0,115,0,80,0,80,0, - 255,212,240,0,255,177,226,0,255,142,212,0,255,107,198,0,255,72,184,0,255,37,170,0,255,0,170,0, - 220,0,146,0,185,0,122,0,150,0,98,0,115,0,74,0,80,0,50,0,255,212,227,0,255,177,199,0,255,142,171,0, - 255,107,143,0,255,72,115,0,255,37,87,0,255,0,85,0,220,0,73,0,185,0,61,0,150,0,49,0,115,0,37,0, - 80,0,25,0,255,212,212,0,255,177,177,0,255,142,142,0,255,107,107,0,255,72,72,0,255,37,37,0,254,0, - 0,0,220,0,0,0,185,0,0,0,150,0,0,0,115,0,0,0,80,0,0,0,255,227,212,0,255,199,177,0,255,171,142,0, - 255,143,107,0,255,115,72,0,255,87,37,0,255,85,0,0,220,73,0,0,185,61,0,0,150,49,0,0,115,37,0, - 0,80,25,0,0,255,240,212,0,255,226,177,0,255,212,142,0,255,198,107,0,255,184,72,0,255,170,37,0, - 255,170,0,0,220,146,0,0,185,122,0,0,150,98,0,0,115,74,0,0,80,50,0,0,255,255,212,0,255,255,177,0, - 255,255,142,0,255,255,107,0,255,255,72,0,255,255,37,0,254,254,0,0,220,220,0,0,185,185,0,0,150,150,0, - 0,115,115,0,0,80,80,0,0,240,255,212,0,226,255,177,0,212,255,142,0,198,255,107,0,184,255,72,0, - 170,255,37,0,170,255,0,0,146,220,0,0,122,185,0,0,98,150,0,0,74,115,0,0,50,80,0,0,227,255,212,0, - 199,255,177,0,171,255,142,0,143,255,107,0,115,255,72,0,87,255,37,0,85,255,0,0,73,220,0,0,61,185,0, - 0,49,150,0,0,37,115,0,0,25,80,0,0,212,255,212,0,177,255,177,0,142,255,142,0,107,255,107,0,72,255,72,0, - 37,255,37,0,0,254,0,0,0,220,0,0,0,185,0,0,0,150,0,0,0,115,0,0,0,80,0,0,212,255,227,0,177,255,199,0, - 142,255,171,0,107,255,143,0,72,255,115,0,37,255,87,0,0,255,85,0,0,220,73,0,0,185,61,0,0,150,49,0,0, - 115,37,0,0,80,25,0,212,255,240,0,177,255,226,0,142,255,212,0,107,255,198,0,72,255,184,0,37,255,170,0, - 0,255,170,0,0,220,146,0,0,185,122,0,0,150,98,0,0,115,74,0,0,80,50,0,212,255,255,0,177,255,255,0, - 142,255,255,0,107,255,255,0,72,255,255,0,37,255,255,0,0,254,254,0,0,220,220,0,0,185,185,0,0, - 150,150,0,0,115,115,0,0,80,80,0,242,242,242,0,230,230,230,0,218,218,218,0,206,206,206,0,194,194,194,0, - 182,182,182,0,170,170,170,0,158,158,158,0,146,146,146,0,134,134,134,0,122,122,122,0,110,110,110,0, - 98,98,98,0,86,86,86,0,74,74,74,0,62,62,62,0,50,50,50,0,38,38,38,0,26,26,26,0,14,14,14,0,240,251,255,0, - 164,160,160,0,128,128,128,0,0,0,255,0,0,255,0,0,0,255,255,0,255,0,0,0,255,0,255,0,255,255,0,0,255,255,255,0}; - memcpy(GetPalette(),pal256,1024); - break; - } - case 4: - { - const BYTE pal16[64]={0,0,0,0,0,0,128,0,0,128,0,0,0,128,128,0,128,0,0,0,128,0,128,0,128,128,0,0,192,192,192,0, - 128,128,128,0,0,0,255,0,0,255,0,0,0,255,255,0,255,0,0,0,255,0,255,0,255,255,0,0,255,255,255,0}; - memcpy(GetPalette(),pal16,64); - break; - } - } - return; -} -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/win32/dependencies/cximage/ximapcx.cpp b/src/win32/dependencies/cximage/ximapcx.cpp deleted file mode 100644 index 1717ab64..00000000 --- a/src/win32/dependencies/cximage/ximapcx.cpp +++ /dev/null @@ -1,445 +0,0 @@ -/* - * File: ximapcx.cpp - * Purpose: Platform Independent PCX Image Class Loader and Writer - * 05/Jan/2002 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - * - * based on ppmtopcx.c - convert a portable pixmap to PCX - * Copyright (C) 1994 by Ingo Wilken (Ingo.Wilken@informatik.uni-oldenburg.de) - * based on ppmtopcx.c by Michael Davidson - */ - -#include "ximapcx.h" - -#if CXIMAGE_SUPPORT_PCX - -#include "xmemfile.h" - -#define PCX_MAGIC 0X0A // PCX magic number -#define PCX_256_COLORS 0X0C // magic number for 256 colors -#define PCX_HDR_SIZE 128 // size of PCX header -#define PCX_MAXCOLORS 256 -#define PCX_MAXPLANES 4 -#define PCX_MAXVAL 255 - -//////////////////////////////////////////////////////////////////////////////// -bool CxImagePCX::Decode(CxFile *hFile) -{ - if (hFile == NULL) return false; - - PCXHEADER pcxHeader; - int i, x, y, y2, nbytes, count, Height, Width; - BYTE c, ColorMap[PCX_MAXCOLORS][3]; - BYTE *pcximage = NULL, *lpHead1 = NULL, *lpHead2 = NULL; - BYTE *pcxplanes, *pcxpixels; - - try - { - if (hFile->Read(&pcxHeader,sizeof(PCXHEADER),1)==0) throw "Can't read PCX image"; - - if (pcxHeader.Manufacturer != PCX_MAGIC) throw "Error: Not a PCX file"; - // Check for PCX run length encoding - if (pcxHeader.Encoding != 1) throw "PCX file has unknown encoding scheme"; - - Width = (pcxHeader.Xmax - pcxHeader.Xmin) + 1; - Height = (pcxHeader.Ymax - pcxHeader.Ymin) + 1; - info.xDPI = pcxHeader.Hres; - info.yDPI = pcxHeader.Vres; - - // Check that we can handle this image format - if (pcxHeader.ColorPlanes > 4) - throw "Can't handle image with more than 4 planes"; - - // Create the image - if (pcxHeader.ColorPlanes >= 3 && pcxHeader.BitsPerPixel == 8){ - Create (Width, Height, 24, CXIMAGE_FORMAT_PCX); -#if CXIMAGE_SUPPORT_ALPHA - if (pcxHeader.ColorPlanes==4) AlphaCreate(); -#endif //CXIMAGE_SUPPORT_ALPHA - } else if (pcxHeader.ColorPlanes == 4 && pcxHeader.BitsPerPixel == 1) - Create (Width, Height, 4, CXIMAGE_FORMAT_PCX); - else - Create (Width, Height, pcxHeader.BitsPerPixel, CXIMAGE_FORMAT_PCX); - - if (info.nEscape) throw "Cancelled"; // - cancel decoding - - //Read the image and check if it's ok - nbytes = pcxHeader.BytesPerLine * pcxHeader.ColorPlanes * Height; - lpHead1 = pcximage = (BYTE*)malloc(nbytes); - while (nbytes > 0){ - if (hFile == NULL || hFile->Eof()) throw "corrupted PCX"; - - hFile->Read(&c,1,1); - if ((c & 0XC0) != 0XC0){ // Repeated group - *pcximage++ = c; - --nbytes; - continue; - } - count = c & 0X3F; // extract count - hFile->Read(&c,1,1); - if (count > nbytes) throw "repeat count spans end of image"; - - nbytes -= count; - while (--count >=0) *pcximage++ = c; - } - pcximage = lpHead1; - - //store the palette - for (i = 0; i < 16; i++){ - ColorMap[i][0] = pcxHeader.ColorMap[i][0]; - ColorMap[i][1] = pcxHeader.ColorMap[i][1]; - ColorMap[i][2] = pcxHeader.ColorMap[i][2]; - } - if (pcxHeader.BitsPerPixel == 8 && pcxHeader.ColorPlanes == 1){ - hFile->Read(&c,1,1); - if (c != PCX_256_COLORS) throw "bad color map signature"; - - for (i = 0; i < PCX_MAXCOLORS; i++){ - hFile->Read(&ColorMap[i][0],1,1); - hFile->Read(&ColorMap[i][1],1,1); - hFile->Read(&ColorMap[i][2],1,1); - } - } - if (pcxHeader.BitsPerPixel == 1 && pcxHeader.ColorPlanes == 1){ - ColorMap[0][0] = ColorMap[0][1] = ColorMap[0][2] = 0; - ColorMap[1][0] = ColorMap[1][1] = ColorMap[1][2] = 255; - } - - for (DWORD idx=0; idx - cancel decoding - - y2=Height-1-y; - pcxpixels = lpHead2; - pcxplanes = pcximage + (y * pcxHeader.BytesPerLine * pcxHeader.ColorPlanes); - - if (pcxHeader.ColorPlanes == 3 && pcxHeader.BitsPerPixel == 8){ - // Deal with 24 bit color image - for (x = 0; x < Width; x++){ - SetPixelColor(x,y2,RGB(pcxplanes[x],pcxplanes[pcxHeader.BytesPerLine + x],pcxplanes[2*pcxHeader.BytesPerLine + x])); - } - continue; -#if CXIMAGE_SUPPORT_ALPHA - } else if (pcxHeader.ColorPlanes == 4 && pcxHeader.BitsPerPixel == 8){ - for (x = 0; x < Width; x++){ - SetPixelColor(x,y2,RGB(pcxplanes[x],pcxplanes[pcxHeader.BytesPerLine + x],pcxplanes[2*pcxHeader.BytesPerLine + x])); - AlphaSet(x,y2,pcxplanes[3*pcxHeader.BytesPerLine + x]); - } - continue; -#endif //CXIMAGE_SUPPORT_ALPHA - } else if (pcxHeader.ColorPlanes == 1) { - PCX_UnpackPixels(pcxpixels, pcxplanes, pcxHeader.BytesPerLine, pcxHeader.ColorPlanes, pcxHeader.BitsPerPixel); - } else { - PCX_PlanesToPixels(pcxpixels, pcxplanes, pcxHeader.BytesPerLine, pcxHeader.ColorPlanes, pcxHeader.BitsPerPixel); - } - for (x = 0; x < Width; x++) SetPixelIndex(x,y2,pcxpixels[x]); - } - - } catch (char *message) { - strncpy(info.szLastError,message,255); - if (lpHead1){ free(lpHead1); lpHead1 = NULL; } - if (lpHead2){ free(lpHead2); lpHead2 = NULL; } - return false; - } - if (lpHead1){ free(lpHead1); lpHead1 = NULL; } - if (lpHead2){ free(lpHead2); lpHead2 = NULL; } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImagePCX::Encode(CxFile * hFile) -{ - if (EncodeSafeCheck(hFile)) return false; - - try { - PCXHEADER pcxHeader; - memset(&pcxHeader,0,sizeof(pcxHeader)); - pcxHeader.Manufacturer = PCX_MAGIC; - pcxHeader.Version = 5; - pcxHeader.Encoding = 1; - pcxHeader.Xmin = 0; - pcxHeader.Ymin = 0; - pcxHeader.Xmax = (WORD)head.biWidth-1; - pcxHeader.Ymax = (WORD)head.biHeight-1; - pcxHeader.Hres = (WORD)info.xDPI; - pcxHeader.Vres = (WORD)info.yDPI; - pcxHeader.Reserved = 0; - pcxHeader.PaletteType = head.biClrUsed==0; - - switch(head.biBitCount){ - case 24: - case 8: - { - pcxHeader.BitsPerPixel = 8; - pcxHeader.ColorPlanes = head.biClrUsed==0 ? 3 : 1; -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid() && head.biClrUsed==0) pcxHeader.ColorPlanes =4; -#endif //CXIMAGE_SUPPORT_ALPHA - pcxHeader.BytesPerLine = (WORD)head.biWidth; - break; - } - default: //(4 1) - pcxHeader.BitsPerPixel = 1; - pcxHeader.ColorPlanes = head.biClrUsed==16 ? 4 : 1; - pcxHeader.BytesPerLine = (WORD)((head.biWidth * pcxHeader.BitsPerPixel + 7)>>3); - } - - if (pcxHeader.BitsPerPixel == 1 && pcxHeader.ColorPlanes == 1){ - pcxHeader.ColorMap[0][0] = pcxHeader.ColorMap[0][1] = pcxHeader.ColorMap[0][2] = 0; - pcxHeader.ColorMap[1][0] = pcxHeader.ColorMap[1][1] = pcxHeader.ColorMap[1][2] = 255; - } - if (pcxHeader.BitsPerPixel == 1 && pcxHeader.ColorPlanes == 4){ - RGBQUAD c; - for (int i = 0; i < 16; i++){ - c=GetPaletteColor(i); - pcxHeader.ColorMap[i][0] = c.rgbRed; - pcxHeader.ColorMap[i][1] = c.rgbGreen; - pcxHeader.ColorMap[i][2] = c.rgbBlue; - } - } - - pcxHeader.BytesPerLine = (pcxHeader.BytesPerLine + 1)&(~1); - - if (hFile->Write(&pcxHeader, sizeof(pcxHeader), 1) == 0 ) - throw "cannot write PCX header"; - - CxMemFile buffer; - buffer.Open(); - - BYTE c,n; - long x,y; - if (head.biClrUsed==0){ - for (y = head.biHeight-1; y >=0 ; y--){ - for (int p=0; pWrite(buffer.GetBuffer(false),buffer.Size(),1); - - } else if (head.biBitCount==8) { - - for (y = head.biHeight-1; y >=0 ; y--){ - c=n=0; - for (x = 0; xWrite(buffer.GetBuffer(false),buffer.Size(),1); - - if (head.biBitCount == 8){ - hFile->PutC(0x0C); - BYTE* pal = (BYTE*)malloc(768); - RGBQUAD c; - for (int i=0;i<256;i++){ - c=GetPaletteColor(i); - pal[3*i+0] = c.rgbRed; - pal[3*i+1] = c.rgbGreen; - pal[3*i+2] = c.rgbBlue; - } - hFile->Write(pal,768,1); - free(pal); - } - } else { //(head.biBitCount==4) || (head.biBitCount==1) - - RGBQUAD *rgb = GetPalette(); - bool binvert = false; - if (CompareColors(&rgb[0],&rgb[1])>0) binvert=(head.biBitCount==1); - - BYTE* plane = (BYTE*)malloc(pcxHeader.BytesPerLine); - BYTE* raw = (BYTE*)malloc(head.biWidth); - - for(y = head.biHeight-1; y >=0 ; y--) { - - for( x = 0; x < head.biWidth; x++) raw[x] = (BYTE)GetPixelIndex(x,y); - - if (binvert) for( x = 0; x < head.biWidth; x++) raw[x] = 1-raw[x]; - - for( x = 0; x < pcxHeader.ColorPlanes; x++ ) { - PCX_PixelsToPlanes(raw, head.biWidth, plane, x); - PCX_PackPlanes(plane, pcxHeader.BytesPerLine, buffer); - } - } - - free(plane); - free(raw); - - hFile->Write(buffer.GetBuffer(false),buffer.Size(),1); - - } - - } catch (char *message) { - strncpy(info.szLastError,message,255); - return false; - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -// Convert multi-plane format into 1 pixel per byte -// from unpacked file data bitplanes[] into pixel row pixels[] -// image Height rows, with each row having planes image planes each -// bytesperline bytes -void CxImagePCX::PCX_PlanesToPixels(BYTE * pixels, BYTE * bitplanes, short bytesperline, short planes, short bitsperpixel) -{ - int i, j, npixels; - BYTE * p; - if (planes > 4) throw "Can't handle more than 4 planes"; - if (bitsperpixel != 1) throw "Can't handle more than 1 bit per pixel"; - - // Clear the pixel buffer - npixels = (bytesperline * 8) / bitsperpixel; - p = pixels; - while (--npixels >= 0) *p++ = 0; - - // Do the format conversion - for (i = 0; i < planes; i++){ - int pixbit, bits, mask; - p = pixels; - pixbit = (1 << i); // pixel bit for this plane - for (j = 0; j < bytesperline; j++){ - bits = *bitplanes++; - for (mask = 0X80; mask != 0; mask >>= 1, p++) - if (bits & mask) *p |= pixbit; - } - } -} -//////////////////////////////////////////////////////////////////////////////// -// convert packed pixel format into 1 pixel per byte -// from unpacked file data bitplanes[] into pixel row pixels[] -// image Height rows, with each row having planes image planes each -// bytesperline bytes -void CxImagePCX::PCX_UnpackPixels(BYTE * pixels, BYTE * bitplanes, short bytesperline, short planes, short bitsperpixel) -{ - register int bits; - if (planes != 1) throw "Can't handle packed pixels with more than 1 plane."; - - if (bitsperpixel == 8){ // 8 bits/pixels, no unpacking needed - while (bytesperline-- > 0) *pixels++ = *bitplanes++; - } else if (bitsperpixel == 4){ // 4 bits/pixel, two pixels per byte - while (bytesperline-- > 0){ - bits = *bitplanes++; - *pixels++ = (BYTE)((bits >> 4) & 0X0F); - *pixels++ = (BYTE)((bits) & 0X0F); - } - } else if (bitsperpixel == 2){ // 2 bits/pixel, four pixels per byte - while (bytesperline-- > 0){ - bits = *bitplanes++; - *pixels++ = (BYTE)((bits >> 6) & 0X03); - *pixels++ = (BYTE)((bits >> 4) & 0X03); - *pixels++ = (BYTE)((bits >> 2) & 0X03); - *pixels++ = (BYTE)((bits) & 0X03); - } - } else if (bitsperpixel == 1){ // 1 bits/pixel, 8 pixels per byte - while (bytesperline-- > 0){ - bits = *bitplanes++; - *pixels++ = ((bits & 0X80) != 0); - *pixels++ = ((bits & 0X40) != 0); - *pixels++ = ((bits & 0X20) != 0); - *pixels++ = ((bits & 0X10) != 0); - *pixels++ = ((bits & 0X08) != 0); - *pixels++ = ((bits & 0X04) != 0); - *pixels++ = ((bits & 0X02) != 0); - *pixels++ = ((bits & 0X01) != 0); - } - } -} -//////////////////////////////////////////////////////////////////////////////// -/* PCX_PackPixels(const long p,BYTE &c, BYTE &n, long &l, CxFile &f) - * p = current pixel (-1 ends the line -2 ends odd line) - * c = previous pixel - * n = number of consecutive pixels - */ -void CxImagePCX::PCX_PackPixels(const long p,BYTE &c, BYTE &n, CxFile &f) -{ - if (p!=c && n){ - if (n==1 && c<0xC0){ - f.PutC(c); - } else { - f.PutC(0xC0|n); - f.PutC(c); - } - n=0; - } - if (n==0x3F) { - f.PutC(0xFF); - f.PutC(c); - n=0; - } - if (p==-2) f.PutC(0); - c=(BYTE)p; - n++; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImagePCX::PCX_PackPlanes(BYTE* buff, const long size, CxFile &f) -{ - BYTE *start,*end; - BYTE c, previous, count; - - start = buff; - end = buff + size; - previous = *start++; - count = 1; - - while (start < end) { - c = *start++; - if (c == previous && count < 63) { - ++count; - continue; - } - - if (count > 1 || (previous & 0xc0) == 0xc0) { - f.PutC( count | 0xc0 ); - } - f.PutC(previous); - previous = c; - count = 1; - } - - if (count > 1 || (previous & 0xc0) == 0xc0) { - count |= 0xc0; - f.PutC(count); - } - f.PutC(previous); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImagePCX::PCX_PixelsToPlanes(BYTE* raw, long width, BYTE* buf, long plane) -{ - int cbit, x, mask; - unsigned char *cp = buf-1; - - mask = 1 << plane; - cbit = -1; - for( x = 0; x < width; x++ ) { - if( cbit < 0 ) { - cbit = 7; - *++cp = 0; - } - if( raw[x] & mask ) - *cp |= (1<jmpbuf, 1); -} -//////////////////////////////////////////////////////////////////////////////// -void CxImagePNG::expand2to4bpp(BYTE* prow) -{ - BYTE *psrc,*pdst; - BYTE pos,idx; - for(long x=head.biWidth-1;x>=0;x--){ - psrc = prow + ((2*x)>>3); - pdst = prow + ((4*x)>>3); - pos = (BYTE)(2*(3-x%4)); - idx = (BYTE)((*psrc & (0x03<>pos); - pos = (BYTE)(4*(1-x%2)); - *pdst &= ~(0x0F<jmpbuf)) { - /* Free all of the memory associated with the png_ptr and info_ptr */ - if (row_pointers) delete[] row_pointers; - png_destroy_read_struct(&png_ptr, &info_ptr, (png_infopp)NULL); - throw ""; - } - /* set up the input control */ - //png_init_io(png_ptr, hFile); - - // use custom I/O functions - png_set_read_fn(png_ptr, hFile, (png_rw_ptr)user_read_data); - png_set_error_fn(png_ptr,info.szLastError,(png_error_ptr)user_error_fn,NULL); - - /* read the file information */ - png_read_info(png_ptr, info_ptr); - - /* allocate the memory to hold the image using the fields of png_info. */ - png_color_16 my_background={ 0, 192, 192, 192, 0 }; - png_color_16 *image_background; - - if (info_ptr->pixel_depth != 32){ - // preserve original background info. - if (png_get_bKGD(png_ptr, info_ptr, &image_background)) - png_set_background(png_ptr, image_background,PNG_BACKGROUND_GAMMA_FILE, 1, 1.0); - else - png_set_background(png_ptr, &my_background,PNG_BACKGROUND_GAMMA_SCREEN, 0, 1.0); -// - we call png_set_bgr() below -// // safe check -// if (info_ptr->pixel_depth > 16 ) info_ptr->color_type = COLORTYPE_COLOR; - } - - // hack for images with alpha channel - if (info_ptr->pixel_depth == 32){ -// info.nBkgndIndex = 0; //enable transparency - if (png_get_bKGD(png_ptr, info_ptr, &image_background)){ - info.nBkgndColor.rgbRed = (BYTE)image_background->red; - info.nBkgndColor.rgbGreen = (BYTE)image_background->green; - info.nBkgndColor.rgbBlue = (BYTE)image_background->blue; - info.nBkgndColor.rgbReserved = 0; // - } - } - - /* tell libpng to strip 16 bit depth files down to 8 bits */ - if (info_ptr->bit_depth == 16) png_set_strip_16(png_ptr); - - int pixel_depth=info_ptr->pixel_depth; - if (pixel_depth > 16 ) pixel_depth=24; - if (pixel_depth == 16 ) pixel_depth=8; - - Create(info_ptr->width, info_ptr->height, pixel_depth, CXIMAGE_FORMAT_PNG); - - /* get metrics */ - switch (info_ptr->phys_unit_type) - { - case PNG_RESOLUTION_UNKNOWN: - SetXDPI(info_ptr->x_pixels_per_unit); - SetYDPI(info_ptr->y_pixels_per_unit); - break; - case PNG_RESOLUTION_METER: - SetXDPI((long)floor(info_ptr->x_pixels_per_unit * 254.0 / 10000.0 + 0.5)); - SetYDPI((long)floor(info_ptr->y_pixels_per_unit * 254.0 / 10000.0 + 0.5)); - break; - } - - if (info_ptr->num_palette>0) - SetPalette((rgb_color*)info_ptr->palette,info_ptr->num_palette); - else if (info_ptr->bit_depth ==2) { // needed for 2 bpp grayscale PNGs - SetPaletteColor(0,0,0,0); - SetPaletteColor(1,85,85,85); - SetPaletteColor(2,170,170,170); - SetPaletteColor(3,255,255,255); - } else SetGrayPalette(); // needed for grayscale PNGs - - // simple transparency (the real PGN transparency is more complex) - if (info_ptr->num_trans!=0){ - //palette transparency - RGBQUAD* pal=GetPalette(); - if (pal){ - DWORD ip; - for (ip=0;ipnum_trans);ip++) - pal[ip].rgbReserved=info_ptr->trans[ip]; - if (info_ptr->num_trans==1 && pal[0].rgbReserved==0){ - info.nBkgndIndex = 0; - } else { - info.bAlphaPaletteEnabled=true; - for (;ipcolor_type == PNG_COLOR_TYPE_RGB_ALPHA || //Alpha channel - (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA && info_ptr->pixel_depth == 32)){ - if (info_ptr->color_type == PNG_COLOR_TYPE_GRAY_ALPHA){ - png_set_gray_to_rgb(png_ptr); - png_set_expand(png_ptr); - } -#if CXIMAGE_SUPPORT_ALPHA // - png_set_filler(png_ptr, 0xff, PNG_FILLER_AFTER); - AlphaCreate(); -#else - png_set_strip_alpha(png_ptr); -#endif //CXIMAGE_SUPPORT_ALPHA - } - - // - flip the RGB pixels to BGR (or RGBA to BGRA) - if (info_ptr->color_type & PNG_COLOR_MASK_COLOR) png_set_bgr(png_ptr); - - // - handle cancel - if (info.nEscape) longjmp(png_ptr->jmpbuf, 1); - - //allocate the buffer - int row_stride = info_ptr->width * ((info_ptr->pixel_depth+7)>>3); - row_pointers = new BYTE[10+row_stride]; - - // turn on interlace handling - number_passes = png_set_interlace_handling(png_ptr); - - if (number_passes>1){ - SetCodecOption(1); - } else { - SetCodecOption(0); - } - - for (int pass=0; pass< number_passes; pass++) { - iter.Upset(); - int y=0; - do { - - // - handle cancel - if (info.nEscape) longjmp(png_ptr->jmpbuf, 1); - -#if CXIMAGE_SUPPORT_ALPHA // - if (!AlphaIsValid()) -#endif // CXIMAGE_SUPPORT_ALPHA - { - //recover data from previous scan - if (info_ptr->interlace_type && pass>0) - iter.GetRow(row_pointers, info.dwEffWidth); - //read next row - png_read_row(png_ptr, row_pointers, NULL); -// - already done by png_set_bgr() -// //HACK BY OP && ( for interlace, swap only in the last pass) -// if (info_ptr->color_type==COLORTYPE_COLOR && pass==(number_passes-1)) -// RGBtoBGR(row_pointers, info.dwEffWidth); - // expand 2 bpp images only in the last pass - if (info_ptr->bit_depth==2 && pass==(number_passes-1)) - expand2to4bpp(row_pointers); - //copy the pixels - iter.SetRow(row_pointers, info.dwEffWidth); - //go on - iter.PrevRow(); - } -#if CXIMAGE_SUPPORT_ALPHA // - else { //alpha blend - - //compute the correct position of the line - long ax,ay; - ay = head.biHeight-1-y; - BYTE* prow= iter.GetRow(ay); - - //recover data from previous scan - if (info_ptr->interlace_type && pass>0 && pass!=7){ - for(ax=head.biWidth;ax>=0;ax--){ - row_pointers[ax*4]=prow[3*ax]; - row_pointers[ax*4+1]=prow[3*ax+1]; - row_pointers[ax*4+2]=prow[3*ax+2]; - row_pointers[ax*4+3]=AlphaGet(ax,ay); - } - } - - //read next row - png_read_row(png_ptr, row_pointers, NULL); - - //RGBA -> RGB + A - for(ax=0;axjmpbuf)){ - /* If we get here, we had a problem reading the file */ - if (info_ptr->palette) free(info_ptr->palette); - png_destroy_write_struct(&png_ptr, (png_infopp)&info_ptr); - throw "Error saving PNG file"; - } - - int row_stride = info.dwEffWidth; - /* set up the output control */ - //png_init_io(png_ptr, hFile); - - // use custom I/O functions - png_set_write_fn(png_ptr,hFile,(png_rw_ptr)user_write_data,(png_flush_ptr)user_flush_data); - - /* set the file information here */ - info_ptr->width = GetWidth(); - info_ptr->height = GetHeight(); - info_ptr->pixel_depth = (BYTE)GetBpp(); - info_ptr->channels = (GetBpp()>8) ? (BYTE)3: (BYTE)1; - info_ptr->bit_depth = (BYTE)(GetBpp()/info_ptr->channels); - info_ptr->color_type = GetColorType(); - info_ptr->compression_type = info_ptr->filter_type = 0; - info_ptr->valid = 0; - info_ptr->rowbytes = row_stride; - - switch(GetCodecOption(CXIMAGE_FORMAT_PNG)){ - case 1: - info_ptr->interlace_type = PNG_INTERLACE_ADAM7; - break; - default: - info_ptr->interlace_type = PNG_INTERLACE_NONE; - } - - /* set compression level */ - //png_set_compression_level(png_ptr, Z_BEST_COMPRESSION); - - /* set background */ - png_color_16 image_background={ 0, 255, 255, 255, 0 }; - if (info.nBkgndIndex!=-1) { - image_background.blue = info.nBkgndColor.rgbBlue; - image_background.green = info.nBkgndColor.rgbGreen; - image_background.red = info.nBkgndColor.rgbRed; - } - png_set_bKGD(png_ptr, info_ptr, &image_background); - - /* set metrics */ - png_set_pHYs(png_ptr, info_ptr, head.biXPelsPerMeter, head.biYPelsPerMeter, PNG_RESOLUTION_METER); - - /* set the palette if there is one */ - if (GetPalette()){ - png_set_IHDR(png_ptr, info_ptr, info_ptr->width, info_ptr->height, info_ptr->bit_depth, - PNG_COLOR_TYPE_PALETTE, info_ptr->interlace_type, - PNG_COMPRESSION_TYPE_BASE, PNG_FILTER_TYPE_BASE); - info_ptr->valid |= PNG_INFO_PLTE; - - // simple transparency - if (info.nBkgndIndex != -1){ - trans[0]=0; - info_ptr->num_trans = 1; - info_ptr->valid |= PNG_INFO_tRNS; - info_ptr->trans = trans; - // the transparency indexes start from 0 - if (info.nBkgndIndex){ - SwapIndex(0,(BYTE)info.nBkgndIndex); - // the ghost must set the changed attributes in the body - if (info.pGhost) info.pGhost->SetTransIndex(0); - } - } - - int nc = GetNumColors(); - - /* We not need to write unused colors! */ - /* only for small images */ - if ((nc>2)&&((head.biWidth*head.biHeight)<65536)){ - nc = 0; - for (DWORD y=0;ync){ - nc=GetPixelIndex(x,y); - } - } - } - nc++; - } - - if (info.bAlphaPaletteEnabled){ - for(WORD ip=0; ipnum_trans = (WORD)nc; - info_ptr->valid |= PNG_INFO_tRNS; - info_ptr->trans = trans; - } - - // copy the palette colors - info_ptr->palette = new png_color[nc]; - info_ptr->num_palette = (png_uint_16) nc; - for (int i=0; ipalette[i].red, &info_ptr->palette[i].green, &info_ptr->palette[i].blue); - - } - -#if CXIMAGE_SUPPORT_ALPHA // - //Merge the transparent color with the alpha channel - bool bNeedTempAlpha = false; - if (head.biBitCount==24 && info.nBkgndIndex>=0){ - if (!AlphaIsValid()){ - bNeedTempAlpha = true; - AlphaCreate(); - } - RGBQUAD c,ct=GetTransColor(); - for(long y=0; y < head.biHeight; y++){ - for(long x=0; x < head.biWidth ; x++){ - c=GetPixelColor(x,y,false); - if (*(long*)&c==*(long*)&ct) - AlphaSet(x,y,0); - }} - } -#endif // CXIMAGE_SUPPORT_ALPHA // - -#if CXIMAGE_SUPPORT_ALPHA // - if (AlphaIsValid()){ - row_stride = 4 * head.biWidth; - - info_ptr->pixel_depth = 32; - info_ptr->channels = 4; - info_ptr->bit_depth = 8; - info_ptr->color_type = PNG_COLOR_TYPE_RGB_ALPHA; - info_ptr->rowbytes = row_stride; - - /* write the file information */ - png_write_info(png_ptr, info_ptr); - - // "10+row_stride" fix heap deallocation problem during debug??? - BYTE *row_pointers = new BYTE[10+row_stride]; - - //interlace handling - int num_pass = png_set_interlace_handling(png_ptr); - for (int pass = 0; pass < num_pass; pass++){ - - //write image - iter.Upset(); - long ay=head.biHeight-1; - RGBQUAD c; - do { - for (long ax=head.biWidth-1; ax>=0;ax--){ - c=GetPixelColor(ax,ay); - row_pointers[ax*4+3]=(BYTE)((AlphaGet(ax,ay)*info.nAlphaMax)/255); - row_pointers[ax*4+2]=c.rgbBlue; - row_pointers[ax*4+1]=c.rgbGreen; - row_pointers[ax*4]=c.rgbRed; - } - png_write_row(png_ptr, row_pointers); - ay--; - } while(iter.PrevRow()); - } - - delete [] row_pointers; - } - else -#endif //CXIMAGE_SUPPORT_ALPHA // - { - /* write the file information */ - png_write_info(png_ptr, info_ptr); - /* If you are only writing one row at a time, this works */ - BYTE *row_pointers = new BYTE[10+row_stride]; - - //interlace handling - int num_pass = png_set_interlace_handling(png_ptr); - for (int pass = 0; pass < num_pass; pass++){ - - //write image - iter.Upset(); - do { - iter.GetRow(row_pointers, row_stride); - //HACK BY OP - if (info_ptr->color_type == 2 /*COLORTYPE_COLOR*/) - RGBtoBGR(row_pointers, row_stride); - png_write_row(png_ptr, row_pointers); - } while(iter.PrevRow()); - - } - - delete [] row_pointers; - } - -#if CXIMAGE_SUPPORT_ALPHA // - /* remove the temporary alpha channel*/ - if (bNeedTempAlpha) AlphaDelete(); -#endif // CXIMAGE_SUPPORT_ALPHA // - - /* It is REQUIRED to call this to finish writing the rest of the file */ - png_write_end(png_ptr, info_ptr); - - /* if you malloced the palette, free it here */ - if (info_ptr->palette) delete[] (info_ptr->palette); - - /* clean up after the write, and free any memory allocated */ - png_destroy_write_struct(&png_ptr, (png_infopp)&info_ptr); - - } catch (char *message) { - strncpy(info.szLastError,message,255); - return FALSE; - } - /* that's it */ - return TRUE; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_PNG diff --git a/src/win32/dependencies/cximage/ximapng.h b/src/win32/dependencies/cximage/ximapng.h deleted file mode 100644 index 3c767c1c..00000000 --- a/src/win32/dependencies/cximage/ximapng.h +++ /dev/null @@ -1,73 +0,0 @@ -/* - * File: ximapng.h - * Purpose: PNG Image Class Loader and Writer - */ -/* ========================================================== - * CxImagePNG (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes - * - * original CImagePNG and CImageIterator implementation are: - * Copyright: (c) 1995, Alejandro Aguilar Sierra - * - * libpng Copyright (c) 1998-2003 Glenn Randers-Pehrson - * ========================================================== - */ -#if !defined(__ximaPNG_h) -#define __ximaPNG_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_PNG - -extern "C" { -#include "../png/png.h" -} - -class CxImagePNG: public CxImage -{ -public: - CxImagePNG(): CxImage(CXIMAGE_FORMAT_PNG) {} - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_PNG);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_PNG);} - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE - -protected: - void ima_png_error(png_struct *png_ptr, char *message); - void expand2to4bpp(BYTE* prow); - - static void user_read_data(png_structp png_ptr, png_bytep data, png_size_t length) - { - CxFile* hFile = (CxFile*)png_ptr->io_ptr; - if (hFile->Read(data,1,length) != length) png_error(png_ptr, "Read Error"); - } - - static void user_write_data(png_structp png_ptr, png_bytep data, png_size_t length) - { - CxFile* hFile = (CxFile*)png_ptr->io_ptr; - if (hFile->Write(data,1,length) != length) png_error(png_ptr, "Write Error"); - } - - static void user_flush_data(png_structp png_ptr) - { - CxFile* hFile = (CxFile*)png_ptr->io_ptr; - if (!hFile->Flush()) png_error(png_ptr, "Flush Error"); - } - static void user_error_fn(png_structp png_ptr,png_const_charp error_msg) - { - strncpy((char*)png_ptr->error_ptr,error_msg,255); - longjmp(png_ptr->jmpbuf, 1); - } -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximasel.cpp b/src/win32/dependencies/cximage/ximasel.cpp deleted file mode 100644 index c9953cf3..00000000 --- a/src/win32/dependencies/cximage/ximasel.cpp +++ /dev/null @@ -1,469 +0,0 @@ -// xImaSel.cpp : Selection functions -/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_SELECTION - -//////////////////////////////////////////////////////////////////////////////// -/** - * Checks if the image has a valid selection. - */ -bool CxImage::SelectionIsValid() -{ - return pSelection!=0; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Gets the smallest rectangle that contains the selection - */ -void CxImage::SelectionGetBox(RECT& r) -{ - memcpy(&r,&info.rSelectionBox,sizeof(RECT)); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Empties the selection. - */ -bool CxImage::SelectionClear() -{ - if (pSelection){ - memset(pSelection,0,head.biWidth * head.biHeight); - info.rSelectionBox.left = head.biWidth; - info.rSelectionBox.bottom = head.biHeight; - info.rSelectionBox.right = info.rSelectionBox.top = 0; - return true; - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Allocates an empty selection. - */ -bool CxImage::SelectionCreate() -{ - SelectionDelete(); - pSelection = (BYTE*)calloc(head.biWidth * head.biHeight, 1); - return (pSelection!=0); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Deallocates the selction. - */ -bool CxImage::SelectionDelete() -{ - if (pSelection){ free(pSelection); pSelection=NULL; } - info.rSelectionBox.left = head.biWidth; - info.rSelectionBox.bottom = head.biHeight; - info.rSelectionBox.right = info.rSelectionBox.top = 0; - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Checks if the coordinates are inside the selection. - */ -bool CxImage::SelectionIsInside(long x, long y) -{ - if (IsInside(x,y)){ - if (pSelection==NULL) return true; - return pSelection[x+y*head.biWidth]!=0; - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Adds a rectangle to the existing selection. - */ -bool CxImage::SelectionAddRect(RECT r) -{ - if (pSelection==NULL) SelectionCreate(); - if (pSelection==NULL) return false; - - RECT r2; - if (r.left r2.left) info.rSelectionBox.left = max(0L,min(head.biWidth,r2.left)); - if (info.rSelectionBox.right < r2.right) info.rSelectionBox.right = max(0L,min(head.biWidth,r2.right)); - if (info.rSelectionBox.bottom > r2.bottom) info.rSelectionBox.bottom = max(0L,min(head.biHeight,r2.bottom)); - - long ymin = max(0L,min(head.biHeight,r2.bottom)); - long ymax = max(0L,min(head.biHeight,r2.top)); - long xmin = max(0L,min(head.biWidth,r2.left)); - long xmax = max(0L,min(head.biWidth,r2.right)); - - for (long y=ymin; y (xcenter - xradius)) info.rSelectionBox.left = max(0L,min(head.biWidth,(xcenter - xradius))); - if (info.rSelectionBox.right < (xcenter + xradius)) info.rSelectionBox.right = max(0L,min(head.biWidth,(xcenter + xradius))); - if (info.rSelectionBox.bottom > (ycenter - yradius)) info.rSelectionBox.bottom = max(0L,min(head.biHeight,(ycenter - yradius))); - if (info.rSelectionBox.top < (ycenter + yradius)) info.rSelectionBox.top = max(0L,min(head.biHeight,(ycenter + yradius))); - - long xmin = max(0L,min(head.biWidth,xcenter - xradius)); - long xmax = max(0L,min(head.biWidth,xcenter + xradius)); - long ymin = max(0L,min(head.biHeight,ycenter - yradius)); - long ymax = max(0L,min(head.biHeight,ycenter + yradius)); - - long y,yo; - for (y=ymin; yy) pSelection[x + y * head.biWidth] = 255; - } - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Inverts the selection. - */ -bool CxImage::SelectionInvert() -{ - if (pSelection) { - BYTE *iSrc=pSelection; - long n=head.biHeight*head.biWidth; - for(long i=0; i < n; i++){ - *iSrc=(BYTE)~(*(iSrc)); - iSrc++; - } - return true; - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Imports an existing region from another image with the same width and height. - */ -bool CxImage::SelectionCopy(CxImage &from) -{ - if (from.pSelection == NULL || head.biWidth != from.head.biWidth || head.biHeight != from.head.biHeight) return false; - if (pSelection==NULL) pSelection = (BYTE*)malloc(head.biWidth * head.biHeight); - if (pSelection==NULL) return false; - memcpy(pSelection,from.pSelection,head.biWidth * head.biHeight); - memcpy(&info.rSelectionBox,&from.info.rSelectionBox,sizeof(RECT)); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Adds a polygonal region to the existing selection. points points to an array of POINT structures. - * Each structure specifies the x-coordinate and y-coordinate of one vertex of the polygon. - * npoints specifies the number of POINT structures in the array pointed to by points. - */ -bool CxImage::SelectionAddPolygon(POINT *points, long npoints) -{ - if (points==NULL || npoints<3) return false; - - if (pSelection==NULL) SelectionCreate(); - if (pSelection==NULL) return false; - - BYTE* plocal = (BYTE*)calloc(head.biWidth*head.biHeight, 1); - RECT localbox = {head.biWidth,0,0,head.biHeight}; - - long x,y,i=0; - POINT *current,*next,*start; - //trace contour - while (i < npoints){ - current = &points[i]; - if (current->x!=-1){ - if (i==0 || (i>0 && points[i-1].x==-1)) start = &points[i]; - - if ((i+1)==npoints || points[i+1].x==-1) - next = start; - else - next = &points[i+1]; - - float beta; - if (current->x != next->x){ - beta = (float)(next->y - current->y)/(float)(next->x - current->x); - if (current->x < next->x){ - for (x=current->x; x<=next->x; x++){ - y = (long)(current->y + (x - current->x) * beta); - if (IsInside(x,y)) plocal[x + y * head.biWidth] = 255; - } - } else { - for (x=current->x; x>=next->x; x--){ - y = (long)(current->y + (x - current->x) * beta); - if (IsInside(x,y)) plocal[x + y * head.biWidth] = 255; - } - } - } - if (current->y != next->y){ - beta = (float)(next->x - current->x)/(float)(next->y - current->y); - if (current->y < next->y){ - for (y=current->y; y<=next->y; y++){ - x = (long)(current->x + (y - current->y) * beta); - if (IsInside(x,y)) plocal[x + y * head.biWidth] = 255; - } - } else { - for (y=current->y; y>=next->y; y--){ - x = (long)(current->x + (y - current->y) * beta); - if (IsInside(x,y)) plocal[x + y * head.biWidth] = 255; - } - } - } - } - - RECT r2; - if (current->x < next->x) {r2.left=current->x; r2.right=next->x; } else {r2.left=next->x ; r2.right=current->x; } - if (current->y < next->y) {r2.bottom=current->y; r2.top=next->y; } else {r2.bottom=next->y ; r2.top=current->y; } - if (localbox.top < r2.top) localbox.top = max(0L,min(head.biHeight-1,r2.top+1)); - if (localbox.left > r2.left) localbox.left = max(0L,min(head.biWidth-1,r2.left-1)); - if (localbox.right < r2.right) localbox.right = max(0L,min(head.biWidth-1,r2.right+1)); - if (localbox.bottom > r2.bottom) localbox.bottom = max(0L,min(head.biHeight-1,r2.bottom-1)); - - i++; - } - - //fill the outer region - long npix=(localbox.right - localbox.left)*(localbox.top - localbox.bottom); - POINT* pix = (POINT*)calloc(npix,sizeof(POINT)); - BYTE back=0, mark=1; - long fx, fy, fxx, fyy, first, last,xmin,xmax,ymin,ymax; - - for (int side=0; side<4; side++){ - switch(side){ - case 0: - xmin=localbox.left; xmax=localbox.right+1; ymin=localbox.bottom; ymax=localbox.bottom+1; - break; - case 1: - xmin=localbox.right; xmax=localbox.right+1; ymin=localbox.bottom; ymax=localbox.top+1; - break; - case 2: - xmin=localbox.left; xmax=localbox.right+1; ymin=localbox.top; ymax=localbox.top+1; - break; - case 3: - xmin=localbox.left; xmax=localbox.left+1; ymin=localbox.bottom; ymax=localbox.top+1; - break; - } - //fill from the border points - for(y=ymin;y=localbox.left && fxx<=localbox.right && fyy>=localbox.bottom && fyy<=localbox.top ) - { - plocal[fxx + fyy*head.biWidth] = mark; - if (fyy > 0 && plocal[fxx + (fyy - 1)*head.biWidth] == back){ - pix[last].x = fx; - pix[last].y = fy - 1; - last++; - if (last == npix) last = 0; - } - if ((fyy + 1)=localbox.left && fxx<=localbox.right && fyy>=localbox.bottom && fyy<=localbox.top ) - { - plocal[fxx + (y + fy)*head.biWidth] = mark; - if (fyy > 0 && plocal[fxx + (fyy - 1)*head.biWidth] == back){ - pix[last].x = fx; - pix[last].y = fy - 1; - last++; - if (last == npix) last = 0; - } - if ((fyy + 1) localbox.left) info.rSelectionBox.left = localbox.left; - if (info.rSelectionBox.right < localbox.right) info.rSelectionBox.right = localbox.right+1; - if (info.rSelectionBox.bottom > localbox.bottom) info.rSelectionBox.bottom = localbox.bottom; - - free(plocal); - free(pix); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Adds to the selection all the pixels matching the specified color. - */ -bool CxImage::SelectionAddColor(RGBQUAD c) -{ - if (pSelection==NULL) SelectionCreate(); - if (pSelection==NULL) return false; - - RECT localbox = {head.biWidth,0,0,head.biHeight}; - - for (long y = 0; y < head.biHeight; y++){ - for (long x = 0; x < head.biWidth; x++){ - RGBQUAD color = GetPixelColor(x, y); - if (color.rgbRed == c.rgbRed && - color.rgbGreen == c.rgbGreen && - color.rgbBlue == c.rgbBlue) - { - pSelection[x + y * head.biWidth] = 255; // set the correct mask bit - - if (localbox.top < y) localbox.top = y; - if (localbox.left > x) localbox.left = x; - if (localbox.right < x) localbox.right = x; - if (localbox.bottom > y) localbox.bottom = y; - } - } - } - - if (info.rSelectionBox.top < localbox.top) info.rSelectionBox.top = localbox.top; - if (info.rSelectionBox.left > localbox.left) info.rSelectionBox.left = localbox.left; - if (info.rSelectionBox.right < localbox.right) info.rSelectionBox.right = localbox.right; - if (info.rSelectionBox.bottom > localbox.bottom) info.rSelectionBox.bottom = localbox.bottom; - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Adds a single pixel to the existing selection. - */ -bool CxImage::SelectionAddPixel(int x, int y) -{ - if (pSelection==NULL) SelectionCreate(); - if (pSelection==NULL) return false; - - if (IsInside(x,y)) { - pSelection[x + y * head.biWidth] = 255; // set the correct mask bit - return true; - } - - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Exports the selection channel in a 8bpp grayscale image. - */ -bool CxImage::SelectionSplit(CxImage *dest) -{ - if (!pSelection || !dest) return false; - - CxImage tmp(head.biWidth,head.biHeight,8); - if (!tmp.IsValid()) return false; - - for(long y=0; yTransfer(tmp); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_WINDOWS -/** - * Converts the selection in a HRGN object. - */ -bool CxImage::SelectionToHRGN(HRGN& region) -{ - if (pSelection && region){ - for(int y = 0; y < head.biHeight; y++){ - HRGN hTemp = NULL; - int iStart = -1; - int x = 0; - for(; x < head.biWidth; x++){ - if (pSelection[x + y * head.biWidth] == 255){ - if (iStart == -1) iStart = x; - continue; - }else{ - if (iStart >= 0){ - hTemp = CreateRectRgn(iStart, y, x, y + 1); - CombineRgn(region, hTemp, region, RGN_OR); - DeleteObject(hTemp); - iStart = -1; - } - } - } - if (iStart >= 0){ - hTemp = CreateRectRgn(iStart, y, x, y + 1); - CombineRgn(region, hTemp, region, RGN_OR); - DeleteObject(hTemp); - iStart = -1; - } - } - return true; - } - return false; -} -#endif //CXIMAGE_SUPPORT_WINDOWS -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_SELECTION diff --git a/src/win32/dependencies/cximage/ximatga.cpp b/src/win32/dependencies/cximage/ximatga.cpp deleted file mode 100644 index a6bdf87e..00000000 --- a/src/win32/dependencies/cximage/ximatga.cpp +++ /dev/null @@ -1,300 +0,0 @@ -/* - * File: ximatga.cpp - * Purpose: Platform Independent TGA Image Class Loader and Writer - * 05/Jan/2001 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximatga.h" - -#if CXIMAGE_SUPPORT_TGA - -#include "ximaiter.h" - -// Definitions for image types. -#define TGA_Null 0 -#define TGA_Map 1 -#define TGA_RGB 2 -#define TGA_Mono 3 -#define TGA_RLEMap 9 -#define TGA_RLERGB 10 -#define TGA_RLEMono 11 -#define TGA_CompMap 32 -#define TGA_CompMap4 33 - -//////////////////////////////////////////////////////////////////////////////// -bool CxImageTGA::Decode(CxFile *hFile) -{ - if (hFile == NULL) return false; - - TGAHEADER tgaHead; - - try - { - if (hFile->Read(&tgaHead,sizeof(tgaHead),1)==0) - throw "Not a TGA"; - - bool bCompressed; - switch (tgaHead.ImageType){ - case TGA_Map: - case TGA_RGB: - case TGA_Mono: - bCompressed = false; - break; - case TGA_RLEMap: - case TGA_RLERGB: - case TGA_RLEMono: - bCompressed = true; - break; - default: - throw "Unknown TGA image type"; - } - - if (tgaHead.ImageWidth==0 || tgaHead.ImageHeight==0 || tgaHead.PixelDepth==0 || tgaHead.CmapLength>256) - throw "bad TGA header"; - - if (tgaHead.PixelDepth!=8 && tgaHead.PixelDepth!=15 && tgaHead.PixelDepth!=16 && tgaHead.PixelDepth!=24 && tgaHead.PixelDepth!=32) - throw "bad TGA header"; - - if (tgaHead.IdLength>0) hFile->Seek(tgaHead.IdLength,SEEK_CUR); //skip descriptor - - Create(tgaHead.ImageWidth, tgaHead.ImageHeight, tgaHead.PixelDepth, CXIMAGE_FORMAT_TGA); -#if CXIMAGE_SUPPORT_ALPHA // - if (tgaHead.PixelDepth==32) AlphaCreate(); // Image has alpha channel -#endif //CXIMAGE_SUPPORT_ALPHA - - if (!IsValid()) throw "TGA Create failed"; - - if (info.nEscape) throw "Cancelled"; // - cancel decoding - - if (tgaHead.CmapType != 0){ // read the palette - rgb_color pal[256]; - hFile->Read(pal,tgaHead.CmapLength*sizeof(rgb_color), 1); - for (int i=0;i - cancel decoding - - if (hFile == NULL || hFile->Eof()) throw "corrupted TGA"; - - if (bYReversed) pDest = iter.GetRow(tgaHead.ImageHeight-y-1); - else pDest = iter.GetRow(y); - - if (bCompressed) rleLeftover = ExpandCompressedLine(pDest,&tgaHead,hFile,tgaHead.ImageWidth,y,rleLeftover); - else ExpandUncompressedLine (pDest,&tgaHead,hFile,tgaHead.ImageWidth,y,0); - } - - if (bXReversed) Mirror(); - -#if CXIMAGE_SUPPORT_ALPHA - if (bYReversed && tgaHead.PixelDepth==32) AlphaFlip(); // -#endif //CXIMAGE_SUPPORT_ALPHA - - } catch (char *message) { - strncpy(info.szLastError,message,255); - return FALSE; - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageTGA::Encode(CxFile * hFile) -{ - if (EncodeSafeCheck(hFile)) return false; - - if (head.biBitCount<8){ - strcpy(info.szLastError,"Bit depth must be 8 or 24"); - return false; - } - - TGAHEADER tgaHead; - - tgaHead.IdLength = 0; // Image ID Field Length - tgaHead.CmapType = GetPalette()!=0; // Color Map Type - tgaHead.ImageType = (head.biBitCount == 8) ? (BYTE)TGA_Map : (BYTE)TGA_RGB; // Image Type - - tgaHead.CmapIndex=0; // First Entry Index - tgaHead.CmapLength=(head.biBitCount == 8) ? 256 : 0; // Color Map Length - tgaHead.CmapEntrySize=(head.biBitCount == 8) ? (BYTE)24 : (BYTE)0; // Color Map Entry Size - - tgaHead.X_Origin=0; // X-origin of Image - tgaHead.Y_Origin=0; // Y-origin of Image - tgaHead.ImageWidth=(WORD)head.biWidth; // Image Width - tgaHead.ImageHeight=(WORD)head.biHeight; // Image Height - tgaHead.PixelDepth=(BYTE)head.biBitCount; // Pixel Depth - tgaHead.ImagDesc=0; // Image Descriptor - - if (pAlpha && head.biBitCount==24) tgaHead.PixelDepth=32; - - hFile->Write(&tgaHead,sizeof(TGAHEADER),1); - - if (head.biBitCount==8){ - rgb_color pal[256]; - RGBQUAD* ppal = GetPalette(); - for (int i=0;i<256; i++){ - pal[i].r = ppal[i].rgbBlue; - pal[i].g = ppal[i].rgbGreen; - pal[i].b = ppal[i].rgbRed; - } - hFile->Write(&pal,256*sizeof(rgb_color),1); - } - - CImageIterator iter(this); - BYTE* pDest; - if (pAlpha==0 || head.biBitCount==8){ - for (int y=0; y < tgaHead.ImageHeight; y++){ - pDest = iter.GetRow(y); - hFile->Write(pDest,tgaHead.ImageWidth * (head.biBitCount >> 3),1); - } - } else { - pDest = (BYTE*)malloc(4*tgaHead.ImageWidth); - RGBQUAD c; - for (int y=0; y < tgaHead.ImageHeight; y++){ - for(int x=0, x4=0;x - pDest[x4+3]=(BYTE)((AlphaGet(x,y)*info.nAlphaMax)/255); -#else - pDest[x4+3]=0; -#endif //CXIMAGE_SUPPORT_ALPHA - } - hFile->Write(pDest,4*tgaHead.ImageWidth,1); - } - free(pDest); - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -BYTE CxImageTGA::ExpandCompressedLine(BYTE* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int width, int y, BYTE rleLeftover) -{ - try{ - BYTE rle; - long filePos; - for (int x=0; xRead(&rle,1,1); - } - if (rle & 128) { // RLE-Encoded packet - rle -= 127; // Calculate real repeat count. - if ((x+rle)>width){ - rleLeftover = 128 + (rle - (width - x) - 1); - filePos = hFile->Tell(); - rle=width-x; - } - switch (ptgaHead->PixelDepth) - { - case 32: { - RGBQUAD color; - hFile->Read(&color,4,1); - for (int ix = 0; ix < rle; ix++){ - memcpy(&pDest[3*ix],&color,3); -#if CXIMAGE_SUPPORT_ALPHA // - AlphaSet(ix+x,y,color.rgbReserved); -#endif //CXIMAGE_SUPPORT_ALPHA - } - break; - } - case 24: { - rgb_color triple; - hFile->Read(&triple,3,1); - for (int ix = 0; ix < rle; ix++) memcpy(&pDest[3*ix],&triple,3); - break; - } - case 15: - case 16: { - WORD pixel; - hFile->Read(&pixel,2,1); - rgb_color triple; - triple.r = (BYTE)(( pixel & 0x1F ) * 8); // red - triple.g = (BYTE)(( pixel >> 2 ) & 0x0F8); // green - triple.b = (BYTE)(( pixel >> 7 ) & 0x0F8); // blue - for (int ix = 0; ix < rle; ix++){ - memcpy(&pDest[3*ix],&triple,3); - } - break; - } - case 8: { - BYTE pixel; - hFile->Read(&pixel,1,1); - for (int ix = 0; ix < rle; ix++) pDest[ix] = pixel; - } - } - if (rleLeftover!=255) hFile->Seek(filePos, SEEK_SET); - } else { // Raw packet - rle += 1; // Calculate real repeat count. - if ((x+rle)>width){ - rleLeftover = rle - (width - x) - 1; - rle=width-x; - } - ExpandUncompressedLine(pDest,ptgaHead,hFile,rle,y,x); - } - if (head.biBitCount == 24) pDest += rle*3; else pDest += rle; - x += rle; - } - } catch(...){ } - return rleLeftover; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageTGA::ExpandUncompressedLine(BYTE* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int width, int y, int xoffset) -{ - try{ - switch (ptgaHead->PixelDepth){ - case 8: - hFile->Read(pDest,width,1); - break; - case 15: - case 16:{ - BYTE* dst=pDest; - WORD pixel; - for (int x=0; xRead(&pixel,2,1); - *dst++ = (BYTE)(( pixel & 0x1F ) * 8); // blue - *dst++ = (BYTE)(( pixel >> 2 ) & 0x0F8); // green - *dst++ = (BYTE)(( pixel >> 7 ) & 0x0F8); // red - } - break; - } - case 24: - hFile->Read(pDest,3*width,1); - break; - case 32:{ - BYTE* dst=pDest; - for (int x=0; xRead(&pixel,4,1); - *dst++ = pixel.rgbBlue; - *dst++ = pixel.rgbGreen; - *dst++ = pixel.rgbRed; -#if CXIMAGE_SUPPORT_ALPHA // - AlphaSet(x+xoffset,y,pixel.rgbReserved); //alpha -#endif //CXIMAGE_SUPPORT_ALPHA - } - break; - } - } - } catch(...){ } -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_TGA - diff --git a/src/win32/dependencies/cximage/ximatga.h b/src/win32/dependencies/cximage/ximatga.h deleted file mode 100644 index 8a6de633..00000000 --- a/src/win32/dependencies/cximage/ximatga.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * File: ximatga.h - * Purpose: TARGA Image Class Loader and Writer - */ -/* ========================================================== - * CxImageTGA (c) 05/Jan/2002 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * Parts of the code come from Paintlib : Copyright (c) 1996-1998 Ulrich von Zadow - * ========================================================== - */ -#if !defined(__ximaTGA_h) -#define __ximaTGA_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_TGA - -class CxImageTGA: public CxImage -{ -#pragma pack(1) -typedef struct tagTgaHeader -{ - BYTE IdLength; // Image ID Field Length - BYTE CmapType; // Color Map Type - BYTE ImageType; // Image Type - - WORD CmapIndex; // First Entry Index - WORD CmapLength; // Color Map Length - BYTE CmapEntrySize; // Color Map Entry Size - - WORD X_Origin; // X-origin of Image - WORD Y_Origin; // Y-origin of Image - WORD ImageWidth; // Image Width - WORD ImageHeight; // Image Height - BYTE PixelDepth; // Pixel Depth - BYTE ImagDesc; // Image Descriptor -} TGAHEADER; -#pragma pack() - -public: - CxImageTGA(): CxImage(CXIMAGE_FORMAT_TGA) {} - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_TGA);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_TGA);} - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE -protected: - BYTE ExpandCompressedLine(BYTE* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int width, int y, BYTE rleLeftover); - void ExpandUncompressedLine(BYTE* pDest,TGAHEADER* ptgaHead,CxFile *hFile,int width, int y, int xoffset); -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximath.cpp b/src/win32/dependencies/cximage/ximath.cpp deleted file mode 100644 index 37533e22..00000000 --- a/src/win32/dependencies/cximage/ximath.cpp +++ /dev/null @@ -1,97 +0,0 @@ -#include "ximage.h" -#include "ximath.h" -#include - -//this module should contain some classes for geometrical transformations -//usable with selections, etc... once it's done, that is. :) - -CxPoint2::CxPoint2() -{ - x=y=0.0f; -} - -CxPoint2::CxPoint2(float const x_, float const y_) -{ - x=x_; - y=y_; -} - -CxPoint2::CxPoint2(CxPoint2 const &p) -{ - x=p.x; - y=p.y; -} - -float CxPoint2::Distance(CxPoint2 const p2) -{ - return (float)sqrt((x-p2.x)*(x-p2.x)+(y-p2.y)*(y-p2.y)); -} - -float CxPoint2::Distance(float const x_, float const y_) -{ - return (float)sqrt((x-x_)*(x-x_)+(y-y_)*(y-y_)); -} - -CxRect2::CxRect2() -{ -} - -CxRect2::CxRect2(float const x1_, float const y1_, float const x2_, float const y2_) -{ - botLeft.x=x1_; - botLeft.y=y1_; - topRight.x=x2_; - topRight.y=y2_; -} - -CxRect2::CxRect2(CxRect2 const &p) -{ - botLeft=p.botLeft; - topRight=p.topRight; -} - -float CxRect2::Surface() const -/* - * Returns the surface of rectangle. - */ -{ - return (topRight.x-botLeft.x)*(topRight.y-botLeft.y); -} - -CxRect2 CxRect2::CrossSection(CxRect2 const &r2) const -/* - * Returns crossection with another rectangle. - */ -{ - CxRect2 cs; - cs.botLeft.x=max(botLeft.x, r2.botLeft.x); - cs.botLeft.y=max(botLeft.y, r2.botLeft.y); - cs.topRight.x=min(topRight.x, r2.topRight.x); - cs.topRight.y=min(topRight.y, r2.topRight.y); - if (cs.botLeft.x<=cs.topRight.x && cs.botLeft.y<=cs.topRight.y) { - return cs; - } else { - return CxRect2(0,0,0,0); - }//if -} - -CxPoint2 CxRect2::Center() const -/* - * Returns the center point of rectangle. - */ -{ - return CxPoint2((topRight.x+botLeft.x)/2.0f, (topRight.y+botLeft.y)/2.0f); -} - -float CxRect2::Width() const -//returns rectangle width -{ - return topRight.x-botLeft.x; -} - -float CxRect2::Height() const -//returns rectangle height -{ - return topRight.y-botLeft.y; -} - diff --git a/src/win32/dependencies/cximage/ximath.h b/src/win32/dependencies/cximage/ximath.h deleted file mode 100644 index 10b98984..00000000 --- a/src/win32/dependencies/cximage/ximath.h +++ /dev/null @@ -1,39 +0,0 @@ -#if !defined(__ximath_h) -#define __ximath_h - -#include "ximadef.h" - -//***bd*** simple floating point point -class DLL_EXP CxPoint2 -{ -public: - CxPoint2(); - CxPoint2(float const x_, float const y_); - CxPoint2(CxPoint2 const &p); - - float Distance(CxPoint2 const p2); - float Distance(float const x_, float const y_); - - float x,y; -}; - -//and simple rectangle -class DLL_EXP CxRect2 -{ -public: - CxRect2(); - CxRect2(float const x1_, float const y1_, float const x2_, float const y2_); - CxRect2(CxPoint2 const &bl, CxPoint2 const &tr); - CxRect2(CxRect2 const &p); - - float Surface() const; - CxRect2 CrossSection(CxRect2 const &r2) const; - CxPoint2 Center() const; - float Width() const; - float Height() const; - - CxPoint2 botLeft; - CxPoint2 topRight; -}; - -#endif diff --git a/src/win32/dependencies/cximage/ximatif.cpp b/src/win32/dependencies/cximage/ximatif.cpp deleted file mode 100644 index 4f0bbf89..00000000 --- a/src/win32/dependencies/cximage/ximatif.cpp +++ /dev/null @@ -1,763 +0,0 @@ -/* - * File: ximatif.cpp - * Purpose: Platform Independent TIFF Image Class Loader and Writer - * 07/Aug/2001 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximatif.h" - -#if CXIMAGE_SUPPORT_TIF - -#include "../tiff/tiffio.h" - -#define CVT(x) (((x) * 255L) / ((1L<<16)-1)) -#define SCALE(x) (((x)*((1L<<16)-1))/255) -#define CalculateLine(width,bitdepth) (((width * bitdepth) + 7) / 8) -#define CalculatePitch(line) (line + 3 & ~3) - -extern "C" TIFF* _TIFFOpenEx(CxFile* stream, const char* mode); - -//////////////////////////////////////////////////////////////////////////////// -CxImageTIF::~CxImageTIF() -{ - if (m_tif2) TIFFClose(m_tif2); -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImageTIF::Decode(CxFile * hFile) -{ - //Comment this line if you need more information on errors - // TIFFSetErrorHandler(NULL); // - - //Open file and fill the TIFF structure - // m_tif = TIFFOpen(imageFileName,"rb"); - TIFF* m_tif = _TIFFOpenEx(hFile, "rb"); - - uint32 height=0; - uint32 width=0; - uint16 bitspersample=1; - uint16 samplesperpixel=1; - uint32 rowsperstrip=(DWORD)-1; - uint16 photometric=0; - uint16 compression=1; - uint16 orientation=ORIENTATION_TOPLEFT; // - uint16 res_unit; // - uint32 x, y; - float resolution, offset; - BOOL isRGB; - BYTE *bits; //pointer to source data - BYTE *bits2; //pointer to destination data - - try{ - //check if it's a tiff file - if (!m_tif) - throw "Error encountered while opening TIFF file"; - - // - 12/2002 : get NumFrames directly, instead of looping - // info.nNumFrames=0; - // while(TIFFSetDirectory(m_tif,(uint16)info.nNumFrames)) info.nNumFrames++; - info.nNumFrames = TIFFNumberOfDirectories(m_tif); - - if (!TIFFSetDirectory(m_tif, (uint16)info.nFrame)) - throw "Error: page not present in TIFF file"; - - //get image info - TIFFGetField(m_tif, TIFFTAG_IMAGEWIDTH, &width); - TIFFGetField(m_tif, TIFFTAG_IMAGELENGTH, &height); - TIFFGetField(m_tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel); - TIFFGetField(m_tif, TIFFTAG_BITSPERSAMPLE, &bitspersample); - TIFFGetField(m_tif, TIFFTAG_ROWSPERSTRIP, &rowsperstrip); - TIFFGetField(m_tif, TIFFTAG_PHOTOMETRIC, &photometric); - TIFFGetField(m_tif, TIFFTAG_ORIENTATION, &orientation); - - if (info.nEscape == -1) { - // Return output dimensions only - head.biWidth = width; - head.biHeight = height; - throw "output dimensions returned"; - } - - TIFFGetFieldDefaulted(m_tif, TIFFTAG_RESOLUTIONUNIT, &res_unit); - if (TIFFGetField(m_tif, TIFFTAG_XRESOLUTION, &resolution)) - { - if (res_unit == RESUNIT_CENTIMETER) resolution = (float)(resolution*2.54f + 0.5f); - SetXDPI((long)resolution); - } - if (TIFFGetField(m_tif, TIFFTAG_YRESOLUTION, &resolution)) - { - if (res_unit == RESUNIT_CENTIMETER) resolution = (float)(resolution*2.54f + 0.5f); - SetYDPI((long)resolution); - } - - if (TIFFGetField(m_tif, TIFFTAG_XPOSITION, &offset)) info.xOffset = (long)offset; - if (TIFFGetField(m_tif, TIFFTAG_YPOSITION, &offset)) info.yOffset = (long)offset; - - head.biClrUsed=0; - info.nBkgndIndex =-1; - - if (rowsperstrip>height){ - rowsperstrip=height; - TIFFSetField(m_tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip); - } - - isRGB = (bitspersample >= 8) && - (photometric == PHOTOMETRIC_RGB) || - (photometric == PHOTOMETRIC_YCBCR) || - (photometric == PHOTOMETRIC_SEPARATED) || - (photometric == PHOTOMETRIC_LOGL) || - (photometric == PHOTOMETRIC_LOGLUV); - - if (isRGB){ - head.biBitCount=24; - }else{ - if ((photometric==PHOTOMETRIC_MINISBLACK)||(photometric==PHOTOMETRIC_MINISWHITE)){ - if (bitspersample == 1){ - head.biBitCount=1; //B&W image - head.biClrUsed =2; - } else if (bitspersample == 4) { - head.biBitCount=4; //16 colors gray scale - head.biClrUsed =16; - } else { - head.biBitCount=8; //gray scale - head.biClrUsed =256; - } - } else if (bitspersample == 4) { - head.biBitCount=4; // 16 colors - head.biClrUsed=16; - } else { - head.biBitCount=8; //256 colors - head.biClrUsed=256; - } - } - - if (info.nEscape) throw "Cancelled"; // - cancel decoding - - Create(width,height,head.biBitCount,CXIMAGE_FORMAT_TIF); //image creation - if (!pDib) throw "CxImageTIF can't create image"; - -#if CXIMAGE_SUPPORT_ALPHA - if (samplesperpixel==4) AlphaCreate(); //add alpha support for 32bpp tiffs - if (samplesperpixel==2 && bitspersample==8) AlphaCreate(); //add alpha support for 8bpp + alpha -#endif //CXIMAGE_SUPPORT_ALPHA - - TIFFGetField(m_tif, TIFFTAG_COMPRESSION, &compression); - SetCodecOption(compression); // save original compression type - - if (isRGB) { - // Read the whole image into one big RGBA buffer using - // the traditional TIFFReadRGBAImage() API that we trust. - uint32* raster; // retrieve RGBA image - uint32 *row; - - raster = (uint32*)_TIFFmalloc(width * height * sizeof (uint32)); - if (raster == NULL) throw "No space for raster buffer"; - - // Read the image in one chunk into an RGBA array - if(!TIFFReadRGBAImage(m_tif, width, height, raster, 1)) { - _TIFFfree(raster); - throw "Corrupted TIFF file!"; - } - - // read the raster lines and save them in the DIB - // with RGB mode, we have to change the order of the 3 samples RGB - row = &raster[0]; - bits2 = info.pImage; - for (y = 0; y < height; y++) { - - if (info.nEscape){ // - cancel decoding - _TIFFfree(raster); - throw "Cancelled"; - } - - bits = bits2; - for (x = 0; x < width; x++) { - *bits++ = (BYTE)TIFFGetB(row[x]); - *bits++ = (BYTE)TIFFGetG(row[x]); - *bits++ = (BYTE)TIFFGetR(row[x]); -#if CXIMAGE_SUPPORT_ALPHA - if (samplesperpixel==4) AlphaSet(x,y,(BYTE)TIFFGetA(row[x])); -#endif //CXIMAGE_SUPPORT_ALPHA - } - row += width; - bits2 += info.dwEffWidth; - } - _TIFFfree(raster); - } else { - RGBQUAD *pal; - pal=(RGBQUAD*)calloc(256,sizeof(RGBQUAD)); - if (pal==NULL) throw "Unable to allocate TIFF palette"; - - // set up the colormap based on photometric - switch(photometric) { - case PHOTOMETRIC_MINISBLACK: // bitmap and greyscale image types - case PHOTOMETRIC_MINISWHITE: - if (bitspersample == 1) { // Monochrome image - if (photometric == PHOTOMETRIC_MINISBLACK) { - pal[1].rgbRed = pal[1].rgbGreen = pal[1].rgbBlue = 255; - } else { - pal[0].rgbRed = pal[0].rgbGreen = pal[0].rgbBlue = 255; - } - } else { // need to build the scale for greyscale images - if (photometric == PHOTOMETRIC_MINISBLACK) { - for (DWORD i=0; i 0) { - if (red[n] >= 256 || green[n] >= 256 || blue[n] >= 256) { - Palette16Bits=TRUE; - break; - } - } - - // load the palette in the DIB - for (int i = (1 << bitspersample) - 1; i >= 0; i--) { - if (Palette16Bits) { - pal[i].rgbRed =(BYTE) CVT(red[i]); - pal[i].rgbGreen = (BYTE) CVT(green[i]); - pal[i].rgbBlue = (BYTE) CVT(blue[i]); - } else { - pal[i].rgbRed = (BYTE) red[i]; - pal[i].rgbGreen = (BYTE) green[i]; - pal[i].rgbBlue = (BYTE) blue[i]; - } - } - break; - } - SetPalette(pal,head.biClrUsed); //palette assign - free(pal); - - // read the tiff lines and save them in the DIB - uint32 nrow; - uint32 ys; - int line = CalculateLine(width, bitspersample * samplesperpixel); - long bitsize= TIFFStripSize(m_tif); - //verify bitsize: could be wrong if StripByteCounts is missing. - if (bitsize>(long)(head.biSizeImage*samplesperpixel)) bitsize=head.biSizeImage*samplesperpixel; - - int tiled_image = TIFFIsTiled(m_tif); - uint32 tw, tl; - BYTE* tilebuf; - if (tiled_image){ - TIFFGetField(m_tif, TIFFTAG_TILEWIDTH, &tw); - TIFFGetField(m_tif, TIFFTAG_TILELENGTH, &tl); - rowsperstrip = tl; - bitsize = TIFFTileSize(m_tif) * (int)(1+width/tw); - tilebuf = (BYTE*)malloc(TIFFTileSize(m_tif)); - } - - bits = (BYTE*)malloc(bitsize); - if (bits==NULL){ - throw "CxImageTIF can't allocate memory"; - } - - for (ys = 0; ys < height; ys += rowsperstrip) { - - if (info.nEscape){ // - cancel decoding - free(bits); - throw "Cancelled"; - } - - nrow = (ys + rowsperstrip > height ? height - ys : rowsperstrip); - - if (tiled_image){ - uint32 imagew = TIFFScanlineSize(m_tif); - uint32 tilew = TIFFTileRowSize(m_tif); - int iskew = imagew - tilew; - uint8* bufp = (uint8*) bits; - - uint32 colb = 0; - for (uint32 col = 0; col < width; col += tw) { - if (TIFFReadTile(m_tif, tilebuf, col, ys, 0, 0) < 0){ - free(tilebuf); - free(bits); - throw "Corrupted tiled TIFF file!"; - } - - if (colb + tw > imagew) { - uint32 owidth = imagew - colb; - uint32 oskew = tilew - owidth; - TileToStrip(bufp + colb, tilebuf, nrow, owidth, oskew + iskew, oskew ); - } else { - TileToStrip(bufp + colb, tilebuf, nrow, tilew, iskew, 0); - } - colb += tilew; - } - - } else { - if (TIFFReadEncodedStrip(m_tif, TIFFComputeStrip(m_tif, ys, 0), bits, nrow * line) == -1) { - free(bits); - throw "Corrupted TIFF file!"; - } - } - - for (y = 0; y < nrow; y++) { - long offset=(nrow-y-1)*line; - if (bitspersample==16) for (DWORD xi=0;xi=(int)width){ - yi--; - xi=0; - } - } - } else { //photometric==PHOTOMETRIC_CIELAB - if (head.biBitCount!=24){ //fix image - Create(width,height,24,CXIMAGE_FORMAT_TIF); -#if CXIMAGE_SUPPORT_ALPHA - if (samplesperpixel==4) AlphaCreate(); -#endif //CXIMAGE_SUPPORT_ALPHA - } - - int xi=0; - int ii=0; - int yi=height-ys-nrow+y; - RGBQUAD c; - int l,a,b,bitsoffset; - double p,cx,cy,cz,cr,cg,cb; - while (ii127) a-=256; - if (b>127) b-=256; - // lab to xyz - p = (l/2.55 + 16) / 116.0; - cx = pow( p + a * 0.002, 3); - cy = pow( p, 3); - cz = pow( p - b * 0.005, 3); - // white point - cx*=0.95047; - //cy*=1.000; - cz*=1.0883; - // xyz to rgb - cr = 3.240479 * cx - 1.537150 * cy - 0.498535 * cz; - cg = -0.969256 * cx + 1.875992 * cy + 0.041556 * cz; - cb = 0.055648 * cx - 0.204043 * cy + 1.057311 * cz; - - if ( cr > 0.00304 ) cr = 1.055 * pow(cr,0.41667) - 0.055; - else cr = 12.92 * cr; - if ( cg > 0.00304 ) cg = 1.055 * pow(cg,0.41667) - 0.055; - else cg = 12.92 * cg; - if ( cb > 0.00304 ) cb = 1.055 * pow(cb,0.41667) - 0.055; - else cb = 12.92 * cb; - - c.rgbRed =(BYTE)max(0,min(255,(int)(cr*255))); - c.rgbGreen=(BYTE)max(0,min(255,(int)(cg*255))); - c.rgbBlue =(BYTE)max(0,min(255,(int)(cb*255))); - - SetPixelColor(xi,yi,c); -#if CXIMAGE_SUPPORT_ALPHA - if (samplesperpixel==4) AlphaSet(xi,yi,bits[bitsoffset+3]); -#endif //CXIMAGE_SUPPORT_ALPHA - ii++; - xi++; - if (xi>=(int)width){ - yi--; - xi=0; - } - } - } - } - } - free(bits); - if (tiled_image) free(tilebuf); - - switch(orientation){ - case ORIENTATION_TOPRIGHT: /* row 0 top, col 0 rhs */ - Mirror(); - break; - case ORIENTATION_BOTRIGHT: /* row 0 bottom, col 0 rhs */ - Flip(); - Mirror(); - break; - case ORIENTATION_BOTLEFT: /* row 0 bottom, col 0 lhs */ - Flip(); - break; - case ORIENTATION_LEFTTOP: /* row 0 lhs, col 0 top */ - RotateRight(); - Mirror(); - break; - case ORIENTATION_RIGHTTOP: /* row 0 rhs, col 0 top */ - RotateLeft(); - break; - case ORIENTATION_RIGHTBOT: /* row 0 rhs, col 0 bottom */ - RotateLeft(); - Mirror(); - break; - case ORIENTATION_LEFTBOT: /* row 0 lhs, col 0 bottom */ - RotateRight(); - break; - } - - } - } catch (char *message) { - strncpy(info.szLastError,message,255); - if (m_tif) TIFFClose(m_tif); - if (info.nEscape==-1) return true; - return false; - } - TIFFClose(m_tif); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageTIF::Encode(CxFile * hFile, bool bAppend) -{ - try{ - if (hFile==NULL) throw CXIMAGE_ERR_NOFILE; - if (pDib==NULL) throw CXIMAGE_ERR_NOIMAGE; - - // replaced "w+b" with "a", to append an image directly on an existing file - if (m_tif2==NULL) m_tif2=_TIFFOpenEx(hFile, "a"); - if (m_tif2==NULL) throw "initialization fail"; - - if (bAppend || m_pages) m_multipage=true; - m_pages++; - - if (!EncodeBody(m_tif2,m_multipage,m_pages,m_pages)) throw "Error saving TIFF file"; - if (bAppend) { - if (!TIFFWriteDirectory(m_tif2)) throw "Error saving TIFF directory"; - } - } catch (char *message) { - strncpy(info.szLastError,message,255); - if (m_tif2){ - TIFFClose(m_tif2); - m_tif2=NULL; - m_multipage=false; - m_pages=0; - } - return false; - } - if (!bAppend){ - TIFFClose(m_tif2); - m_tif2=NULL; - m_multipage=false; - m_pages=0; - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -// Thanks to Abe -bool CxImageTIF::Encode(CxFile * hFile, CxImage ** pImages, int pagecount) -{ - try{ - if (hFile==NULL) throw "invalid file pointer"; - if (pImages==NULL || pagecount==0) throw "multipage TIFF, no images!"; - - CxImageTIF ghost; - for (int i=1; i<=pagecount; i++){ - if (pImages[i-1]==NULL) throw "Bad image pointer"; - ghost.Ghost(pImages[i-1]); - if (!ghost.Encode(hFile,true)) throw "Error saving TIFF file"; - } - } catch (char *message) { - strncpy(info.szLastError,message,255); - return false; - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImageTIF::EncodeBody(TIFF *m_tif, bool multipage, int page, int pagecount) -{ - uint32 height=head.biHeight; - uint32 width=head.biWidth; - uint16 bitcount=head.biBitCount; - uint16 bitspersample; - uint16 samplesperpixel; - uint16 photometric=0; - uint16 compression; -// uint16 pitch; -// int line; - uint32 x, y; - - samplesperpixel = ((bitcount == 24) || (bitcount == 32)) ? (BYTE)3 : (BYTE)1; -#if CXIMAGE_SUPPORT_ALPHA - if (bitcount==24 && AlphaIsValid()) { bitcount=32; samplesperpixel=4; } -#endif //CXIMAGE_SUPPORT_ALPHA - - bitspersample = bitcount / samplesperpixel; - - //set the PHOTOMETRIC tag - RGBQUAD *rgb = GetPalette(); - switch (bitcount) { - case 1: - if (CompareColors(&rgb[0],&rgb[1])<0) { - /* some viewers do not handle PHOTOMETRIC_MINISBLACK: - * let's transform the image in PHOTOMETRIC_MINISWHITE - */ - //invert the colors - RGBQUAD tempRGB=GetPaletteColor(0); - SetPaletteColor(0,GetPaletteColor(1)); - SetPaletteColor(1,tempRGB); - //invert the pixels - BYTE *iSrc=info.pImage; - for (unsigned long i=0;irgbRed != x)||(rgb->rgbRed != rgb->rgbGreen)||(rgb->rgbRed != rgb->rgbBlue)){ - photometric = PHOTOMETRIC_PALETTE; - break; - } - rgb++; - } - break; - case 24: - case 32: - photometric = PHOTOMETRIC_RGB; - break; - } - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid() && bitcount==8) samplesperpixel=2; //8bpp + alpha layer -#endif //CXIMAGE_SUPPORT_ALPHA - -// line = CalculateLine(width, bitspersample * samplesperpixel); -// pitch = (uint16)CalculatePitch(line); - - //prepare the palette struct - RGBQUAD pal[256]; - if (GetPalette()){ - BYTE b; - memcpy(pal,GetPalette(),GetPaletteSize()); - for(WORD a=0;a gives better compression - TIFFSetField(m_tif, TIFFTAG_ROWSPERSTRIP, rowsperstrip); - - // handle metrics - TIFFSetField(m_tif, TIFFTAG_RESOLUTIONUNIT, RESUNIT_INCH); - TIFFSetField(m_tif, TIFFTAG_XRESOLUTION, (float)info.xDPI); - TIFFSetField(m_tif, TIFFTAG_YRESOLUTION, (float)info.yDPI); -// TIFFSetField(m_tif, TIFFTAG_XPOSITION, (float)info.xOffset); -// TIFFSetField(m_tif, TIFFTAG_YPOSITION, (float)info.yOffset); - - // multi-paging - Thanks to Abe - if (multipage) - { - char page_number[20]; - sprintf(page_number, "Page %d", page); - - TIFFSetField(m_tif, TIFFTAG_SUBFILETYPE, FILETYPE_PAGE); - TIFFSetField(m_tif, TIFFTAG_PAGENUMBER, page,pagecount); - TIFFSetField(m_tif, TIFFTAG_PAGENAME, page_number); - } else { - TIFFSetField(m_tif, TIFFTAG_SUBFILETYPE, 0); - } - - // palettes (image colormaps are automatically scaled to 16-bits) - if (photometric == PHOTOMETRIC_PALETTE) { - uint16 *r, *g, *b; - r = (uint16 *) _TIFFmalloc(sizeof(uint16) * 3 * 256); - g = r + 256; - b = g + 256; - - for (int i = 255; i >= 0; i--) { - b[i] = (uint16)SCALE((uint16)pal[i].rgbRed); - g[i] = (uint16)SCALE((uint16)pal[i].rgbGreen); - r[i] = (uint16)SCALE((uint16)pal[i].rgbBlue); - } - - TIFFSetField(m_tif, TIFFTAG_COLORMAP, r, g, b); - _TIFFfree(r); - } - - // compression - if (GetCodecOption(CXIMAGE_FORMAT_TIF)) { - compression = (WORD)GetCodecOption(CXIMAGE_FORMAT_TIF); - } else { - switch (bitcount) { - case 1 : - compression = COMPRESSION_CCITTFAX4; - break; - case 4 : - case 8 : - compression = COMPRESSION_LZW; - break; - case 24 : - case 32 : - compression = COMPRESSION_JPEG; - break; - default : - compression = COMPRESSION_NONE; - break; - } - } - TIFFSetField(m_tif, TIFFTAG_COMPRESSION, compression); - - switch (compression) { - case COMPRESSION_JPEG: - TIFFSetField(m_tif, TIFFTAG_JPEGQUALITY, info.nQuality); - TIFFSetField(m_tif, TIFFTAG_ROWSPERSTRIP, ((7+rowsperstrip)>>3)<<3); - break; - case COMPRESSION_LZW: - if (bitcount>=8) TIFFSetField(m_tif, TIFFTAG_PREDICTOR, 2); - break; - } - - // read the DIB lines from bottom to top and save them in the TIF - - BYTE *bits; - switch(bitcount) { - case 1 : - case 4 : - case 8 : - { - if (samplesperpixel==1){ - for (y = 0; y < height; y++) { - bits= info.pImage + (height - y - 1)*info.dwEffWidth; - if (TIFFWriteScanline(m_tif,bits, y, 0)==-1) return false; - } - } -#if CXIMAGE_SUPPORT_ALPHA - else { //8bpp + alpha layer - bits = (BYTE*)malloc(2*width); - if (!bits) return false; - for (y = 0; y < height; y++) { - for (x=0;x 0) { - uint32 j = cols; - while (j-- > 0) - *out++ = *in++; - out += outskew; - in += inskew; - } -} -//////////////////////////////////////////////////////////////////////////////// -TIFF* CxImageTIF::TIFFOpenEx(CxFile * hFile) -{ - if (hFile) return _TIFFOpenEx(hFile, "rb"); - return NULL; -} -//////////////////////////////////////////////////////////////////////////////// -void CxImageTIF::TIFFCloseEx(TIFF* tif) -{ - if (tif) TIFFClose(tif); -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_TIF diff --git a/src/win32/dependencies/cximage/ximatif.h b/src/win32/dependencies/cximage/ximatif.h deleted file mode 100644 index e38182bf..00000000 --- a/src/win32/dependencies/cximage/ximatif.h +++ /dev/null @@ -1,60 +0,0 @@ -/* - * File: ximatif.h - * Purpose: TIFF Image Class Loader and Writer - */ -/* ========================================================== - * CxImageTIF (c) 07/Aug/2001 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * - * Special thanks to Troels Knakkergaard for new features, enhancements and bugfixes - * - * Special thanks to Abe for MultiPageTIFF code. - * - * LibTIFF is: - * Copyright (c) 1988-1997 Sam Leffler - * Copyright (c) 1991-1997 Silicon Graphics, Inc. - * ========================================================== - */ - -#if !defined(__ximatif_h) -#define __ximatif_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_TIF - -#include "../tiff/tiffio.h" - -class DLL_EXP CxImageTIF: public CxImage -{ -public: - CxImageTIF(): CxImage(CXIMAGE_FORMAT_TIF) {m_tif2=NULL; m_multipage=false; m_pages=0;} - ~CxImageTIF(); - - TIFF* TIFFOpenEx(CxFile * hFile); - void TIFFCloseEx(TIFF* tif); - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_TIF);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_TIF);} - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile, bool bAppend=false); - bool Encode(CxFile * hFile, CxImage ** pImages, int pagecount); - bool Encode(FILE *hFile, bool bAppend=false) { CxIOFile file(hFile); return Encode(&file,bAppend); } - bool Encode(FILE *hFile, CxImage ** pImages, int pagecount) - { CxIOFile file(hFile); return Encode(&file, pImages, pagecount); } -#endif // CXIMAGE_SUPPORT_ENCODE - -protected: - void TileToStrip(uint8* out, uint8* in, uint32 rows, uint32 cols, int outskew, int inskew); - bool EncodeBody(TIFF *m_tif, bool multipage=false, int page=0, int pagecount=0); - TIFF *m_tif2; - bool m_multipage; - int m_pages; -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximatran.cpp b/src/win32/dependencies/cximage/ximatran.cpp deleted file mode 100644 index 82ea4747..00000000 --- a/src/win32/dependencies/cximage/ximatran.cpp +++ /dev/null @@ -1,2439 +0,0 @@ -// xImaTran.cpp : Transformation functions -/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" -#include "ximath.h" - -#if CXIMAGE_SUPPORT_BASICTRANSFORMATIONS -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::GrayScale() -{ - if (!pDib) return false; - if (head.biBitCount<=8){ - RGBQUAD* ppal=GetPalette(); - int gray; - //converts the colors to gray, use the blue channel only - for(DWORD i=0;iIsValid()) return false; - BYTE *iSrc,*iDst; - iSrc=info.pImage + (head.biHeight-1)*info.dwEffWidth; - iDst=imatmp->info.pImage; - for(long y=0; y < head.biHeight; y++){ - memcpy(iDst,iSrc,info.dwEffWidth); - iSrc-=info.dwEffWidth; - iDst+=info.dwEffWidth; - } - -#if CXIMAGE_SUPPORT_ALPHA - imatmp->AlphaFlip(); -#endif //CXIMAGE_SUPPORT_ALPHA - - Transfer(*imatmp); - delete imatmp; - return true; -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::Mirror() -{ - if (!pDib) return false; - - CxImage* imatmp = new CxImage(*this,false,false,true); - if (!imatmp) return false; - BYTE *iSrc,*iDst; - long wdt=(head.biWidth-1) * (head.biBitCount==24 ? 3:1); - iSrc=info.pImage + wdt; - iDst=imatmp->info.pImage; - long x,y; - switch (head.biBitCount){ - case 24: - for(y=0; y < head.biHeight; y++){ - for(x=0; x <= wdt; x+=3){ - *(iDst+x)=*(iSrc-x); - *(iDst+x+1)=*(iSrc-x+1); - *(iDst+x+2)=*(iSrc-x+2); - } - iSrc+=info.dwEffWidth; - iDst+=info.dwEffWidth; - } - break; - case 8: - for(y=0; y < head.biHeight; y++){ - for(x=0; x <= wdt; x++) - *(iDst+x)=*(iSrc-x); - iSrc+=info.dwEffWidth; - iDst+=info.dwEffWidth; - } - break; - default: - for(y=0; y < head.biHeight; y++){ - for(x=0; x <= wdt; x++) - imatmp->SetPixelIndex(x,y,GetPixelIndex(wdt-x,y)); - } - } - -#if CXIMAGE_SUPPORT_ALPHA - imatmp->AlphaMirror(); -#endif //CXIMAGE_SUPPORT_ALPHA - - Transfer(*imatmp); - delete imatmp; - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -#define RBLOCK 64 - -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::RotateLeft(CxImage* iDst) -{ - if (!pDib) return false; - - long newWidth = GetHeight(); - long newHeight = GetWidth(); - - CxImage imgDest; - imgDest.CopyInfo(*this); - imgDest.Create(newWidth,newHeight,GetBpp(),GetType()); - imgDest.SetPalette(GetPalette()); - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) imgDest.AlphaCreate(); -#endif - - long x,x2,y,dlineup; - - // Speedy rotate for BW images - if (head.biBitCount == 1) { - - BYTE *sbits, *dbits, *dbitsmax, bitpos, *nrow,*srcdisp; - div_t div_r; - - BYTE *bsrc = GetBits(), *bdest = imgDest.GetBits(); - dbitsmax = bdest + imgDest.head.biSizeImage - 1; - dlineup = 8 * imgDest.info.dwEffWidth - imgDest.head.biWidth; - - imgDest.Clear(0); - for (y = 0; y < head.biHeight; y++) { - // Figure out the Column we are going to be copying to - div_r = div((int)(y + dlineup), 8); - // set bit pos of src column byte - bitpos = 1 << div_r.rem; - srcdisp = bsrc + y * info.dwEffWidth; - for (x = 0; x < (long)info.dwEffWidth; x++) { - // Get Source Bits - sbits = srcdisp + x; - // Get destination column - nrow = bdest + (x * 8) * imgDest.info.dwEffWidth + imgDest.info.dwEffWidth - 1 - div_r.quot; - for (long z = 0; z < 8; z++) { - // Get Destination Byte - dbits = nrow + z * imgDest.info.dwEffWidth; - if ((dbits < bdest) || (dbits > dbitsmax)) break; - if (*sbits & (128 >> z)) *dbits |= bitpos; - } - } - }//for y - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) { - for (x = 0; x < newWidth; x++){ - x2=newWidth-x-1; - for (y = 0; y < newHeight; y++){ - imgDest.AlphaSet(x,y,BlindAlphaGet(y, x2)); - }//for y - }//for x - } -#endif //CXIMAGE_SUPPORT_ALPHA - - } else { - //anything other than BW: - //bd, 10. 2004: This optimized version of rotation rotates image by smaller blocks. It is quite - //a bit faster than obvious algorithm, because it produces much less CPU cache misses. - //This optimization can be tuned by changing block size (RBLOCK). 96 is good value for current - //CPUs (tested on Athlon XP and Celeron D). Larger value (if CPU has enough cache) will increase - //speed somehow, but once you drop out of CPU's cache, things will slow down drastically. - //For older CPUs with less cache, lower value would yield better results. - - BYTE *srcPtr, *dstPtr; //source and destionation for 24-bit version - int xs, ys; //x-segment and y-segment - for (xs = 0; xs < newWidth; xs+=RBLOCK) { //for all image blocks of RBLOCK*RBLOCK pixels - for (ys = 0; ys < newHeight; ys+=RBLOCK) { - if (head.biBitCount==24) { - //RGB24 optimized pixel access: - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ //do rotation - info.nProgress = (long)(100*x/newWidth); - x2=newWidth-x-1; - dstPtr = (BYTE*) imgDest.BlindGetPixelPointer(x,ys); - srcPtr = (BYTE*) BlindGetPixelPointer(ys, x2); - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ - //imgDest.SetPixelColor(x, y, GetPixelColor(y, x2)); - *(dstPtr) = *(srcPtr); - *(dstPtr+1) = *(srcPtr+1); - *(dstPtr+2) = *(srcPtr+2); - srcPtr += 3; - dstPtr += imgDest.info.dwEffWidth; - }//for y - }//for x - } else { - //anything else than 24bpp (and 1bpp): palette - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ - info.nProgress = (long)(100*x/newWidth); // - x2=newWidth-x-1; - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ - imgDest.SetPixelIndex(x, y, BlindGetPixelIndex(y, x2)); - }//for y - }//for x - }//if (version selection) -#if CXIMAGE_SUPPORT_ALPHA - if (pAlpha) { - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ - x2=newWidth-x-1; - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ - imgDest.AlphaSet(x,y,BlindAlphaGet(y, x2)); - }//for y - }//for x - }//if (alpha channel) -#endif //CXIMAGE_SUPPORT_ALPHA - }//for ys - }//for xs - }//if - - //select the destination - if (iDst) iDst->Transfer(imgDest); - else Transfer(imgDest); - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::RotateRight(CxImage* iDst) -{ - if (!pDib) return false; - - long newWidth = GetHeight(); - long newHeight = GetWidth(); - - CxImage imgDest; - imgDest.CopyInfo(*this); - imgDest.Create(newWidth,newHeight,GetBpp(),GetType()); - imgDest.SetPalette(GetPalette()); - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) imgDest.AlphaCreate(); -#endif - - long x,y,y2; - // Speedy rotate for BW images - if (head.biBitCount == 1) { - - BYTE *sbits, *dbits, *dbitsmax, bitpos, *nrow,*srcdisp; - div_t div_r; - - BYTE *bsrc = GetBits(), *bdest = imgDest.GetBits(); - dbitsmax = bdest + imgDest.head.biSizeImage - 1; - - imgDest.Clear(0); - for (y = 0; y < head.biHeight; y++) { - // Figure out the Column we are going to be copying to - div_r = div((int)y, 8); - // set bit pos of src column byte - bitpos = 128 >> div_r.rem; - srcdisp = bsrc + y * info.dwEffWidth; - for (x = 0; x < (long)info.dwEffWidth; x++) { - // Get Source Bits - sbits = srcdisp + x; - // Get destination column - nrow = bdest + (imgDest.head.biHeight-1-(x*8)) * imgDest.info.dwEffWidth + div_r.quot; - for (long z = 0; z < 8; z++) { - // Get Destination Byte - dbits = nrow - z * imgDest.info.dwEffWidth; - if ((dbits < bdest) || (dbits > dbitsmax)) break; - if (*sbits & (128 >> z)) *dbits |= bitpos; - } - } - } - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()){ - for (y = 0; y < newHeight; y++){ - y2=newHeight-y-1; - for (x = 0; x < newWidth; x++){ - imgDest.AlphaSet(x,y,BlindAlphaGet(y2, x)); - } - } - } -#endif //CXIMAGE_SUPPORT_ALPHA - - } else { - //anything else but BW - BYTE *srcPtr, *dstPtr; //source and destionation for 24-bit version - int xs, ys; //x-segment and y-segment - for (xs = 0; xs < newWidth; xs+=RBLOCK) { - for (ys = 0; ys < newHeight; ys+=RBLOCK) { - if (head.biBitCount==24) { - //RGB24 optimized pixel access: - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ - info.nProgress = (long)(100*y/newHeight); // - y2=newHeight-y-1; - dstPtr = (BYTE*) imgDest.BlindGetPixelPointer(xs,y); - srcPtr = (BYTE*) BlindGetPixelPointer(y2, xs); - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ - //imgDest.SetPixelColor(x, y, GetPixelColor(y2, x)); - *(dstPtr) = *(srcPtr); - *(dstPtr+1) = *(srcPtr+1); - *(dstPtr+2) = *(srcPtr+2); - dstPtr += 3; - srcPtr += info.dwEffWidth; - }//for x - }//for y - } else { - //anything else than BW & RGB24: palette - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ - info.nProgress = (long)(100*y/newHeight); // - y2=newHeight-y-1; - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ - imgDest.SetPixelIndex(x, y, BlindGetPixelIndex(y2, x)); - }//for x - }//for y - }//if -#if CXIMAGE_SUPPORT_ALPHA - if (pAlpha){ - for (y = ys; y < min(newHeight, ys+RBLOCK); y++){ - y2=newHeight-y-1; - for (x = xs; x < min(newWidth, xs+RBLOCK); x++){ - imgDest.AlphaSet(x,y,BlindAlphaGet(y2, x)); - }//for x - }//for y - }//if (has alpha) -#endif //CXIMAGE_SUPPORT_ALPHA - }//for ys - }//for xs - }//if - - //select the destination - if (iDst) iDst->Transfer(imgDest); - else Transfer(imgDest); - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::Negative() -{ - if (!pDib) return false; - - if (head.biBitCount<=8){ - if (IsGrayScale()){ //GRAYSCALE, selection - if (pSelection){ - for(long y=info.rSelectionBox.bottom; y invert transparent color too - info.nBkgndColor.rgbBlue = (BYTE)(255-info.nBkgndColor.rgbBlue); - info.nBkgndColor.rgbGreen = (BYTE)(255-info.nBkgndColor.rgbGreen); - info.nBkgndColor.rgbRed = (BYTE)(255-info.nBkgndColor.rgbRed); - } - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_BASICTRANSFORMATIONS -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_TRANSFORMATION -//////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::Rotate(float angle, CxImage* iDst) -{ - if (!pDib) return false; - - // Copyright (c) 1996-1998 Ulrich von Zadow - - // Negative the angle, because the y-axis is negative. - double ang = -angle*acos((float)0)/90; - int newWidth, newHeight; - int nWidth = GetWidth(); - int nHeight= GetHeight(); - double cos_angle = cos(ang); - double sin_angle = sin(ang); - - // Calculate the size of the new bitmap - POINT p1={0,0}; - POINT p2={nWidth,0}; - POINT p3={0,nHeight}; - POINT p4={nWidth-1,nHeight}; - POINT newP1,newP2,newP3,newP4, leftTop, rightTop, leftBottom, rightBottom; - - newP1.x = p1.x; - newP1.y = p1.y; - newP2.x = (long)floor(p2.x*cos_angle - p2.y*sin_angle); - newP2.y = (long)floor(p2.x*sin_angle + p2.y*cos_angle); - newP3.x = (long)floor(p3.x*cos_angle - p3.y*sin_angle); - newP3.y = (long)floor(p3.x*sin_angle + p3.y*cos_angle); - newP4.x = (long)floor(p4.x*cos_angle - p4.y*sin_angle); - newP4.y = (long)floor(p4.x*sin_angle + p4.y*cos_angle); - - leftTop.x = min(min(newP1.x,newP2.x),min(newP3.x,newP4.x)); - leftTop.y = min(min(newP1.y,newP2.y),min(newP3.y,newP4.y)); - rightBottom.x = max(max(newP1.x,newP2.x),max(newP3.x,newP4.x)); - rightBottom.y = max(max(newP1.y,newP2.y),max(newP3.y,newP4.y)); - leftBottom.x = leftTop.x; - leftBottom.y = 2+rightBottom.y; - rightTop.x = 2+rightBottom.x; - rightTop.y = leftTop.y; - - newWidth = rightTop.x - leftTop.x; - newHeight= leftBottom.y - leftTop.y; - CxImage imgDest; - imgDest.CopyInfo(*this); - imgDest.Create(newWidth,newHeight,GetBpp(),GetType()); - imgDest.SetPalette(GetPalette()); - -#if CXIMAGE_SUPPORT_ALPHA - if(AlphaIsValid()) //MTA: Fix for rotation problem when the image has an alpha channel - { - imgDest.AlphaCreate(); - imgDest.AlphaClear(); - } -#endif //CXIMAGE_SUPPORT_ALPHA - - int x,y,newX,newY,oldX,oldY; - - if (head.biClrUsed==0){ //RGB - for (y = leftTop.y, newY = 0; y<=leftBottom.y; y++,newY++){ - info.nProgress = (long)(100*newY/newHeight); - if (info.nEscape) break; - for (x = leftTop.x, newX = 0; x<=rightTop.x; x++,newX++){ - oldX = (long)(x*cos_angle + y*sin_angle - 0.5); - oldY = (long)(y*cos_angle - x*sin_angle - 0.5); - imgDest.SetPixelColor(newX,newY,GetPixelColor(oldX,oldY)); -#if CXIMAGE_SUPPORT_ALPHA - imgDest.AlphaSet(newX,newY,AlphaGet(oldX,oldY)); //MTA: copy the alpha value -#endif //CXIMAGE_SUPPORT_ALPHA - } - } - } else { //PALETTE - for (y = leftTop.y, newY = 0; y<=leftBottom.y; y++,newY++){ - info.nProgress = (long)(100*newY/newHeight); - if (info.nEscape) break; - for (x = leftTop.x, newX = 0; x<=rightTop.x; x++,newX++){ - oldX = (long)(x*cos_angle + y*sin_angle - 0.5); - oldY = (long)(y*cos_angle - x*sin_angle - 0.5); - imgDest.SetPixelIndex(newX,newY,GetPixelIndex(oldX,oldY)); -#if CXIMAGE_SUPPORT_ALPHA - imgDest.AlphaSet(newX,newY,AlphaGet(oldX,oldY)); //MTA: copy the alpha value -#endif //CXIMAGE_SUPPORT_ALPHA - } - } - } - //select the destination - if (iDst) iDst->Transfer(imgDest); - else Transfer(imgDest); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Rotates image around it's center. - * Method can use interpolation with paletted images, but does not change pallete, so results vary. - * (If you have only four colours in a palette, there's not much room for interpolation.) - * - * \param angle - angle in degrees (positive values rotate clockwise) - * \param *iDst - destination image (if null, this image is changed) - * \param inMethod - interpolation method used - * (IM_NEAREST_NEIGHBOUR produces aliasing (fast), IM_BILINEAR softens picture a bit (slower) - * IM_SHARPBICUBIC is slower and produces some halos...) - * \param ofMethod - overflow method (how to choose colour of pixels that have no source) - * \param replColor - replacement colour to use (OM_COLOR, OM_BACKGROUND with no background colour...) - * \param optimizeRightAngles - call faster methods for 90, 180, and 270 degree rotations. Faster methods - * are called for angles, where error (in location of corner pixels) is less - * than 0.25 pixels. - * \param bKeepOriginalSize - rotates the image without resizing. - * - * \author ***bd*** 2.2004 - */ -bool CxImage::Rotate2(float angle, - CxImage *iDst, - InterpolationMethod inMethod, - OverflowMethod ofMethod, - RGBQUAD *replColor, - bool const optimizeRightAngles, - bool const bKeepOriginalSize) -{ - if (!pDib) return false; //no dib no go - - double ang = -angle*acos(0.0f)/90.0f; //convert angle to radians and invert (positive angle performs clockwise rotation) - float cos_angle = (float) cos(ang); //these two are needed later (to rotate) - float sin_angle = (float) sin(ang); - - //Calculate the size of the new bitmap (rotate corners of image) - CxPoint2 p[4]; //original corners of the image - p[0]=CxPoint2(-0.5f,-0.5f); - p[1]=CxPoint2(GetWidth()-0.5f,-0.5f); - p[2]=CxPoint2(-0.5f,GetHeight()-0.5f); - p[3]=CxPoint2(GetWidth()-0.5f,GetHeight()-0.5f); - CxPoint2 newp[4]; //rotated positions of corners - //(rotate corners) - if (bKeepOriginalSize){ - for (int i=0; i<4; i++) { - newp[i].x = p[i].x; - newp[i].y = p[i].y; - }//for - } else { - for (int i=0; i<4; i++) { - newp[i].x = (p[i].x*cos_angle - p[i].y*sin_angle); - newp[i].y = (p[i].x*sin_angle + p[i].y*cos_angle); - }//for i - - if (optimizeRightAngles) { - //For rotations of 90, -90 or 180 or 0 degrees, call faster routines - if (newp[3].Distance(CxPoint2(GetHeight()-0.5f, 0.5f-GetWidth())) < 0.25) - //rotation right for circa 90 degrees (diagonal pixels less than 0.25 pixel away from 90 degree rotation destination) - return RotateRight(iDst); - if (newp[3].Distance(CxPoint2(0.5f-GetHeight(), -0.5f+GetWidth())) < 0.25) - //rotation left for ~90 degrees - return RotateLeft(iDst); - if (newp[3].Distance(CxPoint2(0.5f-GetWidth(), 0.5f-GetHeight())) < 0.25) - //rotation left for ~180 degrees - return Rotate180(iDst); - if (newp[3].Distance(p[3]) < 0.25) { - //rotation not significant - if (iDst) iDst->Copy(*this); //copy image to iDst, if required - return true; //and we're done - }//if - }//if - }//if - - //(read new dimensions from location of corners) - float minx = (float) min(min(newp[0].x,newp[1].x),min(newp[2].x,newp[3].x)); - float miny = (float) min(min(newp[0].y,newp[1].y),min(newp[2].y,newp[3].y)); - float maxx = (float) max(max(newp[0].x,newp[1].x),max(newp[2].x,newp[3].x)); - float maxy = (float) max(max(newp[0].y,newp[1].y),max(newp[2].y,newp[3].y)); - int newWidth = (int) floor(maxx-minx+0.5f); - int newHeight= (int) floor(maxy-miny+0.5f); - float ssx=((maxx+minx)- ((float) newWidth-1))/2.0f; //start for x - float ssy=((maxy+miny)- ((float) newHeight-1))/2.0f; //start for y - - float newxcenteroffset = 0.5f * newWidth; - float newycenteroffset = 0.5f * newHeight; - if (bKeepOriginalSize){ - ssx -= 0.5f * GetWidth(); - ssy -= 0.5f * GetHeight(); - } - - //create destination image - CxImage imgDest; - imgDest.CopyInfo(*this); - imgDest.Create(newWidth,newHeight,GetBpp(),GetType()); - imgDest.SetPalette(GetPalette()); -#if CXIMAGE_SUPPORT_ALPHA - if(AlphaIsValid()) imgDest.AlphaCreate(); //MTA: Fix for rotation problem when the image has an alpha channel -#endif //CXIMAGE_SUPPORT_ALPHA - - RGBQUAD rgb; //pixel colour - RGBQUAD rc; - if (replColor!=0) - rc=*replColor; - else { - rc.rgbRed=255; rc.rgbGreen=255; rc.rgbBlue=255; rc.rgbReserved=0; - }//if - float x,y; //destination location (float, with proper offset) - float origx, origy; //origin location - int destx, desty; //destination location - - y=ssy; //initialize y - if (!IsIndexed()){ //RGB24 - //optimized RGB24 implementation (direct write to destination): - BYTE *pxptr; -#if CXIMAGE_SUPPORT_ALPHA - BYTE *pxptra=0; -#endif //CXIMAGE_SUPPORT_ALPHA - for (desty=0; destyTransfer(imgDest); - else Transfer(imgDest); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::Rotate180(CxImage* iDst) -{ - if (!pDib) return false; - - long wid = GetWidth(); - long ht = GetHeight(); - - CxImage imgDest; - imgDest.CopyInfo(*this); - imgDest.Create(wid,ht,GetBpp(),GetType()); - imgDest.SetPalette(GetPalette()); - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) imgDest.AlphaCreate(); -#endif //CXIMAGE_SUPPORT_ALPHA - - long x,y,y2; - for (y = 0; y < ht; y++){ - info.nProgress = (long)(100*y/ht); // - y2=ht-y-1; - for (x = 0; x < wid; x++){ - if(head.biClrUsed==0)//RGB - imgDest.SetPixelColor(wid-x-1, y2, GetPixelColor(x, y)); - else //PALETTE - imgDest.SetPixelIndex(wid-x-1, y2, GetPixelIndex(x, y)); - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) imgDest.AlphaSet(wid-x-1, y2,AlphaGet(x, y)); -#endif //CXIMAGE_SUPPORT_ALPHA - - } - } - - //select the destination - if (iDst) iDst->Transfer(imgDest); - else Transfer(imgDest); - return true; -} - -//////////////////////////////////////////////////////////////////////////////// -/** - * Resizes the image. mode can be 0 for slow (bilinear) method , - * 1 for fast (nearest pixel) method, or 2 for accurate (bicubic spline interpolation) method. - * The function is faster with 24 and 1 bpp images, slow for 4 bpp images and slowest for 8 bpp images. - */ -bool CxImage::Resample(long newx, long newy, int mode, CxImage* iDst) -{ - if (newx==0 || newy==0) return false; - - if (head.biWidth==newx && head.biHeight==newy){ - if (iDst) iDst->Copy(*this); - return true; - } - - float xScale, yScale, fX, fY; - xScale = (float)head.biWidth / (float)newx; - yScale = (float)head.biHeight / (float)newy; - - CxImage newImage; - newImage.CopyInfo(*this); - newImage.Create(newx,newy,head.biBitCount,GetType()); - newImage.SetPalette(GetPalette()); - if (!newImage.IsValid()) return false; - - switch (mode) { - case 1: // nearest pixel - { - for(long y=0; y=head.biHeight) yy = head.biHeight-1; - for(int n=-1; n<3; n++) { - r2 = r1 * KernelBSpline(b - (float)n); - xx = i_x+n; - if (xx<0) xx=0; - if (xx>=head.biWidth) xx=head.biWidth-1; - - if (head.biClrUsed){ - rgb = GetPixelColor(xx,yy); - } else { - iDst = info.pImage + yy*info.dwEffWidth + xx*3; - rgb.rgbBlue = *iDst++; - rgb.rgbGreen= *iDst++; - rgb.rgbRed = *iDst; - } - - rr += rgb.rgbRed * r2; - gg += rgb.rgbGreen * r2; - bb += rgb.rgbBlue * r2; - } - } - - if (head.biClrUsed) - newImage.SetPixelColor(x,y,RGB(rr,gg,bb)); - else { - iDst = newImage.info.pImage + y*newImage.info.dwEffWidth + x*3; - *iDst++ = (BYTE)bb; - *iDst++ = (BYTE)gg; - *iDst = (BYTE)rr; - } - - } - } - break; - } - default: // bilinear interpolation - if (!(head.biWidth>newx && head.biHeight>newy && head.biBitCount==24)) { - //© 1999 Steve McMahon (steve@dogma.demon.co.uk) - long ifX, ifY, ifX1, ifY1, xmax, ymax; - float ir1, ir2, ig1, ig2, ib1, ib2, dx, dy; - BYTE r,g,b; - RGBQUAD rgb1, rgb2, rgb3, rgb4; - xmax = head.biWidth-1; - ymax = head.biHeight-1; - for(long y=0; y - const long ACCURACY = 1000; - long i,j; // index for faValue - long x,y; // coordinates in source image - BYTE* pSource; - BYTE* pDest = newImage.info.pImage; - long* naAccu = new long[3 * newx + 3]; - long* naCarry = new long[3 * newx + 3]; - long* naTemp; - long nWeightX,nWeightY; - float fEndX; - long nScale = (long)(ACCURACY * xScale * yScale); - - memset(naAccu, 0, sizeof(long) * 3 * newx); - memset(naCarry, 0, sizeof(long) * 3 * newx); - - int u, v = 0; // coordinates in dest image - float fEndY = yScale - 1.0f; - for (y = 0; y < head.biHeight; y++){ - info.nProgress = (long)(100*y/head.biHeight); // - if (info.nEscape) break; - pSource = info.pImage + y * info.dwEffWidth; - u = i = 0; - fEndX = xScale - 1.0f; - if ((float)y < fEndY) { // complete source row goes into dest row - for (x = 0; x < head.biWidth; x++){ - if ((float)x < fEndX){ // complete source pixel goes into dest pixel - for (j = 0; j < 3; j++) naAccu[i + j] += (*pSource++) * ACCURACY; - } else { // source pixel is splitted for 2 dest pixels - nWeightX = (long)(((float)x - fEndX) * ACCURACY); - for (j = 0; j < 3; j++){ - naAccu[i] += (ACCURACY - nWeightX) * (*pSource); - naAccu[3 + i++] += nWeightX * (*pSource++); - } - fEndX += xScale; - u++; - } - } - } else { // source row is splitted for 2 dest rows - nWeightY = (long)(((float)y - fEndY) * ACCURACY); - for (x = 0; x < head.biWidth; x++){ - if ((float)x < fEndX){ // complete source pixel goes into 2 pixel - for (j = 0; j < 3; j++){ - naAccu[i + j] += ((ACCURACY - nWeightY) * (*pSource)); - naCarry[i + j] += nWeightY * (*pSource++); - } - } else { // source pixel is splitted for 4 dest pixels - nWeightX = (int)(((float)x - fEndX) * ACCURACY); - for (j = 0; j < 3; j++) { - naAccu[i] += ((ACCURACY - nWeightY) * (ACCURACY - nWeightX)) * (*pSource) / ACCURACY; - *pDest++ = (BYTE)(naAccu[i] / nScale); - naCarry[i] += (nWeightY * (ACCURACY - nWeightX) * (*pSource)) / ACCURACY; - naAccu[i + 3] += ((ACCURACY - nWeightY) * nWeightX * (*pSource)) / ACCURACY; - naCarry[i + 3] = (nWeightY * nWeightX * (*pSource)) / ACCURACY; - i++; - pSource++; - } - fEndX += xScale; - u++; - } - } - if (u < newx){ // possibly not completed due to rounding errors - for (j = 0; j < 3; j++) *pDest++ = (BYTE)(naAccu[i++] / nScale); - } - naTemp = naCarry; - naCarry = naAccu; - naAccu = naTemp; - memset(naCarry, 0, sizeof(int) * 3); // need only to set first pixel zero - pDest = newImage.info.pImage + (++v * newImage.info.dwEffWidth); - fEndY += yScale; - } - } - if (v < newy){ // possibly not completed due to rounding errors - for (i = 0; i < 3 * newx; i++) *pDest++ = (BYTE)(naAccu[i] / nScale); - } - delete [] naAccu; - delete [] naCarry; - } - } - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()){ - newImage.AlphaCreate(); - for(long y=0; yTransfer(newImage); - else Transfer(newImage); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * New simpler resample. Adds new interpolation methods and simplifies code (using GetPixelColorInterpolated - * and GetAreaColorInterpolated). It also (unlike old method) interpolates alpha layer. - * - * \param newx, newy - size of resampled image - * \param inMethod - interpolation method to use (see comments at GetPixelColorInterpolated) - * If image size is being reduced, averaging is used instead (or simultaneously with) inMethod. - * \param ofMethod - what to replace outside pixels by (only significant for bordering pixels of enlarged image) - * \param iDst - pointer to destination CxImage or NULL. - * \param disableAveraging - force no averaging when shrinking images (Produces aliasing. - * You probably just want to leave this off...) - * - * \author ***bd*** 2.2004 - */ -bool CxImage::Resample2( - long newx, long newy, - InterpolationMethod const inMethod, - OverflowMethod const ofMethod, - CxImage* const iDst, - bool const disableAveraging) -{ - if (newx<=0 || newy<=0 || !pDib) return false; - - if (head.biWidth==newx && head.biHeight==newy) { - //image already correct size (just copy and return) - if (iDst) iDst->Copy(*this); - return true; - }//if - - //calculate scale of new image (less than 1 for enlarge) - float xScale, yScale; - xScale = (float)head.biWidth / (float)newx; - yScale = (float)head.biHeight / (float)newy; - - //create temporary destination image - CxImage newImage; - newImage.CopyInfo(*this); - newImage.Create(newx,newy,head.biBitCount,GetType()); - newImage.SetPalette(GetPalette()); - if (!newImage.IsValid()) return false; - - //and alpha channel if required -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) newImage.AlphaCreate(); -#endif - - float sX, sY; //source location - long dX,dY; //destination pixel (int value) - if ((xScale<=1 && yScale<=1) || disableAveraging) { - //image is being enlarged (or interpolation on demand) - if (!IsIndexed()) { - //RGB24 image (optimized version with direct writes) - RGBQUAD q; //pixel colour - BYTE *pxptr; //pointer to destination pixel -#if CXIMAGE_SUPPORT_ALPHA - BYTE *pxptra; //and destination alpha data -#endif - for(dY=0; dYTransfer(newImage); - else - Transfer(newImage); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Reduces the number of bits per pixel to nbit (1, 4 or 8). - * ppal points to a valid palette for the final image; if not supplied the function will use a standard palette. - * ppal is not necessary for reduction to 1 bpp. - */ -bool CxImage::DecreaseBpp(DWORD nbit, bool errordiffusion, RGBQUAD* ppal, DWORD clrimportant) -{ - if (!pDib) return false; - if (head.biBitCount < nbit) return false; - if (head.biBitCount == nbit){ - if (clrimportant==0) return true; - if (head.biClrImportant && (head.biClrImportant4) return false; - - CxImage tmp; - tmp.CopyInfo(*this); - tmp.Create(head.biWidth,head.biHeight,4,info.dwType); - tmp.SetPalette(GetPalette(),GetNumColors()); - if (!tmp.IsValid()) return false; - - -#if CXIMAGE_SUPPORT_SELECTION - tmp.SelectionCopy(*this); -#endif //CXIMAGE_SUPPORT_SELECTION - -#if CXIMAGE_SUPPORT_ALPHA - tmp.AlphaCopy(*this); -#endif //CXIMAGE_SUPPORT_ALPHA - - for (long y=0;y8) return false; - - CxImage tmp; - tmp.CopyInfo(*this); - tmp.Create(head.biWidth,head.biHeight,8,info.dwType); - tmp.SetPalette(GetPalette(),GetNumColors()); - if (!tmp.IsValid()) return false; - -#if CXIMAGE_SUPPORT_SELECTION - tmp.SelectionCopy(*this); -#endif //CXIMAGE_SUPPORT_SELECTION - -#if CXIMAGE_SUPPORT_ALPHA - tmp.AlphaCopy(*this); -#endif //CXIMAGE_SUPPORT_ALPHA - - for (long y=0;y24) return false; - - CxImage tmp; - tmp.CopyInfo(*this); - tmp.Create(head.biWidth,head.biHeight,24,info.dwType); - if (!tmp.IsValid()) return false; - - if (info.nBkgndIndex>=0) //translate transparency - tmp.info.nBkgndColor=GetPaletteColor((BYTE)info.nBkgndIndex); - -#if CXIMAGE_SUPPORT_SELECTION - tmp.SelectionCopy(*this); -#endif //CXIMAGE_SUPPORT_SELECTION - -#if CXIMAGE_SUPPORT_ALPHA - tmp.AlphaCopy(*this); - if (AlphaPaletteIsValid() && !AlphaIsValid()) tmp.AlphaCreate(); -#endif //CXIMAGE_SUPPORT_ALPHA - - for (long y=0;y 128) { - tmp.SetPixelIndex(x, y, 1); - error = level - 255; - } else { - tmp.SetPixelIndex(x, y, 0); - error = level; - } - - nlevel = GetPixelIndex(x + 1, y) + (error * 8) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + 1, y, level); - nlevel = GetPixelIndex(x + 2, y) + (error * 4) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + 2, y, level); - int i; - for (i = -2; i < 3; i++) { - switch (i) { - case -2: - coeff = 2; - break; - case -1: - coeff = 4; - break; - case 0: - coeff = 8; - break; - case 1: - coeff = 4; - break; - case 2: - coeff = 2; - break; - } - nlevel = GetPixelIndex(x + i, y + 1) + (error * coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + i, y + 1, level); - } - } - } - break; - } - case 3: - { - //Stucki error diffusion (Thanks to Franco Gerevini) - int TotalCoeffSum = 42; - long error, nlevel, coeff; - BYTE level; - - for (long y = 0; y < head.biHeight; y++) { - info.nProgress = (long)(100 * y / head.biHeight); - if (info.nEscape) - break; - for (long x = 0; x < head.biWidth; x++) { - level = GetPixelIndex(x, y); - if (level > 128) { - tmp.SetPixelIndex(x, y, 1); - error = level - 255; - } else { - tmp.SetPixelIndex(x, y, 0); - error = level; - } - - nlevel = GetPixelIndex(x + 1, y) + (error * 8) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + 1, y, level); - nlevel = GetPixelIndex(x + 2, y) + (error * 4) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + 2, y, level); - int i; - for (i = -2; i < 3; i++) { - switch (i) { - case -2: - coeff = 2; - break; - case -1: - coeff = 4; - break; - case 0: - coeff = 8; - break; - case 1: - coeff = 4; - break; - case 2: - coeff = 2; - break; - } - nlevel = GetPixelIndex(x + i, y + 1) + (error * coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + i, y + 1, level); - } - for (i = -2; i < 3; i++) { - switch (i) { - case -2: - coeff = 1; - break; - case -1: - coeff = 2; - break; - case 0: - coeff = 4; - break; - case 1: - coeff = 2; - break; - case 2: - coeff = 1; - break; - } - nlevel = GetPixelIndex(x + i, y + 2) + (error * coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + i, y + 2, level); - } - } - } - break; - } - case 4: - { - //Jarvis, Judice and Ninke error diffusion (Thanks to Franco Gerevini) - int TotalCoeffSum = 48; - long error, nlevel, coeff; - BYTE level; - - for (long y = 0; y < head.biHeight; y++) { - info.nProgress = (long)(100 * y / head.biHeight); - if (info.nEscape) - break; - for (long x = 0; x < head.biWidth; x++) { - level = GetPixelIndex(x, y); - if (level > 128) { - tmp.SetPixelIndex(x, y, 1); - error = level - 255; - } else { - tmp.SetPixelIndex(x, y, 0); - error = level; - } - - nlevel = GetPixelIndex(x + 1, y) + (error * 7) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + 1, y, level); - nlevel = GetPixelIndex(x + 2, y) + (error * 5) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + 2, y, level); - int i; - for (i = -2; i < 3; i++) { - switch (i) { - case -2: - coeff = 3; - break; - case -1: - coeff = 5; - break; - case 0: - coeff = 7; - break; - case 1: - coeff = 5; - break; - case 2: - coeff = 3; - break; - } - nlevel = GetPixelIndex(x + i, y + 1) + (error * coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + i, y + 1, level); - } - for (i = -2; i < 3; i++) { - switch (i) { - case -2: - coeff = 1; - break; - case -1: - coeff = 3; - break; - case 0: - coeff = 5; - break; - case 1: - coeff = 3; - break; - case 2: - coeff = 1; - break; - } - nlevel = GetPixelIndex(x + i, y + 2) + (error * coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + i, y + 2, level); - } - } - } - break; - } - case 5: - { - //Sierra error diffusion (Thanks to Franco Gerevini) - int TotalCoeffSum = 32; - long error, nlevel, coeff; - BYTE level; - - for (long y = 0; y < head.biHeight; y++) { - info.nProgress = (long)(100 * y / head.biHeight); - if (info.nEscape) - break; - for (long x = 0; x < head.biWidth; x++) { - level = GetPixelIndex(x, y); - if (level > 128) { - tmp.SetPixelIndex(x, y, 1); - error = level - 255; - } else { - tmp.SetPixelIndex(x, y, 0); - error = level; - } - - nlevel = GetPixelIndex(x + 1, y) + (error * 5) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + 1, y, level); - nlevel = GetPixelIndex(x + 2, y) + (error * 3) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + 2, y, level); - int i; - for (i = -2; i < 3; i++) { - switch (i) { - case -2: - coeff = 2; - break; - case -1: - coeff = 4; - break; - case 0: - coeff = 5; - break; - case 1: - coeff = 4; - break; - case 2: - coeff = 2; - break; - } - nlevel = GetPixelIndex(x + i, y + 1) + (error * coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + i, y + 1, level); - } - for (i = -1; i < 2; i++) { - switch (i) { - case -1: - coeff = 2; - break; - case 0: - coeff = 3; - break; - case 1: - coeff = 2; - break; - } - nlevel = GetPixelIndex(x + i, y + 2) + (error * coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(x + i, y + 2, level); - } - } - } - break; - } - case 6: - { - //Stevenson and Arce error diffusion (Thanks to Franco Gerevini) - int TotalCoeffSum = 200; - long error, nlevel; - BYTE level; - - for (long y = 0; y < head.biHeight; y++) { - info.nProgress = (long)(100 * y / head.biHeight); - if (info.nEscape) - break; - for (long x = 0; x < head.biWidth; x++) { - level = GetPixelIndex(x, y); - if (level > 128) { - tmp.SetPixelIndex(x, y, 1); - error = level - 255; - } else { - tmp.SetPixelIndex(x, y, 0); - error = level; - } - - int tmp_index_x = x + 2; - int tmp_index_y = y; - int tmp_coeff = 32; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x - 3; - tmp_index_y = y + 1; - tmp_coeff = 12; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x - 1; - tmp_coeff = 26; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x + 1; - tmp_coeff = 30; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x + 3; - tmp_coeff = 16; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x - 2; - tmp_index_y = y + 2; - tmp_coeff = 12; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x; - tmp_coeff = 26; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x + 2; - tmp_coeff = 12; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x - 3; - tmp_index_y = y + 2; - tmp_coeff = 5; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x - 1; - tmp_coeff = 12; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x + 1; - tmp_coeff = 12; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - - tmp_index_x = x + 3; - tmp_coeff = 5; - nlevel = GetPixelIndex(tmp_index_x, tmp_index_y) + (error * tmp_coeff) / TotalCoeffSum; - level = (BYTE)min(255, max(0, (int)nlevel)); - SetPixelIndex(tmp_index_x, tmp_index_y, level); - } - } - break; - } - case 7: - { - // Bayer ordered dither - int order = 4; - //create Bayer matrix - if (order>4) order = 4; - int size = (1 << (2*order)); - BYTE* Bmatrix = (BYTE*) malloc(size * sizeof(BYTE)); - for(int i = 0; i < size; i++) { - int n = order; - int x = i / n; - int y = i % n; - int dither = 0; - while (n-- > 0){ - dither = (((dither<<1)|((x&1) ^ (y&1)))<<1) | (y&1); - x >>= 1; - y >>= 1; - } - Bmatrix[i] = dither; - } - - int scale = max(0,(8-2*order)); - int level; - for (long y=0;y> scale; - if(level > Bmatrix[ (x % order) + order * (y % order) ]){ - tmp.SetPixelIndex(x,y,1); - } else { - tmp.SetPixelIndex(x,y,0); - } - } - } - - free(Bmatrix); - - break; - } - default: - { - // Floyd-Steinberg error diffusion (Thanks to Steve McMahon) - long error,nlevel,coeff; - BYTE level; - - for (long y=0;y 128){ - tmp.SetPixelIndex(x,y,1); - error = level-255; - } else { - tmp.SetPixelIndex(x,y,0); - error = level; - } - - nlevel = GetPixelIndex(x+1,y) + (error * 7)/16; - level = (BYTE)min(255,max(0,(int)nlevel)); - SetPixelIndex(x+1,y,level); - for(int i=-1; i<2; i++){ - switch(i){ - case -1: - coeff=3; break; - case 0: - coeff=5; break; - case 1: - coeff=1; break; - } - nlevel = GetPixelIndex(x+i,y+1) + (error * coeff)/16; - level = (BYTE)min(255,max(0,(int)nlevel)); - SetPixelIndex(x+i,y+1,level); - } - } - } - } - } - - tmp.SetPaletteColor(0,0,0,0); - tmp.SetPaletteColor(1,255,255,255); - Transfer(tmp); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * CropRotatedRectangle - * \param topx,topy : topmost and leftmost point of the rectangle - (topmost, and if there are 2 topmost points, the left one) - * \param width : size of the right hand side of rect, from (topx,topy) roundwalking clockwise - * \param height : size of the left hand side of rect, from (topx,topy) roundwalking clockwise - * \param angle : angle of the right hand side of rect, from (topx,topy) - * \param iDst : pointer to destination image (if 0, this image is modified) - * \author [VATI] - */ -bool CxImage::CropRotatedRectangle( long topx, long topy, long width, long height, float angle, CxImage* iDst) -{ - if (!pDib) return false; - - - long startx,starty,endx,endy; - double cos_angle = cos(angle/*/57.295779513082320877*/); - double sin_angle = sin(angle/*/57.295779513082320877*/); - - // if there is nothing special, call the original Crop(): - if ( fabs(angle)<0.0002 ) - return Crop( topx, topy, topx+width, topy+height, iDst); - - startx = min(topx, topx - (long)(sin_angle*(double)height)); - endx = topx + (long)(cos_angle*(double)width); - endy = topy + (long)(cos_angle*(double)height + sin_angle*(double)width); - // check: corners of the rectangle must be inside - if ( IsInside( startx, topy )==false || - IsInside( endx, endy ) == false ) - return false; - - // first crop to bounding rectangle - CxImage tmp(*this,false/*pSelection!=0*/,true,true); - tmp.Copy(*this, true, false, true); - if (!tmp.IsValid()) return false; - if ( false == tmp.Crop( startx, topy, endx, endy ) ) - return false; - - // the midpoint of the image now became the same as the midpoint of the rectangle - // rotate new image with minus angle amount - if ( false == tmp.Rotate( (float)(-angle*57.295779513082320877) ) ) // Rotate expects angle in degrees - return false; - - // crop rotated image to the original selection rectangle - endx = (tmp.head.biWidth+width)/2; - startx = (tmp.head.biWidth-width)/2; - starty = (tmp.head.biHeight+height)/2; - endy = (tmp.head.biHeight-height)/2; - if ( false == tmp.Crop( startx, starty, endx, endy ) ) - return false; - - if (iDst) iDst->Transfer(tmp); - else Transfer(tmp); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::Crop(const RECT& rect, CxImage* iDst) -{ - return Crop(rect.left, rect.top, rect.right, rect.bottom, iDst); -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::Crop(long left, long top, long right, long bottom, CxImage* iDst) -{ - if (!pDib) return false; - - long startx = max(0L,min(left,head.biWidth)); - long endx = max(0L,min(right,head.biWidth)); - long starty = head.biHeight - max(0L,min(top,head.biHeight)); - long endy = head.biHeight - max(0L,min(bottom,head.biHeight)); - - if (startx==endx || starty==endy) return false; - - if (startx>endx) {long tmp=startx; startx=endx; endx=tmp;} - if (starty>endy) {long tmp=starty; starty=endy; endy=tmp;} - - CxImage tmp(endx-startx,endy-starty,head.biBitCount,info.dwType); - if (!tmp.IsValid()) return false; - tmp.SetPalette(GetPalette(),head.biClrUsed); - tmp.info.nBkgndIndex = info.nBkgndIndex; - tmp.info.nBkgndColor = info.nBkgndColor; - - switch (head.biBitCount) { - case 1: - case 4: - { - for(long y=starty, yd=0; y - for(long x=startx, xd=0; x> 3; - BYTE* pDest = tmp.info.pImage; - BYTE* pSrc = info.pImage + starty * info.dwEffWidth + (startx*head.biBitCount >> 3); - for(long y=starty; y - memcpy(pDest,pSrc,linelen); - pDest+=tmp.info.dwEffWidth; - pSrc+=info.dwEffWidth; - } - } - } - -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()){ // - tmp.AlphaCreate(); - if (!tmp.AlphaIsValid()) return false; - BYTE* pDest = tmp.pAlpha; - BYTE* pSrc = pAlpha + startx + starty*head.biWidth; - for (long y=starty; yTransfer(tmp); - else Transfer(tmp); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * \param xgain, ygain : can be from 0 to 1. - * \param xpivot, ypivot : is the center of the transformation. - * \param bEnableInterpolation : if true, enables bilinear interpolation. - * \return true if everything is ok - */ -bool CxImage::Skew(float xgain, float ygain, long xpivot, long ypivot, bool bEnableInterpolation) -{ - if (!pDib) return false; - float nx,ny; - - CxImage tmp(*this,pSelection!=0,true,true); - if (!tmp.IsValid()) return false; - - long xmin,xmax,ymin,ymax; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - for(long y=ymin; y top) || (x < left) || (x > right)) { - tmp.SetPixelIndex(x,y, pixel); - } else { - tmp.SetPixelIndex(x,y,GetPixelIndex(x-left,y-bottom)); - } - } - } - break; - } - case 8: - case 24: - { - if (head.biBitCount == 8) { - BYTE pixel = tmp.GetNearestIndex( canvascolor); - memset(tmp.info.pImage, pixel, + (tmp.info.dwEffWidth * newHeight)); - } else { - for (long y = 0; y < newHeight; ++y) { - BYTE *pDest = tmp.info.pImage + (y * tmp.info.dwEffWidth); - for (long x = 0; x < newWidth; ++x) { - *pDest++ = canvascolor.rgbBlue; - *pDest++ = canvascolor.rgbGreen; - *pDest++ = canvascolor.rgbRed; - } - } - } - - BYTE* pDest = tmp.info.pImage + (tmp.info.dwEffWidth * bottom) + (left*(head.biBitCount >> 3)); - BYTE* pSrc = info.pImage; - for(long y=bottom; y <= top; y++){ - info.nProgress = (long)(100*y/(1 + top - bottom)); - memcpy(pDest,pSrc,(head.biBitCount >> 3) * (right - left + 1)); - pDest+=tmp.info.dwEffWidth; - pSrc+=info.dwEffWidth; - } - } - } - //select the destination - if (iDst) iDst->Transfer(tmp); - else Transfer(tmp); - - return true; -} -//////////////////////////////////////////////////////////////////////////////// -bool CxImage::Expand(long newx, long newy, RGBQUAD canvascolor, CxImage* iDst) -{ - //thanks to - - if (!pDib) return false; - - if ((newx < head.biWidth) || (newy < head.biHeight)) return false; - - int nAddLeft = (newx - head.biWidth) / 2; - int nAddTop = (newy - head.biHeight) / 2; - - return Expand(nAddLeft, nAddTop, newx - (head.biWidth + nAddLeft), newy - (head.biHeight + nAddTop), canvascolor, iDst); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Resamples the image with the correct aspect ratio, and fills the borders. - * \param newx, newy = thumbnail size. - * \param canvascolor = border color. - * \param iDst = pointer to destination image (if it's 0, this image is modified). - * \return true if everything is ok. - * \author [Colin Urquhart] - */ -bool CxImage::Thumbnail(long newx, long newy, RGBQUAD canvascolor, CxImage* iDst) -{ - if (!pDib) return false; - - if ((newx <= 0) || (newy <= 0)) return false; - - CxImage tmp(*this); - if (!tmp.IsValid()) return false; - - // determine whether we need to shrink the image - if ((head.biWidth > newx) || (head.biHeight > newy)) { - float fScale; - float fAspect = (float) newx / (float) newy; - if (fAspect * head.biHeight > head.biWidth) { - fScale = (float) newy / head.biHeight; - } else { - fScale = (float) newx / head.biWidth; - } - tmp.Resample((long) (fScale * head.biWidth), (long) (fScale * head.biHeight), 0); - } - - // expand the frame - tmp.Expand(newx, newy, canvascolor, iDst); - - //select the destination - if (iDst) iDst->Transfer(tmp); - else Transfer(tmp); - return true; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Perform circle_based transformations. - * \param type - for different transformations - * - 0 for normal (proturberant) FishEye - * - 1 for reverse (concave) FishEye - * - 2 for Swirle - * - 3 for Cilinder mirror - * - 4 for bathroom - * - * \param rmax - effect radius. If 0, the whole image is processed - * \param Koeff - only for swirle - * \author Arkadiy Olovyannikov ark(at)msun(dot)ru - */ -bool CxImage::CircleTransform(int type,long rmax,float Koeff) -{ - if (!pDib) return false; - - long nx,ny; - double angle,radius,rnew; - - CxImage tmp(*this,pSelection!=0,true,true); - if (!tmp.IsValid()) return false; - - long xmin,xmax,ymin,ymax,xmid,ymid; - if (pSelection){ - xmin = info.rSelectionBox.left; xmax = info.rSelectionBox.right; - ymin = info.rSelectionBox.bottom; ymax = info.rSelectionBox.top; - } else { - xmin = ymin = 0; - xmax = head.biWidth; ymax=head.biHeight; - } - - xmid = (long) (tmp.GetWidth()/2); - ymid = (long) (tmp.GetHeight()/2); - - if (!rmax) rmax=(long)sqrt((float)((xmid-xmin)*(xmid-xmin)+(ymid-ymin)*(ymid-ymin))); - if (Koeff==0.0f) Koeff=1.0f; - - for(long y=ymin; yhead.biWidth || newy>head.biHeight) { - //let me repeat... this method can't enlarge image - strcpy(info.szLastError,"QIShrink can't enlarge image"); - return false; - } - - if (newx==head.biWidth && newy==head.biHeight) { - //image already correct size (just copy and return) - if (iDst) iDst->Copy(*this); - return true; - }//if - - //create temporary destination image - CxImage newImage; - newImage.CopyInfo(*this); - newImage.Create(newx,newy,head.biBitCount,GetType()); - newImage.SetPalette(GetPalette()); - if (!newImage.IsValid()) return false; - - //and alpha channel if required -#if CXIMAGE_SUPPORT_ALPHA - if (AlphaIsValid()) newImage.AlphaCreate(); -#endif - - const int oldx = head.biWidth; - const int oldy = head.biHeight; - - int accuCellSize = 4; -#if CXIMAGE_SUPPORT_ALPHA - BYTE *alphaPtr; - if (AlphaIsValid()) accuCellSize=5; -#endif - - unsigned int *accu = new unsigned int[newx*accuCellSize]; //array for suming pixels... one pixel for every destination column - unsigned int *accuPtr; //pointer for walking through accu - //each cell consists of blue, red, green component and count of pixels summed in this cell - memset(accu, 0, newx * accuCellSize * sizeof(unsigned int)); //clear accu - - if (!IsIndexed()) { - //RGB24 version with pointers - BYTE *destPtr, *srcPtr, *destPtrS, *srcPtrS; //destination and source pixel, and beginnings of current row - srcPtrS=(BYTE*)BlindGetPixelPointer(0,0); - destPtrS=(BYTE*)newImage.BlindGetPixelPointer(0,0); - int ex=0, ey=0; //ex and ey replace division... - int dy=0; - //(we just add pixels, until by adding newx or newy we get a number greater than old size... then - // it's time to move to next pixel) - - for(int y=0; yoldx) { //when we reach oldx, it's time to move to new slot - accuPtr += accuCellSize; - ex -= oldx; //(substract oldx from ex and resume from there on) - }//if (ex overflow) - }//for x - - if (ey>=oldy) { //now when this happens - ey -= oldy; //it's time to move to new destination row - destPtr = destPtrS; //reset pointers to proper initial values - accuPtr = accu; -#if CXIMAGE_SUPPORT_ALPHA - alphaPtr = newImage.AlphaGetPointer(0, dy++); -#endif - for (int k=0; koldx) { //when we reach oldx, it's time to move to new slot - accuPtr += accuCellSize; - ex -= oldx; //(substract oldx from ex and resume from there on) - }//if (ex overflow) - }//for x - - if (ey>=oldy) { //now when this happens - ey -= oldy; //it's time to move to new destination row - accuPtr = accu; - for (int dx=0; dxTransfer(newImage); - else - Transfer(newImage); - return true; - -} - -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_TRANSFORMATION diff --git a/src/win32/dependencies/cximage/ximawbmp.cpp b/src/win32/dependencies/cximage/ximawbmp.cpp deleted file mode 100644 index 0cb3f56c..00000000 --- a/src/win32/dependencies/cximage/ximawbmp.cpp +++ /dev/null @@ -1,85 +0,0 @@ -/* - * File: ximawbmp.cpp - * Purpose: Platform Independent WBMP Image Class Loader and Writer - * 12/Jul/2002 Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximawbmp.h" - -#if CXIMAGE_SUPPORT_WBMP - -#include "ximaiter.h" - -//////////////////////////////////////////////////////////////////////////////// -bool CxImageWBMP::Decode(CxFile *hFile) -{ - if (hFile == NULL) return false; - - WBMPHEADER wbmpHead; - - try - { - if (hFile->Read(&wbmpHead,sizeof(wbmpHead),1)==0) - throw "Not a WBMP"; - - if (wbmpHead.Type != 0) - throw "Unsupported WBMP type"; - - if (wbmpHead.ImageHeight==0 || wbmpHead.ImageWidth==0) - throw "Corrupted WBMP"; - - Create(wbmpHead.ImageWidth, wbmpHead.ImageHeight, 1, CXIMAGE_FORMAT_WBMP); - if (!IsValid()) throw "WBMP Create failed"; - SetGrayPalette(); - - int linewidth=(wbmpHead.ImageWidth+7)/8; - CImageIterator iter(this); - iter.Upset(); - for (int y=0; y < wbmpHead.ImageHeight; y++){ - hFile->Read(iter.GetRow(),linewidth,1); - iter.PrevRow(); - } - - } catch (char *message) { - strncpy(info.szLastError,message,255); - return FALSE; - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -bool CxImageWBMP::Encode(CxFile * hFile) -{ - if (EncodeSafeCheck(hFile)) return false; - - //check format limits - if ((head.biWidth>255)||(head.biHeight>255)||(head.biBitCount!=1)){ - strcpy(info.szLastError,"Can't save this image as WBMP"); - return false; - } - - WBMPHEADER wbmpHead; - wbmpHead.Type=0; - wbmpHead.FixHeader=0; - wbmpHead.ImageWidth=(BYTE)head.biWidth; - wbmpHead.ImageHeight=(BYTE)head.biHeight; - - // Write the file header - hFile->Write(&wbmpHead,sizeof(wbmpHead),1); - // Write the pixels - int linewidth=(wbmpHead.ImageWidth+7)/8; - CImageIterator iter(this); - iter.Upset(); - for (int y=0; y < wbmpHead.ImageHeight; y++){ - hFile->Write(iter.GetRow(),linewidth,1); - iter.PrevRow(); - } - return true; -} -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_ENCODE -//////////////////////////////////////////////////////////////////////////////// -#endif // CXIMAGE_SUPPORT_WBMP - diff --git a/src/win32/dependencies/cximage/ximawbmp.h b/src/win32/dependencies/cximage/ximawbmp.h deleted file mode 100644 index 5b688c64..00000000 --- a/src/win32/dependencies/cximage/ximawbmp.h +++ /dev/null @@ -1,44 +0,0 @@ -/* - * File: ximawbmp.h - * Purpose: WBMP Image Class Loader and Writer - */ -/* ========================================================== - * CxImageWBMP (c) 12/Jul/2002 Davide Pizzolato - www.xdp.it - * For conditions of distribution and use, see copyright notice in ximage.h - * ========================================================== - */ -#if !defined(__ximaWBMP_h) -#define __ximaWBMP_h - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_WBMP - -class CxImageWBMP: public CxImage -{ -#pragma pack(1) -typedef struct tagWbmpHeader -{ - BYTE Type; // 0 - BYTE FixHeader; // 0 - BYTE ImageWidth; // Image Width - BYTE ImageHeight; // Image Height -} WBMPHEADER; -#pragma pack() -public: - CxImageWBMP(): CxImage(CXIMAGE_FORMAT_WBMP) {} - -// bool Load(const char * imageFileName){ return CxImage::Load(imageFileName,CXIMAGE_FORMAT_WBMP);} -// bool Save(const char * imageFileName){ return CxImage::Save(imageFileName,CXIMAGE_FORMAT_WBMP);} - bool Decode(CxFile * hFile); - bool Decode(FILE *hFile) { CxIOFile file(hFile); return Decode(&file); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE -}; - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximawmf.cpp b/src/win32/dependencies/cximage/ximawmf.cpp deleted file mode 100644 index 3c50850f..00000000 --- a/src/win32/dependencies/cximage/ximawmf.cpp +++ /dev/null @@ -1,458 +0,0 @@ -/* -********************************************************************* - * File: ximawmf.cpp - * Purpose: Windows Metafile Class Loader and Writer - * Author: Volker Horch - vhorch@gmx.de - * created: 13-Jun-2002 - * - * Note: If the code below works, i wrote it. - * If it doesn't work, i don't know who wrote it. -********************************************************************* - */ - -/* -********************************************************************* - Note by Author: -********************************************************************* - - Metafile Formats: - ================= - - There are 2 kinds of Windows Metafiles: - - Standard Windows Metafile - - Placeable Windows Metafile - - A StandardWindows Metafile looks like: - - Metafile Header (MEATAHEADER) - - Metafile Records - - A Placeable Metafile looks like: - - Aldus Header (METAFILEHEADER) - - Metafile Header (METAHEADER) - - Metafile Records - - The "Metafile Header" and the "Metafile Records" are the same - for both formats. However, the Standard Metafile does not contain any - information about the original dimensions or x/y ratio of the Metafile. - - I decided, to allow only placeable Metafiles here. If you also want to - enable Standard Metafiles, you will have to guess the dimensions of - the image. - -********************************************************************* - Limitations: see ximawmf.h - you may configure some stuff there -********************************************************************* -*/ - -#include "ximawmf.h" - -#if CXIMAGE_SUPPORT_WMF && CXIMAGE_SUPPORT_WINDOWS - -///////////////////////////////////////////////////////////////////// -bool CxImageWMF::Decode(CxFile *hFile, long nForceWidth, long nForceHeight) -{ - if (hFile == NULL) return false; - - HENHMETAFILE hMeta; - HDC hDC; - int cx,cy; - - //save the current position of the file - long pos = hFile->Tell(); - - // Read the Metafile and convert to an Enhanced Metafile - METAFILEHEADER mfh; - hMeta = ConvertWmfFiletoEmf(hFile, &mfh); - if (hMeta) { // ok, it's a WMF - -///////////////////////////////////////////////////////////////////// -// We use the original WMF size information, because conversion to -// EMF adjusts the Metafile to Full Screen or does not set rclBounds at all -// ENHMETAHEADER emh; -// UINT uRet; -// uRet = GetEnhMetaFileHeader(hMeta, // handle of enhanced metafile -// sizeof(ENHMETAHEADER), // size of buffer, in bytes -// &emh); // address of buffer to receive data -// if (!uRet){ -// DeleteEnhMetaFile(hMeta); -// return false; -// } -// // calculate size -// cx = emh.rclBounds.right - emh.rclBounds.left; -// cy = emh.rclBounds.bottom - emh.rclBounds.top; -///////////////////////////////////////////////////////////////////// - - // calculate size - // scale the metafile (pixels/inch of metafile => pixels/inch of display) - // mfh.inch already checked to be <> 0 - - hDC = ::GetDC(0); - int cx1 = ::GetDeviceCaps(hDC, LOGPIXELSX); - int cy1 = ::GetDeviceCaps(hDC, LOGPIXELSY); - ::ReleaseDC(0, hDC); - - cx = (mfh.bbox.right - mfh.bbox.left) * cx1 / mfh.inch; - cy = (mfh.bbox.bottom - mfh.bbox.top) * cy1 / mfh.inch; - - } else { // maybe it's an EMF... - - hFile->Seek(pos,SEEK_SET); - - ENHMETAHEADER emh; - hMeta = ConvertEmfFiletoEmf(hFile, &emh); - - if (!hMeta){ - strcpy(info.szLastError,"corrupted WMF"); - return false; // definitively give up - } - // ok, it's an EMF - // calculate size - cx = emh.rclBounds.right - emh.rclBounds.left; - cy = emh.rclBounds.bottom - emh.rclBounds.top; - } - - if (info.nEscape) { // Check if cancelled - DeleteEnhMetaFile(hMeta); - strcpy(info.szLastError,"Cancelled"); - return false; - } - - if (!cx || !cy) { - DeleteEnhMetaFile(hMeta); - strcpy(info.szLastError,"empty WMF"); - return false; - } - - if (nForceWidth) cx=nForceWidth; - if (nForceHeight) cy=nForceHeight; - ShrinkMetafile(cx, cy); // !! Otherwise Bitmap may have bombastic size - - HDC hDC0 = GetDC(0); // DC of screen - HBITMAP hBitmap = CreateCompatibleBitmap(hDC0, cx, cy); // has # colors of display - hDC = CreateCompatibleDC(hDC0); // memory dc compatible with screen - ReleaseDC(0, hDC0); // don't need anymore. get rid of it. - - if (hDC){ - if (hBitmap){ - RECT rc = {0,0,cx,cy}; - int bpp = ::GetDeviceCaps(hDC, BITSPIXEL); - - HBITMAP hBitmapOld = (HBITMAP)SelectObject(hDC, hBitmap); - - // clear out the entire bitmap with windows background - // because the MetaFile may not contain background information - DWORD dwBack = XMF_COLOR_BACK; -#if XMF_SUPPORT_TRANSPARENCY - if (bpp == 24) dwBack = XMF_COLOR_TRANSPARENT; -#endif - DWORD OldColor = SetBkColor(hDC, dwBack); - ExtTextOut(hDC, 0, 0, ETO_OPAQUE, &rc, NULL, 0, NULL); - SetBkColor(hDC, OldColor); - - //retrieves optional palette entries from the specified enhanced metafile - PLOGPALETTE plogPal; - PBYTE pjTmp; - HPALETTE hPal; - int iEntries = GetEnhMetaFilePaletteEntries(hMeta, 0, NULL); - if (iEntries) { - if ((plogPal = (PLOGPALETTE)GlobalAlloc(GMEM_FIXED | GMEM_ZEROINIT, - sizeof(DWORD) + sizeof(PALETTEENTRY)*iEntries )) == NULL) { - DeleteObject(hBitmap); - DeleteDC(hDC); - DeleteEnhMetaFile(hMeta); - strcpy(info.szLastError,"Cancelled"); - return false; - } - - plogPal->palVersion = 0x300; - plogPal->palNumEntries = (WORD) iEntries; - pjTmp = (PBYTE) plogPal; - pjTmp += 4; - - GetEnhMetaFilePaletteEntries(hMeta, iEntries, (PPALETTEENTRY)pjTmp); - hPal = CreatePalette(plogPal); - GlobalFree(plogPal); - - SelectPalette(hDC, hPal, FALSE); - RealizePalette(hDC); - } - - // Play the Metafile into Memory DC - BOOL bRet = PlayEnhMetaFile(hDC, // handle to a device context - hMeta, // handle to an enhanced metafile - &rc); // pointer to bounding rectangle - - SelectObject(hDC, hBitmapOld); - DeleteEnhMetaFile(hMeta); // we are done with this one - - if (info.nEscape) { // Check if cancelled - DeleteObject(hBitmap); - DeleteDC(hDC); - strcpy(info.szLastError,"Cancelled"); - return false; - } - - // the Bitmap now has the image. - // Create our DIB and convert the DDB into DIB - if (!Create(cx, cy, bpp, CXIMAGE_FORMAT_WMF)) { - DeleteObject(hBitmap); - DeleteDC(hDC); - return false; - } - -#if XMF_SUPPORT_TRANSPARENCY - if (bpp == 24) { - RGBQUAD rgbTrans = { XMF_RGBQUAD_TRANSPARENT }; - SetTransColor(rgbTrans); - } -#endif - // We're finally ready to get the DIB. Call the driver and let - // it party on our bitmap. It will fill in the color table, - // and bitmap bits of our global memory block. - bRet = GetDIBits(hDC, hBitmap, 0, - (UINT)cy, GetBits(), (LPBITMAPINFO)pDib, DIB_RGB_COLORS); - - DeleteObject(hBitmap); - DeleteDC(hDC); - - return (bRet!=0); - } else { - DeleteDC(hDC); - } - } else { - if (hBitmap) DeleteObject(hBitmap); - } - - DeleteEnhMetaFile(hMeta); - - return false; -} - -/********************************************************************** - Function: CheckMetafileHeader - Purpose: Check if the Metafileheader of a file is valid -**********************************************************************/ -BOOL CxImageWMF::CheckMetafileHeader(METAFILEHEADER *metafileheader) -{ - WORD *pw; - WORD cs; - int i; - - // check magic # - if (metafileheader->key != 0x9ac6cdd7L) return false; - - // test checksum of header - pw = (WORD *)metafileheader; - cs = *pw; - pw++; - for (i = 0; i < 9; i++) { - cs ^= *pw; - pw++; - } - - if (cs != metafileheader->checksum) return false; - - // check resolution - if ((metafileheader->inch <= 0) || (metafileheader->inch > 2540)) return false; - - return true; -} - -/********************************************************************** - Function: ConvertWmfFiletoEmf - Purpose: Converts a Windows Metafile into an Enhanced Metafile -**********************************************************************/ -HENHMETAFILE CxImageWMF::ConvertWmfFiletoEmf(CxFile *fp, METAFILEHEADER *metafileheader) -{ - HENHMETAFILE hMeta; - long lenFile; - long len; - BYTE *p; - METAHEADER mfHeader; - DWORD seekpos; - - hMeta = 0; - - // get length of the file - lenFile = fp->Size(); - - // a placeable metafile starts with a METAFILEHEADER - // read it and check metafileheader - len = fp->Read(metafileheader, 1, sizeof(METAFILEHEADER)); - if (len < sizeof(METAFILEHEADER)) return (hMeta); - - if (CheckMetafileHeader(metafileheader)) { - // This is a placeable metafile - // Convert the placeable format into something that can - // be used with GDI metafile functions - seekpos = sizeof(METAFILEHEADER); - } else { - // Not a placeable wmf. A windows metafile? - // at least not scaleable. - // we could try to convert, but would loose ratio. don't allow this - return (hMeta); - - //metafileheader->bbox.right = ?; - //metafileheader->bbox.left = ?; - //metafileheader->bbox.bottom = ?; - //metafileheader->bbox.top = ?; - //metafileheader->inch = ?; - // - //seekpos = 0; - // fp->Seek(0, SEEK_SET); // rewind - } - - // At this point we have a metaheader regardless of whether - // the metafile was a windows metafile or a placeable metafile - // so check to see if it is valid. There is really no good - // way to do this so just make sure that the mtType is either - // 1 or 2 (memory or disk file) - // in addition we compare the length of the METAHEADER against - // the length of the file. if filelength < len => no Metafile - - len = fp->Read(&mfHeader, 1, sizeof(METAHEADER)); - if (len < sizeof(METAHEADER)) return (hMeta); - - if ((mfHeader.mtType != 1) && (mfHeader.mtType != 2)) return (hMeta); - - // Length in Bytes from METAHEADER - len = mfHeader.mtSize * 2; - if (len > lenFile) return (hMeta); - - // Allocate memory for the metafile bits - p = (BYTE *)malloc(len); - if (!p) return (hMeta); - - // seek back to METAHEADER and read all the stuff at once - fp->Seek(seekpos, SEEK_SET); - lenFile = fp->Read(p, 1, len); - if (lenFile != len) { - free(p); - return (hMeta); - } - - // the following (commented code) works, but adjusts rclBound of the - // Enhanced Metafile to full screen. - // the METAFILEHEADER from above is needed to scale the image - -// hMeta = SetWinMetaFileBits(len, p, NULL, NULL); - - // scale the metafile (pixels/inch of metafile => pixels/inch of display) - - METAFILEPICT mfp; - int cx1, cy1; - HDC hDC; - - hDC = ::GetDC(0); - cx1 = ::GetDeviceCaps(hDC, LOGPIXELSX); - cy1 = ::GetDeviceCaps(hDC, LOGPIXELSY); - - memset(&mfp, 0, sizeof(mfp)); - - mfp.mm = MM_ANISOTROPIC; - mfp.xExt = (metafileheader->bbox.right - metafileheader->bbox.left) * cx1 / metafileheader->inch; - mfp.yExt = (metafileheader->bbox.bottom - metafileheader->bbox.top) * cy1 / metafileheader->inch; - mfp.hMF = 0; - - // in MM_ANISOTROPIC mode xExt and yExt are in MM_HIENGLISH - // MM_HIENGLISH means: Each logical unit is converted to 0.001 inch - //mfp.xExt *= 1000; - //mfp.yExt *= 1000; - // ???? - //int k = 332800 / ::GetSystemMetrics(SM_CXSCREEN); - //mfp.xExt *= k; mfp.yExt *= k; - - // fix for Win9x - while ((mfp.xExt < 6554) && (mfp.yExt < 6554)) - { - mfp.xExt *= 10; - mfp.yExt *= 10; - } - - hMeta = SetWinMetaFileBits(len, p, hDC, &mfp); - - if (!hMeta){ //try 2nd conversion using a different mapping - mfp.mm = MM_TEXT; - hMeta = SetWinMetaFileBits(len, p, hDC, &mfp); - } - - ::ReleaseDC(0, hDC); - - // Free Memory - free(p); - - return (hMeta); -} -///////////////////////////////////////////////////////////////////// -HENHMETAFILE CxImageWMF::ConvertEmfFiletoEmf(CxFile *pFile, ENHMETAHEADER *pemfh) -{ - HENHMETAFILE hMeta; - long iLen = pFile->Size(); - - BYTE* pBuff = (BYTE *)malloc(iLen); - if (!pBuff) return (FALSE); - - // Read the Enhanced Metafile - long iLenRead = pFile->Read(pBuff, 1, iLen); - if (iLenRead != iLen) { - free(pBuff); - return (FALSE); - } - - // Make it a Memory Metafile - hMeta = SetEnhMetaFileBits(iLen, pBuff); - - free(pBuff); // finished with this one - - if (!hMeta) return (FALSE); // oops. - - // Get the Enhanced Metafile Header - UINT uRet = GetEnhMetaFileHeader(hMeta, // handle of enhanced metafile - sizeof(ENHMETAHEADER), // size of buffer, in bytes - pemfh); // address of buffer to receive data - - if (!uRet) { - DeleteEnhMetaFile(hMeta); - return (FALSE); - } - - return (hMeta); -} - - -///////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_ENCODE -///////////////////////////////////////////////////////////////////// -bool CxImageWMF::Encode(CxFile * hFile) -{ - if (hFile == NULL) return false; - strcpy(info.szLastError, "Save WMF not supported"); - return false; -} -#endif // CXIMAGE_SUPPORT_ENCODE -///////////////////////////////////////////////////////////////////// - -/********************************************************************** -Function: ShrinkMetafile -Purpose: Shrink the size of a metafile to be not larger than - the definition -**********************************************************************/ -void CxImageWMF::ShrinkMetafile(int &cx, int &cy) -{ - int xScreen = XMF_MAXSIZE_CX; - int yScreen = XMF_MAXSIZE_CY; - - if (cx > xScreen){ - cy = cy * xScreen / cx; - cx = xScreen; - } - - if (cy > yScreen){ - cx = cx * yScreen / cy; - cy = yScreen; - } -} - -#endif // CIMAGE_SUPPORT_WMF - diff --git a/src/win32/dependencies/cximage/ximawmf.h b/src/win32/dependencies/cximage/ximawmf.h deleted file mode 100644 index 75e119a0..00000000 --- a/src/win32/dependencies/cximage/ximawmf.h +++ /dev/null @@ -1,154 +0,0 @@ -/* -********************************************************************* - * File: ximawmf.h - * Purpose: Windows Metafile Class Loader and Writer - * Author: Volker Horch - vhorch@gmx.de - * created: 13-Jun-2002 -********************************************************************* - */ - -/* -********************************************************************* - Notes by Author: -********************************************************************* - - Limitations: - ============ - - a) Transparency: - - A Metafile is vector graphics, which has transparency by design. - This class always converts into a Bitmap format. Transparency is - supported, but there is no good way to find out, which parts - of the Metafile are transparent. There are two ways how we can - handle this: - - - Clear the Background of the Bitmap with the background color - you like (i have used COLOR_WINDOW) and don't support transparency. - - below #define XMF_SUPPORT_TRANSPARENCY 0 - #define XMF_COLOR_BACK RGB(Background color you like) - - - Clear the Background of the Bitmap with a very unusual color - (which one ?) and use this color as the transparent color - - below #define XMF_SUPPORT_TRANSPARENCY 1 - #define XMF_COLOR_TRANSPARENT_R ... - #define XMF_COLOR_TRANSPARENT_G ... - #define XMF_COLOR_TRANSPARENT_B ... - - b) Resolution - - Once we have converted the Metafile into a Bitmap and we zoom in - or out, the image may not look very good. If we still had the - original Metafile, zooming would produce good results always. - - c) Size - - Although the filesize of a Metafile may be very small, it might - produce a Bitmap with a bombastic size. Assume you have a Metafile - with an image size of 6000*4000, which contains just one Metafile - record ((e.g. a line from (0,0) to (6000, 4000)). The filesize - of this Metafile would be let's say 100kB. If we convert it to - a 6000*4000 Bitmap with 24 Bits/Pixes, the Bitmap would consume - about 68MB of memory. - - I have choosen, to limit the size of the Bitmap to max. - screensize, to avoid memory problems. - - If you want something else, - modify #define XMF_MAXSIZE_CX / XMF_MAXSIZE_CY below - -********************************************************************* -*/ - -#ifndef _XIMAWMF_H -#define _XIMAWMF_H - -#include "ximage.h" - -#if CXIMAGE_SUPPORT_WMF && CXIMAGE_SUPPORT_WINDOWS - -class CxImageWMF: public CxImage -{ - -#pragma pack(1) - -typedef struct tagRECT16 -{ - short int left; - short int top; - short int right; - short int bottom; -} RECT16; - -// taken from Windos 3.11 SDK Documentation (Programmer's Reference Volume 4: Resources) -typedef struct tagMETAFILEHEADER -{ - DWORD key; // always 0x9ac6cdd7 - WORD reserved1; // reserved = 0 - RECT16 bbox; // bounding rectangle in metafile units as defined in "inch" - WORD inch; // number of metafile units per inch (should be < 1440) - DWORD reserved2; // reserved = 0 - WORD checksum; // sum of the first 10 WORDS (using XOR operator) -} METAFILEHEADER; - -#pragma pack() - -public: - CxImageWMF(): CxImage(CXIMAGE_FORMAT_WMF) { } - - bool Decode(CxFile * hFile, long nForceWidth=0, long nForceHeight=0); - bool Decode(FILE *hFile, long nForceWidth=0, long nForceHeight=0) - { CxIOFile file(hFile); return Decode(&file,nForceWidth,nForceHeight); } - -#if CXIMAGE_SUPPORT_ENCODE - bool Encode(CxFile * hFile); - bool Encode(FILE *hFile) { CxIOFile file(hFile); return Encode(&file); } -#endif // CXIMAGE_SUPPORT_ENCODE - -protected: - void ShrinkMetafile(int &cx, int &cy); - BOOL CheckMetafileHeader(METAFILEHEADER *pmetafileheader); - HENHMETAFILE ConvertWmfFiletoEmf(CxFile *pFile, METAFILEHEADER *pmetafileheader); - HENHMETAFILE ConvertEmfFiletoEmf(CxFile *pFile, ENHMETAHEADER *pemfh); - -}; - -#define METAFILEKEY 0x9ac6cdd7L - -// Background color definition (if no transparency). see Notes above -#define XMF_COLOR_BACK GetSysColor(COLOR_WINDOW) -// alternatives -//#define XMF_COLOR_BACK RGB(192, 192, 192) // lite gray -//#define XMF_COLOR_BACK RGB( 0, 0, 0) // black -//#define XMF_COLOR_BACK RGB(255, 255, 255) // white - - -// transparency support. see Notes above -#define XMF_SUPPORT_TRANSPARENCY 0 -#define XMF_COLOR_TRANSPARENT_R 211 -#define XMF_COLOR_TRANSPARENT_G 121 -#define XMF_COLOR_TRANSPARENT_B 112 -// don't change -#define XMF_COLOR_TRANSPARENT RGB (XMF_COLOR_TRANSPARENT_R, \ - XMF_COLOR_TRANSPARENT_G, \ - XMF_COLOR_TRANSPARENT_B) -// don't change -#define XMF_RGBQUAD_TRANSPARENT XMF_COLOR_TRANSPARENT_B, \ - XMF_COLOR_TRANSPARENT_G, \ - XMF_COLOR_TRANSPARENT_R, \ - 0 -// max. size. see Notes above -// alternatives -//#define XMF_MAXSIZE_CX (GetSystemMetrics(SM_CXSCREEN)-10) -//#define XMF_MAXSIZE_CY (GetSystemMetrics(SM_CYSCREEN)-50) -//#define XMF_MAXSIZE_CX (2*GetSystemMetrics(SM_CXSCREEN)/3) -//#define XMF_MAXSIZE_CY (2*GetSystemMetrics(SM_CYSCREEN)/3) -#define XMF_MAXSIZE_CX 4000 -#define XMF_MAXSIZE_CY 4000 - - -#endif - -#endif diff --git a/src/win32/dependencies/cximage/ximawnd.cpp b/src/win32/dependencies/cximage/ximawnd.cpp deleted file mode 100644 index 79d4158f..00000000 --- a/src/win32/dependencies/cximage/ximawnd.cpp +++ /dev/null @@ -1,1110 +0,0 @@ -// xImaWnd.cpp : Windows functions -/* 07/08/2001 v1.00 - Davide Pizzolato - www.xdp.it - * CxImage version 5.99c 17/Oct/2004 - */ - -#include "ximage.h" - -#include "ximaiter.h" -#include "ximabmp.h" - -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_WINCE -//////////////////////////////////////////////////////////////////////////////// -long CxImage::Blt(HDC pDC, long x, long y) -{ - if((pDib==0)||(pDC==0)||(!info.bEnabled)) return 0; - - HBRUSH brImage = CreateDIBPatternBrushPt(pDib, DIB_RGB_COLORS); - HBRUSH brOld = (HBRUSH) SelectObject(pDC, brImage); - PatBlt(pDC, 0, 0, head.biWidth, head.biHeight, PATCOPY); - SelectObject(pDC, brOld); - DeleteObject(brImage); - return 1; -} -#endif //CXIMAGE_SUPPORT_WINCE -//////////////////////////////////////////////////////////////////////////////// - -//////////////////////////////////////////////////////////////////////////////// -#if CXIMAGE_SUPPORT_WINDOWS -//////////////////////////////////////////////////////////////////////////////// -/** - * Transfer the image in a global bitmap handle (clipboard copy) - */ -HANDLE CxImage::CopyToHandle() -{ - HANDLE hMem=NULL; - if (pDib){ - hMem= GlobalAlloc(GHND, GetSize()); - if (hMem){ - BYTE* pDst=(BYTE*)GlobalLock(hMem); - if (pDst){ - memcpy(pDst,pDib,GetSize()); - } - GlobalUnlock(hMem); - } - } - return hMem; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Global object (clipboard paste) constructor - * \param hMem: source bitmap object, the clipboard format must be CF_DIB - * \return true if everything is ok - */ -bool CxImage::CreateFromHANDLE(HANDLE hMem) -{ - if (!Destroy()) - return false; - - DWORD dwSize = GlobalSize(hMem); - if (!dwSize) return false; - - BYTE *lpVoid; //pointer to the bitmap - lpVoid = (BYTE *)GlobalLock(hMem); - BITMAPINFOHEADER *pHead; //pointer to the bitmap header - pHead = (BITMAPINFOHEADER *)lpVoid; - if (lpVoid){ - - //CxMemFile hFile(lpVoid,dwSize); - - //copy the bitmap header - memcpy(&head,pHead,sizeof(BITMAPINFOHEADER)); - //create the image - if(!Create(head.biWidth,head.biHeight,head.biBitCount)){ - GlobalUnlock(lpVoid); - return false; - } - //preserve DPI - if (head.biXPelsPerMeter) SetXDPI((long)floor(head.biXPelsPerMeter * 254.0 / 10000.0 + 0.5)); else SetXDPI(96); - if (head.biYPelsPerMeter) SetYDPI((long)floor(head.biYPelsPerMeter * 254.0 / 10000.0 + 0.5)); else SetYDPI(96); - - /*//copy the pixels (old way) - if((pHead->biCompression != BI_RGB) || (pHead->biBitCount == 32)){ // - // BITFIELD case - // set the internal header in the dib - memcpy(pDib,&head,sizeof(head)); - // get the bitfield masks - DWORD bf[3]; - memcpy(bf,lpVoid+pHead->biSize,12); - // transform into RGB - Bitfield2RGB(lpVoid+pHead->biSize+12,(WORD)bf[0],(WORD)bf[1],(WORD)bf[2],(BYTE)pHead->biBitCount); - } else { //normal bitmap - memcpy(pDib,lpVoid,GetSize()); - }*/ - - // - // fill in color map - bool bIsOldBmp = (head.biSize == sizeof(BITMAPCOREHEADER)); - RGBQUAD *pRgb = GetPalette(); - if (pRgb) { - // number of colors to fill in - int nColors = DibNumColors(pHead); - if (bIsOldBmp) { - /* get pointer to BITMAPCOREINFO (old style 1.x) */ - LPBITMAPCOREINFO lpbmc = (LPBITMAPCOREINFO)lpVoid; - for (int i = nColors - 1; i >= 0; i--) { - pRgb[i].rgbRed = lpbmc->bmciColors[i].rgbtRed; - pRgb[i].rgbGreen = lpbmc->bmciColors[i].rgbtGreen; - pRgb[i].rgbBlue = lpbmc->bmciColors[i].rgbtBlue; - pRgb[i].rgbReserved = (BYTE)0; - } - } else { - /* get pointer to BITMAPINFO (new style 3.x) */ - LPBITMAPINFO lpbmi = (LPBITMAPINFO)lpVoid; - for (int i = nColors - 1; i >= 0; i--) { - pRgb[i].rgbRed = lpbmi->bmiColors[i].rgbRed; - pRgb[i].rgbGreen = lpbmi->bmiColors[i].rgbGreen; - pRgb[i].rgbBlue = lpbmi->bmiColors[i].rgbBlue; - pRgb[i].rgbReserved = (BYTE)0; - } - } - } - - // - DWORD dwCompression = pHead->biCompression; - // compressed bitmap ? - if(dwCompression!=BI_RGB || pHead->biBitCount==32) { - // get the bitmap bits - LPSTR lpDIBBits = (LPSTR)((BYTE*)pHead + *(DWORD*)pHead + (WORD)(GetNumColors() * sizeof(RGBQUAD))); - // decode and copy them to our image - switch (pHead->biBitCount) { - case 32 : - { - // BITFIELD case - if (dwCompression == BI_BITFIELDS || dwCompression == BI_RGB) { - // get the bitfield masks - DWORD bf[3]; - memcpy(bf,lpVoid+pHead->biSize,12); - // transform into RGB - Bitfield2RGB(lpVoid+pHead->biSize+12,(WORD)bf[0],(WORD)bf[1],(WORD)bf[2],(BYTE)pHead->biBitCount); - } else - throw "unknown compression"; - } - break; - case 16 : - { - // get the bitfield masks - long offset=0; - DWORD bf[3]; - if (dwCompression == BI_BITFIELDS) { - memcpy(bf,lpVoid+pHead->biSize,12); - offset= 12; - } else { - bf[0] = 0x7C00; - bf[1] = 0x3E0; - bf[2] = 0x1F; // RGB555 - } - // copy the pixels - memcpy(info.pImage, lpDIBBits + offset, head.biHeight*((head.biWidth+1)/2)*4); - // transform into RGB - Bitfield2RGB(info.pImage, (WORD)bf[0], (WORD)bf[1], (WORD)bf[2], 16); - } - break; - case 8 : - case 4 : - case 1 : - { - switch (dwCompression) { - case BI_RLE4: - { - BYTE status_byte = 0; - BYTE second_byte = 0; - int scanline = 0; - int bits = 0; - BOOL low_nibble = FALSE; - CImageIterator iter(this); - - for (BOOL bContinue = TRUE; bContinue; ) { - status_byte = *(lpDIBBits++); - switch (status_byte) { - case RLE_COMMAND : - status_byte = *(lpDIBBits++); - switch (status_byte) { - case RLE_ENDOFLINE : - bits = 0; - scanline++; - low_nibble = FALSE; - break; - case RLE_ENDOFBITMAP : - bContinue = FALSE; - break; - case RLE_DELTA : - { - // read the delta values - BYTE delta_x; - BYTE delta_y; - delta_x = *(lpDIBBits++); - delta_y = *(lpDIBBits++); - // apply them - bits += delta_x / 2; - scanline += delta_y; - break; - } - default : - second_byte = *(lpDIBBits++); - BYTE* sline = iter.GetRow(scanline); - for (int i = 0; i < status_byte; i++) { - if (low_nibble) { - if ((DWORD)(sline + bits) < (DWORD)(info.pImage + head.biSizeImage)) { - *(sline + bits) |= second_byte & 0x0F; - } - if (i != status_byte - 1) - second_byte = *(lpDIBBits++); - bits++; - } else { - if ((DWORD)(sline + bits) <(DWORD)(info.pImage + head.biSizeImage)) { - *(sline + bits) = (BYTE)(second_byte & 0xF0); - } - } - low_nibble = !low_nibble; - } - if ((((status_byte+1) >> 1) & 1 )== 1) - second_byte = *(lpDIBBits++); - break; - }; - break; - default : - { - BYTE* sline = iter.GetRow(scanline); - second_byte = *(lpDIBBits++); - for (unsigned i = 0; i < status_byte; i++) { - if (low_nibble) { - if ((DWORD)(sline + bits) <(DWORD)(info.pImage + head.biSizeImage)) { - *(sline + bits) |= second_byte & 0x0F; - } - bits++; - } else { - if ((DWORD)(sline + bits) <(DWORD)(info.pImage + head.biSizeImage)) { - *(sline + bits) = (BYTE)(second_byte & 0xF0); - } - } - low_nibble = !low_nibble; - } - } - break; - }; - } - } - break; - case BI_RLE8 : - { - BYTE status_byte = 0; - BYTE second_byte = 0; - int scanline = 0; - int bits = 0; - CImageIterator iter(this); - - for (BOOL bContinue = TRUE; bContinue; ) { - status_byte = *(lpDIBBits++); - if (status_byte==RLE_COMMAND) { - status_byte = *(lpDIBBits++); - switch (status_byte) { - case RLE_ENDOFLINE : - bits = 0; - scanline++; - break; - case RLE_ENDOFBITMAP : - bContinue = FALSE; - break; - case RLE_DELTA : - { - // read the delta values - BYTE delta_x; - BYTE delta_y; - delta_x = *(lpDIBBits++); - delta_y = *(lpDIBBits++); - // apply them - bits += delta_x; - scanline += delta_y; - } - break; - default : - int nNumBytes = sizeof(BYTE) * status_byte; - memcpy((void *)(iter.GetRow(scanline) + bits), lpDIBBits, nNumBytes); - lpDIBBits += nNumBytes; - // align run length to even number of bytes - if ((status_byte & 1) == 1) - second_byte = *(lpDIBBits++); - bits += status_byte; - break; - }; - } else { - BYTE *sline = iter.GetRow(scanline); - second_byte = *(lpDIBBits++); - for (unsigned i = 0; i < status_byte; i++) { - if ((DWORD)bits - // // Create a device-independent bitmap - // return CreateBitmap(head.biWidth,head.biHeight, 1, head.biBitCount, GetBits()); - // use instead this code - HDC hMemDC = CreateCompatibleDC(NULL); - LPVOID pBit32; - HBITMAP bmp = CreateDIBSection(hMemDC,(LPBITMAPINFO)pDib,DIB_RGB_COLORS, &pBit32, NULL, 0); - if (pBit32) memcpy(pBit32, GetBits(), head.biSizeImage); - DeleteDC(hMemDC); - return bmp; - } - - // this single line seems to work very well - HBITMAP bmp = CreateDIBitmap(hdc, (LPBITMAPINFOHEADER)pDib, CBM_INIT, - GetBits(), (LPBITMAPINFO)pDib, DIB_RGB_COLORS); - - return bmp; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Bitmap resource constructor - * \param hbmp : bitmap resource handle - * \param hpal : (optional) palette, useful for 8bpp DC - * \return true if everything is ok - */ -bool CxImage::CreateFromHBITMAP(HBITMAP hbmp, HPALETTE hpal) -{ - if (!Destroy()) - return false; - - if (hbmp) { - BITMAP bm; - // get informations about the bitmap - GetObject(hbmp, sizeof(BITMAP), (LPSTR) &bm); - // create the image - if (!Create(bm.bmWidth, bm.bmHeight, bm.bmBitsPixel, 0)) - return false; - // create a device context for the bitmap - HDC dc = ::GetDC(NULL); - if (!dc) - return false; - - if (hpal){ - SelectObject(dc,hpal); //the palette you should get from the user or have a stock one - RealizePalette(dc); - } - - // copy the pixels - if (GetDIBits(dc, hbmp, 0, head.biHeight, info.pImage, - (LPBITMAPINFO)pDib, DIB_RGB_COLORS) == 0){ //replace &head with pDib - strcpy(info.szLastError,"GetDIBits failed"); - ::ReleaseDC(NULL, dc); - return false; - } - ::ReleaseDC(NULL, dc); - return true; - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * icon resource constructor - * \param hico : icon resource handle - * \return true if everything is ok - */ -bool CxImage::CreateFromHICON(HICON hico) -{ - if (!Destroy()) - return false; - - if (hico) { - ICONINFO iinfo; - GetIconInfo(hico,&iinfo); - if (!CreateFromHBITMAP(iinfo.hbmColor)) - return false; -#if CXIMAGE_SUPPORT_ALPHA - CxImage mask; - mask.CreateFromHBITMAP(iinfo.hbmMask); - mask.GrayScale(); - mask.Negative(); - AlphaSet(mask); -#endif - DeleteObject(iinfo.hbmColor); // - DeleteObject(iinfo.hbmMask); // - return true; - } - return false; -} -//////////////////////////////////////////////////////////////////////////////// -long CxImage::Draw(HDC hdc, const RECT& rect, RECT* pClipRect, bool bSmooth) -{ - return Draw(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, pClipRect,bSmooth); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Draws the image in the specified device context, with support for alpha channel, alpha palette, transparency, opacity. - * \param hdc : destination device context - * \param x,y : (optional) offset - * \param cx,cy : (optional) size. - * - If cx or cy are not specified (or less than 0), the normal width or height will be used - * - If cx or cy are different than width or height, the image will be stretched - * - * \param pClipRect : limit the drawing operations inside a given rectangle in the output device context. - * \param bSmooth : activates a bilinear filter that will enhance the appearence for zommed pictures. - * Quite slow. Needs CXIMAGE_SUPPORT_INTERPOLATION. - * \return true if everything is ok - */ -long CxImage::Draw(HDC hdc, long x, long y, long cx, long cy, RECT* pClipRect, bool bSmooth) -{ - if((pDib==0)||(hdc==0)||(cx==0)||(cy==0)||(!info.bEnabled)) return 0; - - if (cx < 0) cx = head.biWidth; - if (cy < 0) cy = head.biHeight; - bool bTransparent = info.nBkgndIndex != -1; - bool bAlpha = pAlpha != 0; - - RECT mainbox; // (experimental) - if (pClipRect){ - GetClipBox(hdc,&mainbox); - HRGN rgn = CreateRectRgnIndirect(pClipRect); - ExtSelectClipRgn(hdc,rgn,RGN_AND); - DeleteObject(rgn); - } - - //find the smallest area to paint - RECT clipbox,paintbox; - GetClipBox(hdc,&clipbox); - - paintbox.top = min(clipbox.bottom,max(clipbox.top,y)); - paintbox.left = min(clipbox.right,max(clipbox.left,x)); - paintbox.right = max(clipbox.left,min(clipbox.right,x+cx)); - paintbox.bottom = max(clipbox.top,min(clipbox.bottom,y+cy)); - - long destw = paintbox.right - paintbox.left; - long desth = paintbox.bottom - paintbox.top; - - if (!(bTransparent || bAlpha || info.bAlphaPaletteEnabled)){ - if (cx==head.biWidth && cy==head.biHeight){ //NORMAL - SetStretchBltMode(hdc,COLORONCOLOR); - SetDIBitsToDevice(hdc, x, y, cx, cy, 0, 0, 0, cy, - info.pImage,(BITMAPINFO*)pDib,DIB_RGB_COLORS); - } else { //STRETCH - //pixel informations - RGBQUAD c={0,0,0,0}; - //Preparing Bitmap Info - BITMAPINFO bmInfo; - memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER)); - bmInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); - bmInfo.bmiHeader.biWidth=destw; - bmInfo.bmiHeader.biHeight=desth; - bmInfo.bmiHeader.biPlanes=1; - bmInfo.bmiHeader.biBitCount=24; - BYTE *pbase; //points to the final dib - BYTE *pdst; //current pixel from pbase - BYTE *ppix; //current pixel from image - //get the background - HDC TmpDC=CreateCompatibleDC(hdc); - HBITMAP TmpBmp=CreateDIBSection(hdc,&bmInfo,DIB_RGB_COLORS,(void**)&pbase,0,0); - HGDIOBJ TmpObj=SelectObject(TmpDC,TmpBmp); - - if (pbase){ - long xx,yy; - long sx,sy; - float dx,dy; - BYTE *psrc; - - long ew = ((((24 * destw) + 31) / 32) * 4); - long ymax = paintbox.bottom; - long xmin = paintbox.left; - float fx=(float)head.biWidth/(float)cx; - float fy=(float)head.biHeight/(float)cy; - - for(yy=0;yy>8); - - if (head.biClrUsed){ - ci = GetPixelIndex(sx,sy); -#if CXIMAGE_SUPPORT_INTERPOLATION - if (bSmooth){ - c = GetPixelColorInterpolated(dx - 0.5f, dy - 0.5f, CxImage::IM_BILINEAR, CxImage::OM_REPEAT); - } else -#endif //CXIMAGE_SUPPORT_INTERPOLATION - { - c = GetPaletteColor(GetPixelIndex(sx,sy)); - } - if (info.bAlphaPaletteEnabled){ - a = (BYTE)((a*(1+c.rgbReserved))>>8); - } - } else { -#if CXIMAGE_SUPPORT_INTERPOLATION - if (bSmooth){ - c = GetPixelColorInterpolated(dx - 0.5f, dy - 0.5f, CxImage::IM_BILINEAR, CxImage::OM_REPEAT); - } else -#endif //CXIMAGE_SUPPORT_INTERPOLATION - { - ppix = psrc + sx*3; - c.rgbBlue = *ppix++; - c.rgbGreen= *ppix++; - c.rgbRed = *ppix; - } - } - //if (*pc!=*pct || !bTransparent){ - //if ((head.biClrUsed && ci!=cit) || ((!head.biClrUsed||bSmooth) && *pc!=*pct) || !bTransparent){ - if ((head.biClrUsed && ci!=cit) || (!head.biClrUsed && *pc!=*pct) || !bTransparent){ - // DJT, assume many pixels are fully transparent or opaque and thus avoid multiplication - if (a == 0) { // Transparent, retain dest - pdst+=3; - } else if (a == 255) { // opaque, ignore dest - *pdst++= c.rgbBlue; - *pdst++= c.rgbGreen; - *pdst++= c.rgbRed; - } else { // semi transparent - a1=(BYTE)~a; - *pdst++=(BYTE)((*pdst * a1 + a * c.rgbBlue)>>8); - *pdst++=(BYTE)((*pdst * a1 + a * c.rgbGreen)>>8); - *pdst++=(BYTE)((*pdst * a1 + a * c.rgbRed)>>8); - } - } else { - pdst+=3; - } - } - } - } else { - //NORMAL - iy=head.biHeight-ymax+y; - for(yy=0;yy>8); - - if (head.biClrUsed){ - ci = GetPixelIndex(ix,iy); - c = GetPaletteColor((BYTE)ci); - if (info.bAlphaPaletteEnabled){ - a = (BYTE)((a*(1+c.rgbReserved))>>8); - } - } else { - c.rgbBlue = *ppix++; - c.rgbGreen= *ppix++; - c.rgbRed = *ppix++; - } - - //if (*pc!=*pct || !bTransparent){ - if ((head.biClrUsed && ci!=cit) || (!head.biClrUsed && *pc!=*pct) || !bTransparent){ - // DJT, assume many pixels are fully transparent or opaque and thus avoid multiplication - if (a == 0) { // Transparent, retain dest - pdst+=3; - } else if (a == 255) { // opaque, ignore dest - *pdst++= c.rgbBlue; - *pdst++= c.rgbGreen; - *pdst++= c.rgbRed; - } else { // semi transparent - a1=(BYTE)~a; - *pdst++=(BYTE)((*pdst * a1 + a * c.rgbBlue)>>8); - *pdst++=(BYTE)((*pdst * a1 + a * c.rgbGreen)>>8); - *pdst++=(BYTE)((*pdst * a1 + a * c.rgbRed)>>8); - } - } else { - pdst+=3; - } - } - } - } - } - //paint the image & cleanup - SetDIBitsToDevice(hdc,paintbox.left,paintbox.top,destw,desth,0,0,0,desth,pbase,&bmInfo,0); - DeleteObject(SelectObject(TmpDC,TmpObj)); - DeleteDC(TmpDC); - } - - if (pClipRect){ // (experimental) - HRGN rgn = CreateRectRgnIndirect(&mainbox); - ExtSelectClipRgn(hdc,rgn,RGN_OR); - DeleteObject(rgn); - } - - return 1; -} -//////////////////////////////////////////////////////////////////////////////// -long CxImage::Draw2(HDC hdc, const RECT& rect) -{ - return Draw2(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Draws (stretch) the image with single transparency support - * \param hdc : destination device context - * \param x,y : (optional) offset - * \param cx,cy : (optional) size. - * - If cx or cy are not specified (or less than 0), the normal width or height will be used - * - If cx or cy are different than width or height, the image will be stretched - * - * \return true if everything is ok - */ -long CxImage::Draw2(HDC hdc, long x, long y, long cx, long cy) -{ - if((pDib==0)||(hdc==0)||(cx==0)||(cy==0)||(!info.bEnabled)) return 0; - if (cx < 0) cx = head.biWidth; - if (cy < 0) cy = head.biHeight; - bool bTransparent = (info.nBkgndIndex != -1); - - if (!bTransparent){ - SetStretchBltMode(hdc,COLORONCOLOR); - StretchDIBits(hdc, x, y, cx, cy, 0, 0, head.biWidth, head.biHeight, - info.pImage,(BITMAPINFO*)pDib, DIB_RGB_COLORS,SRCCOPY); - } else { - // draw image with transparent background - const int safe = 0; // or else GDI fails in the following - sometimes - RECT rcDst = {x+safe, y+safe, x+cx, y+cy}; - if (RectVisible(hdc, &rcDst)){ - ///////////////////////////////////////////////////////////////// - // True Mask Method - Thanks to Paul Reynolds and Ron Gery - int nWidth = head.biWidth; - int nHeight = head.biHeight; - // Create two memory dcs for the image and the mask - HDC dcImage=CreateCompatibleDC(hdc); - HDC dcTrans=CreateCompatibleDC(hdc); - // Select the image into the appropriate dc - HBITMAP bm = CreateCompatibleBitmap(hdc, nWidth, nHeight); - HBITMAP pOldBitmapImage = (HBITMAP)SelectObject(dcImage,bm); - SetStretchBltMode(dcImage,COLORONCOLOR); - StretchDIBits(dcImage, 0, 0, nWidth, nHeight, 0, 0, nWidth, nHeight, - info.pImage,(BITMAPINFO*)pDib,DIB_RGB_COLORS,SRCCOPY); - - // Create the mask bitmap - HBITMAP bitmapTrans = CreateBitmap(nWidth, nHeight, 1, 1, NULL); - // Select the mask bitmap into the appropriate dc - HBITMAP pOldBitmapTrans = (HBITMAP)SelectObject(dcTrans, bitmapTrans); - // Build mask based on transparent colour - RGBQUAD rgbBG; - if (head.biBitCount<24) rgbBG = GetPaletteColor((BYTE)info.nBkgndIndex); - else rgbBG = info.nBkgndColor; - COLORREF crColour = RGB(rgbBG.rgbRed, rgbBG.rgbGreen, rgbBG.rgbBlue); - COLORREF crOldBack = SetBkColor(dcImage,crColour); - BitBlt(dcTrans,0, 0, nWidth, nHeight, dcImage, 0, 0, SRCCOPY); - - // Do the work - True Mask method - cool if not actual display - StretchBlt(hdc,x, y,cx,cy, dcImage, 0, 0, nWidth, nHeight, SRCINVERT); - StretchBlt(hdc,x, y,cx,cy, dcTrans, 0, 0, nWidth, nHeight, SRCAND); - StretchBlt(hdc,x, y,cx,cy, dcImage, 0, 0, nWidth, nHeight, SRCINVERT); - - // Restore settings - SelectObject(dcImage,pOldBitmapImage); - SelectObject(dcTrans,pOldBitmapTrans); - SetBkColor(hdc,crOldBack); - DeleteObject( bitmapTrans ); // RG 29/01/2002 - DeleteDC(dcImage); - DeleteDC(dcTrans); - DeleteObject(bm); - } - } - return 1; -} -//////////////////////////////////////////////////////////////////////////////// -long CxImage::Stretch(HDC hdc, const RECT& rect, DWORD dwRop) -{ - return Stretch(hdc, rect.left, rect.top, rect.right - rect.left, rect.bottom - rect.top, dwRop); -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Stretch the image. Obsolete: use Draw() or Draw2() - * \param hdc : destination device context - * \param xoffset,yoffset : (optional) offset - * \param xsize,ysize : size. - * \param dwRop : raster operation code (see BitBlt documentation) - * \return true if everything is ok - */ -long CxImage::Stretch(HDC hdc, long xoffset, long yoffset, long xsize, long ysize, DWORD dwRop) -{ - if((pDib)&&(hdc)) { - //palette must be correctly filled - SetStretchBltMode(hdc,COLORONCOLOR); - StretchDIBits(hdc, xoffset, yoffset, - xsize, ysize, 0, 0, head.biWidth, head.biHeight, - info.pImage,(BITMAPINFO*)pDib,DIB_RGB_COLORS,dwRop); - return 1; - } - return 0; -} -//////////////////////////////////////////////////////////////////////////////// -/** - * Tiles the device context in the specified rectangle with the image. - * \param hdc : destination device context - * \param rc : tiled rectangle in the output device context - * \return true if everything is ok - */ -long CxImage::Tile(HDC hdc, RECT *rc) -{ - if((pDib)&&(hdc)&&(rc)) { - int w = rc->right - rc->left; - int h = rc->bottom - rc->top; - int x,y,z; - int bx=head.biWidth; - int by=head.biHeight; - for (y = 0 ; y < h ; y += by){ - if ((y+by)>h) by=h-y; - z=bx; - for (x = 0 ; x < w ; x += z){ - if ((x+z)>w) z=w-x; - RECT r = {rc->left + x,rc->top + y,rc->left + x + z,rc->top + y + by}; - Draw(hdc,rc->left + x, rc->top + y,-1,-1,&r); - } - } - return 1; - } - return 0; -} -//////////////////////////////////////////////////////////////////////////////// -// For UNICODE support: char -> TCHAR -long CxImage::DrawString(HDC hdc, long x, long y, const TCHAR* text, RGBQUAD color, const TCHAR* font, long lSize, long lWeight, BYTE bItalic, BYTE bUnderline, bool bSetAlpha) -//long CxImage::DrawString(HDC hdc, long x, long y, const char* text, RGBQUAD color, const char* font, long lSize, long lWeight, BYTE bItalic, BYTE bUnderline, bool bSetAlpha) -{ - if (IsValid()){ - //get the background - HDC TmpDC=CreateCompatibleDC(hdc); - //choose the font - HFONT m_Font; - LOGFONT* m_pLF; - m_pLF=(LOGFONT*)calloc(1,sizeof(LOGFONT)); - _tcsncpy(m_pLF->lfFaceName,font,31); // For UNICODE support - //strncpy(m_pLF->lfFaceName,font,31); - m_pLF->lfHeight=lSize; - m_pLF->lfWeight=lWeight; - m_pLF->lfItalic=bItalic; - m_pLF->lfUnderline=bUnderline; - m_Font=CreateFontIndirect(m_pLF); - //select the font in the dc - HFONT pOldFont=NULL; - if (m_Font) - pOldFont = (HFONT)SelectObject(TmpDC,m_Font); - else - pOldFont = (HFONT)SelectObject(TmpDC,GetStockObject(DEFAULT_GUI_FONT)); - - //Set text color - SetTextColor(TmpDC,RGB(255,255,255)); - SetBkColor(TmpDC,RGB(0,0,0)); - //draw the text - SetBkMode(TmpDC,OPAQUE); - //Set text position; - RECT pos = {0,0,0,0}; - //long len = (long)strlen(text); - long len = (long)_tcslen(text); // For UNICODE support - ::DrawText(TmpDC,text,len,&pos,DT_CALCRECT); - pos.right+=pos.bottom; //for italics - - //Preparing Bitmap Info - long width=pos.right; - long height=pos.bottom; - BITMAPINFO bmInfo; - memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER)); - bmInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); - bmInfo.bmiHeader.biWidth=width; - bmInfo.bmiHeader.biHeight=height; - bmInfo.bmiHeader.biPlanes=1; - bmInfo.bmiHeader.biBitCount=24; - BYTE *pbase; //points to the final dib - - HBITMAP TmpBmp=CreateDIBSection(TmpDC,&bmInfo,DIB_RGB_COLORS,(void**)&pbase,0,0); - HGDIOBJ TmpObj=SelectObject(TmpDC,TmpBmp); - memset(pbase,0,height*((((24 * width) + 31) / 32) * 4)); - - ::DrawText(TmpDC,text,len,&pos,0); - - CxImage itext; - itext.CreateFromHBITMAP(TmpBmp); - - y=head.biHeight-y-1; - for (long ix=0;ix -long CxImage::DrawStringEx(HDC hdc, long x, long y, CXTEXTINFO *pTextType, bool bSetAlpha ) -{ - if (!IsValid()) - return -1; - - //get the background - HDC pDC; - if (hdc) pDC=hdc; else pDC = ::GetDC(0); - HDC TmpDC=CreateCompatibleDC(pDC); - - //choose the font - HFONT m_Font; - m_Font=CreateFontIndirect( &pTextType->lfont ); - - // get colors in RGBQUAD - RGBQUAD p_forecolor = RGBtoRGBQUAD(pTextType->fcolor); - RGBQUAD p_backcolor = RGBtoRGBQUAD(pTextType->bcolor); - - // check alignment and re-set default if necessary - if ( pTextType->align != DT_CENTER && - pTextType->align != DT_LEFT && - pTextType->align != DT_RIGHT ) - pTextType->align = DT_CENTER; - - // check rounding radius and re-set default if necessary - if ( pTextType->b_round > 50 || pTextType->b_round < 0 ) - pTextType->b_round = 10; - - // check opacity and re-set default if necessary - if ( pTextType->b_opacity > 1. || pTextType->b_opacity < .0 ) - pTextType->b_opacity = 0.; - - //select the font in the dc - HFONT pOldFont=NULL; - if (m_Font) - pOldFont = (HFONT)SelectObject(TmpDC,m_Font); - else - pOldFont = (HFONT)SelectObject(TmpDC,GetStockObject(DEFAULT_GUI_FONT)); - - //Set text color - SetTextColor(TmpDC,RGB(255,255,255)); - SetBkColor(TmpDC,RGB(0,0,0)); - SetBkMode(TmpDC,OPAQUE); - //Set text position; - RECT pos = {0,0,0,0}; - - // get text length and number of lines - long i=0, numlines=1, len=(long)_tcsclen(pTextType->text); - while (itext[i++]==13 ) - numlines++; - } - - ::DrawText(TmpDC, pTextType->text, len, &pos, /*DT_EDITCONTROL|DT_EXTERNALLEADING|*/DT_NOPREFIX | DT_CALCRECT ); - - // increase only if it's really italics, and only one line height - if ( pTextType->lfont.lfItalic ) - pos.right += pos.bottom/2/numlines; - - // background frame and rounding radius - int frame = 0, roundR = 0; - if ( pTextType->opaque ) - { - roundR= (int)(pos.bottom/numlines * pTextType->b_round / 100 ) ; - frame = (int)(/*3.5 + */0.29289*roundR ) ; - pos.right += pos.bottom/numlines/3 ; // JUST FOR BEAUTY - } - - //Preparing Bitmap Info - long width=pos.right +frame*2; - long height=pos.bottom +frame*2; - BITMAPINFO bmInfo; - memset(&bmInfo.bmiHeader,0,sizeof(BITMAPINFOHEADER)); - bmInfo.bmiHeader.biSize=sizeof(BITMAPINFOHEADER); - bmInfo.bmiHeader.biWidth=width; - bmInfo.bmiHeader.biHeight=height; - bmInfo.bmiHeader.biPlanes=1; - bmInfo.bmiHeader.biBitCount=24; - BYTE *pbase; //points to the final dib - - HBITMAP TmpBmp=CreateDIBSection(TmpDC,&bmInfo,DIB_RGB_COLORS,(void**)&pbase,0,0); - HGDIOBJ TmpObj=SelectObject(TmpDC,TmpBmp); - memset(pbase,0,height*((((24 * width) + 31) / 32) * 4)); - - ::DrawText(TmpDC,pTextType->text,len, &pos, /*DT_EDITCONTROL|DT_EXTERNALLEADING|*/DT_NOPREFIX| pTextType->align ); - - CxImage itext; - itext.CreateFromHBITMAP(TmpBmp); - y=head.biHeight-y-1; - - //move the insertion point according to alignment type - // DT_CENTER: cursor points to the center of text rectangle - // DT_RIGHT: cursor points to right side end of text rectangle - // DT_LEFT: cursor points to left end of text rectangle - if ( pTextType->align == DT_CENTER ) - x -= width/2; - else if ( pTextType->align == DT_RIGHT ) - x -= width; - if (x<0) x=0; - - //draw the background first, if it exists - long ix,iy; - if ( pTextType->opaque ) - { - int ixf=0; - for (ix=0;ix=width-roundR-1 ) - ixf = (int)(.5+roundR-sqrt((float)(roundR*roundR-(width-1-ix-roundR)*(width-1-ix-roundR)))); - else - ixf=0; - - for (iy=0;iy height-ixf-1 || iy < ixf )) || - (ix>=width-roundR-1 && ( iy > height-ixf-1 || iy < ixf )) ) - continue; - else - if ( pTextType->b_opacity > 0.0 && pTextType->b_opacity < 1.0 ) - { - RGBQUAD bcolor, pcolor; - // calculate a transition color from original image to background color: - pcolor = GetPixelColor(x+ix,y+iy); - bcolor.rgbBlue = (unsigned char)(pTextType->b_opacity * pcolor.rgbBlue + (1.0-pTextType->b_opacity) * p_backcolor.rgbBlue ); - bcolor.rgbRed = (unsigned char)(pTextType->b_opacity * pcolor.rgbRed + (1.0-pTextType->b_opacity) * p_backcolor.rgbRed ) ; - bcolor.rgbGreen = (unsigned char)(pTextType->b_opacity * pcolor.rgbGreen + (1.0-pTextType->b_opacity) * p_backcolor.rgbGreen ) ; - bcolor.rgbReserved = 0; - SetPixelColor(x+ix,y+iy,bcolor,bSetAlpha); - } - else - SetPixelColor(x+ix,y+iy,p_backcolor,bSetAlpha); - } - } - } - - // draw the text itself - for (ix=0;ixlfont.lfHeight = -36; - txt->lfont.lfCharSet = EASTEUROPE_CHARSET; // just for Central-European users - txt->lfont.lfWeight = FW_NORMAL; - txt->lfont.lfWidth = 0; - txt->lfont.lfEscapement = 0; - txt->lfont.lfOrientation = 0; - txt->lfont.lfItalic = FALSE; - txt->lfont.lfUnderline = FALSE; - txt->lfont.lfStrikeOut = FALSE; - txt->lfont.lfOutPrecision = OUT_DEFAULT_PRECIS; - txt->lfont.lfClipPrecision = CLIP_DEFAULT_PRECIS; - txt->lfont.lfQuality = PROOF_QUALITY; - txt->lfont.lfPitchAndFamily= DEFAULT_PITCH | FF_DONTCARE ; - _stprintf( txt->lfont.lfFaceName, _T("Arial")); //use TCHAR mappings - - // initial colors - txt->fcolor = RGB( 255,255,160 ); // default foreground: light goldyellow - txt->bcolor = RGB( 32, 96, 0 ); // default background: deep green - - // background - txt->opaque = TRUE; // text has a non-transparent background; - txt->b_opacity = 0.0; // default: opaque background - txt->b_outline = 0; // default: no outline (OUTLINE NOT IMPLEMENTED AT THIS TIME) - txt->b_round = 20; // default: rounding radius is 20% of the rectangle height - // the text - _stprintf( txt->text, _T("Sample Text 01234õû")); // text use TCHAR mappings - txt->align = DT_CENTER; - return; -} -//////////////////////////////////////////////////////////////////////////////// -#endif //CXIMAGE_SUPPORT_WINDOWS -//////////////////////////////////////////////////////////////////////////////// diff --git a/src/win32/dependencies/cximage/xiofile.h b/src/win32/dependencies/cximage/xiofile.h deleted file mode 100644 index 46c15f21..00000000 --- a/src/win32/dependencies/cximage/xiofile.h +++ /dev/null @@ -1,112 +0,0 @@ -#if !defined(__xiofile_h) -#define __xiofile_h - -#include "xfile.h" - -class DLL_EXP CxIOFile : public CxFile - { -public: - CxIOFile(FILE* fp = NULL) - { - m_fp = fp; - m_bCloseFile = (bool)(fp==0); - } - - ~CxIOFile() - { - Close(); - } -////////////////////////////////////////////////////////// - bool Open(const char *filename, const char *mode) - { - if (m_fp) return false; // Can't re-open without closing first - - m_fp = fopen(filename, mode); - if (!m_fp) return false; - - m_bCloseFile = true; - - return true; - } -////////////////////////////////////////////////////////// - virtual bool Close() - { - int iErr = 0; - if ( (m_fp) && (m_bCloseFile) ){ - iErr = fclose(m_fp); - m_fp = NULL; - } - return (bool)(iErr==0); - } -////////////////////////////////////////////////////////// - virtual size_t Read(void *buffer, size_t size, size_t count) - { - if (!m_fp) return 0; - return fread(buffer, size, count, m_fp); - } -////////////////////////////////////////////////////////// - virtual size_t Write(const void *buffer, size_t size, size_t count) - { - if (!m_fp) return 0; - return fwrite(buffer, size, count, m_fp); - } -////////////////////////////////////////////////////////// - virtual bool Seek(long offset, int origin) - { - if (!m_fp) return false; - return (bool)(fseek(m_fp, offset, origin) == 0); - } -////////////////////////////////////////////////////////// - virtual long Tell() - { - if (!m_fp) return 0; - return ftell(m_fp); - } -////////////////////////////////////////////////////////// - virtual long Size() - { - if (!m_fp) return -1; - long pos,size; - pos = ftell(m_fp); - fseek(m_fp, 0, SEEK_END); - size = ftell(m_fp); - fseek(m_fp, pos,SEEK_SET); - return size; - } -////////////////////////////////////////////////////////// - virtual bool Flush() - { - if (!m_fp) return false; - return (bool)(fflush(m_fp) == 0); - } -////////////////////////////////////////////////////////// - virtual bool Eof() - { - if (!m_fp) return true; - return (bool)(feof(m_fp) != 0); - } -////////////////////////////////////////////////////////// - virtual long Error() - { - if (!m_fp) return -1; - return ferror(m_fp); - } -////////////////////////////////////////////////////////// - virtual bool PutC(unsigned char c) - { - if (!m_fp) return false; - return (bool)(fputc(c, m_fp) == c); - } -////////////////////////////////////////////////////////// - virtual long GetC() - { - if (!m_fp) return EOF; - return getc(m_fp); - } -////////////////////////////////////////////////////////// -protected: - FILE *m_fp; - bool m_bCloseFile; - }; - -#endif diff --git a/src/win32/dependencies/cximage/xmemfile.cpp b/src/win32/dependencies/cximage/xmemfile.cpp deleted file mode 100644 index e253c22e..00000000 --- a/src/win32/dependencies/cximage/xmemfile.cpp +++ /dev/null @@ -1,173 +0,0 @@ -#include "xmemfile.h" - -////////////////////////////////////////////////////////// -CxMemFile::CxMemFile(BYTE* pBuffer, DWORD size) -{ - m_pBuffer = pBuffer; - m_Position = 0; - m_Size = m_Edge = size; - m_bFreeOnClose = (bool)(pBuffer==0); -} -////////////////////////////////////////////////////////// -CxMemFile::~CxMemFile() -{ - Close(); -} -////////////////////////////////////////////////////////// -bool CxMemFile::Close() -{ - if ( (m_pBuffer) && (m_bFreeOnClose) ){ - free(m_pBuffer); - m_pBuffer = NULL; - m_Size = 0; - } - return true; -} -////////////////////////////////////////////////////////// -bool CxMemFile::Open() -{ - if (m_pBuffer) return false; // Can't re-open without closing first - - m_Position = m_Size = m_Edge = 0; - m_pBuffer=(BYTE*)malloc(1); - m_bFreeOnClose = true; - - return (m_pBuffer!=0); -} -////////////////////////////////////////////////////////// -BYTE* CxMemFile::GetBuffer(bool bDetachBuffer) -{ - m_bFreeOnClose = !bDetachBuffer; - return m_pBuffer; -} -////////////////////////////////////////////////////////// -size_t CxMemFile::Read(void *buffer, size_t size, size_t count) -{ - if (buffer==NULL) return 0; - - if (m_pBuffer==NULL) return 0; - if (m_Position >= (long)m_Size) return 0; - - long nCount = (long)(count*size); - if (nCount == 0) return 0; - - long nRead; - if (m_Position + nCount > (long)m_Size) - nRead = (m_Size - m_Position); - else - nRead = nCount; - - memcpy(buffer, m_pBuffer + m_Position, nRead); - m_Position += nRead; - - return (size_t)(nRead/size); -} -////////////////////////////////////////////////////////// -size_t CxMemFile::Write(const void *buffer, size_t size, size_t count) -{ - if (m_pBuffer==NULL) return 0; - if (buffer==NULL) return 0; - - long nCount = (long)(count*size); - if (nCount == 0) return 0; - - if (m_Position + nCount > m_Edge) Alloc(m_Position + nCount); - - memcpy(m_pBuffer + m_Position, buffer, nCount); - - m_Position += nCount; - - if (m_Position > (long)m_Size) m_Size = m_Position; - - return count; -} -////////////////////////////////////////////////////////// -bool CxMemFile::Seek(long offset, int origin) -{ - if (m_pBuffer==NULL) return false; - long lNewPos = m_Position; - - if (origin == SEEK_SET) lNewPos = offset; - else if (origin == SEEK_CUR) lNewPos += offset; - else if (origin == SEEK_END) lNewPos = m_Size + offset; - else return false; - - if (lNewPos < 0) lNewPos = 0; - - m_Position = lNewPos; - return true; -} -////////////////////////////////////////////////////////// -long CxMemFile::Tell() -{ - if (m_pBuffer==NULL) return -1; - return m_Position; -} -////////////////////////////////////////////////////////// -long CxMemFile::Size() -{ - if (m_pBuffer==NULL) return -1; - return m_Size; -} -////////////////////////////////////////////////////////// -bool CxMemFile::Flush() -{ - if (m_pBuffer==NULL) return false; - return true; -} -////////////////////////////////////////////////////////// -bool CxMemFile::Eof() -{ - if (m_pBuffer==NULL) return true; - return (m_Position >= (long)m_Size); -} -////////////////////////////////////////////////////////// -long CxMemFile::Error() -{ - if (m_pBuffer==NULL) return -1; - return (m_Position > (long)m_Size); -} -////////////////////////////////////////////////////////// -bool CxMemFile::PutC(unsigned char c) -{ - if (m_pBuffer==NULL) return false; - if (m_Position + 1 > m_Edge) Alloc(m_Position + 1); - - memcpy(m_pBuffer + m_Position, &c, 1); - - m_Position += 1; - - if (m_Position > (long)m_Size) m_Size = m_Position; - - return true; -} -////////////////////////////////////////////////////////// -long CxMemFile::GetC() -{ - if (Eof()) return EOF; - return *(BYTE*)((BYTE*)m_pBuffer + m_Position++); -} -////////////////////////////////////////////////////////// -void CxMemFile::Alloc(DWORD dwNewLen) -{ - if (dwNewLen > (DWORD)m_Edge) - { - // find new buffer size - DWORD dwNewBufferSize = (DWORD)(((dwNewLen>>12)+1)<<12); - - // allocate new buffer - if (m_pBuffer == NULL) m_pBuffer = (BYTE*)malloc(dwNewBufferSize); - else m_pBuffer = (BYTE*)realloc(m_pBuffer, dwNewBufferSize); - // I own this buffer now (caller knows nothing about it) - m_bFreeOnClose = true; - - m_Edge = dwNewBufferSize; - } - return; -} -////////////////////////////////////////////////////////// -void CxMemFile::Free() -{ - Close(); -} -////////////////////////////////////////////////////////// diff --git a/src/win32/dependencies/cximage/xmemfile.h b/src/win32/dependencies/cximage/xmemfile.h deleted file mode 100644 index f3077cef..00000000 --- a/src/win32/dependencies/cximage/xmemfile.h +++ /dev/null @@ -1,39 +0,0 @@ -#if !defined(__xmemfile_h) -#define __xmemfile_h - -#include "xfile.h" - -////////////////////////////////////////////////////////// -class DLL_EXP CxMemFile : public CxFile -{ -public: - CxMemFile(BYTE* pBuffer = NULL, DWORD size = 0); - ~CxMemFile(); - - bool Open(); - BYTE* GetBuffer(bool bDetachBuffer = true); - - virtual bool Close(); - virtual size_t Read(void *buffer, size_t size, size_t count); - virtual size_t Write(const void *buffer, size_t size, size_t count); - virtual bool Seek(long offset, int origin); - virtual long Tell(); - virtual long Size(); - virtual bool Flush(); - virtual bool Eof(); - virtual long Error(); - virtual bool PutC(unsigned char c); - virtual long GetC(); - -protected: - void Alloc(DWORD nBytes); - void Free(); - - BYTE* m_pBuffer; - DWORD m_Size; - bool m_bFreeOnClose; - long m_Position; //current position - long m_Edge; //buffer size -}; - -#endif diff --git a/src/win32/dependencies/glext.h b/src/win32/dependencies/glext.h deleted file mode 100644 index 480e922c..00000000 --- a/src/win32/dependencies/glext.h +++ /dev/null @@ -1,6498 +0,0 @@ -#ifndef __glext_h_ -#define __glext_h_ - -#ifdef __cplusplus -extern "C" { -#endif - -/* -** License Applicability. Except to the extent portions of this file are -** made subject to an alternative license as permitted in the SGI Free -** Software License B, Version 1.1 (the "License"), the contents of this -** file are subject only to the provisions of the License. You may not use -** this file except in compliance with the License. You may obtain a copy -** of the License at Silicon Graphics, Inc., attn: Legal Services, 1600 -** Amphitheatre Parkway, Mountain View, CA 94043-1351, or at: -** -** http://oss.sgi.com/projects/FreeB -** -** Note that, as provided in the License, the Software is distributed on an -** "AS IS" basis, with ALL EXPRESS AND IMPLIED WARRANTIES AND CONDITIONS -** DISCLAIMED, INCLUDING, WITHOUT LIMITATION, ANY IMPLIED WARRANTIES AND -** CONDITIONS OF MERCHANTABILITY, SATISFACTORY QUALITY, FITNESS FOR A -** PARTICULAR PURPOSE, AND NON-INFRINGEMENT. -** -** Original Code. The Original Code is: OpenGL Sample Implementation, -** Version 1.2.1, released January 26, 2000, developed by Silicon Graphics, -** Inc. The Original Code is Copyright (c) 1991-2004 Silicon Graphics, Inc. -** Copyright in any portions created by third parties is as indicated -** elsewhere herein. All Rights Reserved. -** -** Additional Notice Provisions: This software was created using the -** OpenGL(R) version 1.2.1 Sample Implementation published by SGI, but has -** not been independently verified as being compliant with the OpenGL(R) -** version 1.2.1 Specification. -*/ - -#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__) -#define WIN32_LEAN_AND_MEAN 1 -#include -#endif - -#ifndef APIENTRY -#define APIENTRY -#endif -#ifndef APIENTRYP -#define APIENTRYP APIENTRY * -#endif -#ifndef GLAPI -#define GLAPI extern -#endif - -/*************************************************************/ - -/* Header file version number, required by OpenGL ABI for Linux */ -/* glext.h last updated 2005/06/20 */ -/* Current version at http://oss.sgi.com/projects/ogl-sample/registry/ */ -#define GL_GLEXT_VERSION 29 - -#ifndef GL_VERSION_1_2 -#define GL_UNSIGNED_BYTE_3_3_2 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2 0x8036 -#define GL_RESCALE_NORMAL 0x803A -#define GL_TEXTURE_BINDING_3D 0x806A -#define GL_PACK_SKIP_IMAGES 0x806B -#define GL_PACK_IMAGE_HEIGHT 0x806C -#define GL_UNPACK_SKIP_IMAGES 0x806D -#define GL_UNPACK_IMAGE_HEIGHT 0x806E -#define GL_TEXTURE_3D 0x806F -#define GL_PROXY_TEXTURE_3D 0x8070 -#define GL_TEXTURE_DEPTH 0x8071 -#define GL_TEXTURE_WRAP_R 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE 0x8073 -#define GL_UNSIGNED_BYTE_2_3_3_REV 0x8362 -#define GL_UNSIGNED_SHORT_5_6_5 0x8363 -#define GL_UNSIGNED_SHORT_5_6_5_REV 0x8364 -#define GL_UNSIGNED_SHORT_4_4_4_4_REV 0x8365 -#define GL_UNSIGNED_SHORT_1_5_5_5_REV 0x8366 -#define GL_UNSIGNED_INT_8_8_8_8_REV 0x8367 -#define GL_UNSIGNED_INT_2_10_10_10_REV 0x8368 -#define GL_BGR 0x80E0 -#define GL_BGRA 0x80E1 -#define GL_MAX_ELEMENTS_VERTICES 0x80E8 -#define GL_MAX_ELEMENTS_INDICES 0x80E9 -#define GL_CLAMP_TO_EDGE 0x812F -#define GL_TEXTURE_MIN_LOD 0x813A -#define GL_TEXTURE_MAX_LOD 0x813B -#define GL_TEXTURE_BASE_LEVEL 0x813C -#define GL_TEXTURE_MAX_LEVEL 0x813D -#define GL_LIGHT_MODEL_COLOR_CONTROL 0x81F8 -#define GL_SINGLE_COLOR 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR 0x81FA -#define GL_SMOOTH_POINT_SIZE_RANGE 0x0B12 -#define GL_SMOOTH_POINT_SIZE_GRANULARITY 0x0B13 -#define GL_SMOOTH_LINE_WIDTH_RANGE 0x0B22 -#define GL_SMOOTH_LINE_WIDTH_GRANULARITY 0x0B23 -#define GL_ALIASED_POINT_SIZE_RANGE 0x846D -#define GL_ALIASED_LINE_WIDTH_RANGE 0x846E -#endif - -#ifndef GL_ARB_imaging -#define GL_CONSTANT_COLOR 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR 0x8002 -#define GL_CONSTANT_ALPHA 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA 0x8004 -#define GL_BLEND_COLOR 0x8005 -#define GL_FUNC_ADD 0x8006 -#define GL_MIN 0x8007 -#define GL_MAX 0x8008 -#define GL_BLEND_EQUATION 0x8009 -#define GL_FUNC_SUBTRACT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT 0x800B -#define GL_CONVOLUTION_1D 0x8010 -#define GL_CONVOLUTION_2D 0x8011 -#define GL_SEPARABLE_2D 0x8012 -#define GL_CONVOLUTION_BORDER_MODE 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS 0x8015 -#define GL_REDUCE 0x8016 -#define GL_CONVOLUTION_FORMAT 0x8017 -#define GL_CONVOLUTION_WIDTH 0x8018 -#define GL_CONVOLUTION_HEIGHT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS 0x8023 -#define GL_HISTOGRAM 0x8024 -#define GL_PROXY_HISTOGRAM 0x8025 -#define GL_HISTOGRAM_WIDTH 0x8026 -#define GL_HISTOGRAM_FORMAT 0x8027 -#define GL_HISTOGRAM_RED_SIZE 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE 0x802C -#define GL_HISTOGRAM_SINK 0x802D -#define GL_MINMAX 0x802E -#define GL_MINMAX_FORMAT 0x802F -#define GL_MINMAX_SINK 0x8030 -#define GL_TABLE_TOO_LARGE 0x8031 -#define GL_COLOR_MATRIX 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS 0x80BB -#define GL_COLOR_TABLE 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE 0x80D2 -#define GL_PROXY_COLOR_TABLE 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE 0x80D5 -#define GL_COLOR_TABLE_SCALE 0x80D6 -#define GL_COLOR_TABLE_BIAS 0x80D7 -#define GL_COLOR_TABLE_FORMAT 0x80D8 -#define GL_COLOR_TABLE_WIDTH 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE 0x80DF -#define GL_CONSTANT_BORDER 0x8151 -#define GL_REPLICATE_BORDER 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR 0x8154 -#endif - -#ifndef GL_VERSION_1_3 -#define GL_TEXTURE0 0x84C0 -#define GL_TEXTURE1 0x84C1 -#define GL_TEXTURE2 0x84C2 -#define GL_TEXTURE3 0x84C3 -#define GL_TEXTURE4 0x84C4 -#define GL_TEXTURE5 0x84C5 -#define GL_TEXTURE6 0x84C6 -#define GL_TEXTURE7 0x84C7 -#define GL_TEXTURE8 0x84C8 -#define GL_TEXTURE9 0x84C9 -#define GL_TEXTURE10 0x84CA -#define GL_TEXTURE11 0x84CB -#define GL_TEXTURE12 0x84CC -#define GL_TEXTURE13 0x84CD -#define GL_TEXTURE14 0x84CE -#define GL_TEXTURE15 0x84CF -#define GL_TEXTURE16 0x84D0 -#define GL_TEXTURE17 0x84D1 -#define GL_TEXTURE18 0x84D2 -#define GL_TEXTURE19 0x84D3 -#define GL_TEXTURE20 0x84D4 -#define GL_TEXTURE21 0x84D5 -#define GL_TEXTURE22 0x84D6 -#define GL_TEXTURE23 0x84D7 -#define GL_TEXTURE24 0x84D8 -#define GL_TEXTURE25 0x84D9 -#define GL_TEXTURE26 0x84DA -#define GL_TEXTURE27 0x84DB -#define GL_TEXTURE28 0x84DC -#define GL_TEXTURE29 0x84DD -#define GL_TEXTURE30 0x84DE -#define GL_TEXTURE31 0x84DF -#define GL_ACTIVE_TEXTURE 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE 0x84E1 -#define GL_MAX_TEXTURE_UNITS 0x84E2 -#define GL_TRANSPOSE_MODELVIEW_MATRIX 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX 0x84E6 -#define GL_MULTISAMPLE 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE 0x809F -#define GL_SAMPLE_COVERAGE 0x80A0 -#define GL_SAMPLE_BUFFERS 0x80A8 -#define GL_SAMPLES 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT 0x80AB -#define GL_MULTISAMPLE_BIT 0x20000000 -#define GL_NORMAL_MAP 0x8511 -#define GL_REFLECTION_MAP 0x8512 -#define GL_TEXTURE_CUBE_MAP 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE 0x851C -#define GL_COMPRESSED_ALPHA 0x84E9 -#define GL_COMPRESSED_LUMINANCE 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA 0x84EB -#define GL_COMPRESSED_INTENSITY 0x84EC -#define GL_COMPRESSED_RGB 0x84ED -#define GL_COMPRESSED_RGBA 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE 0x86A0 -#define GL_TEXTURE_COMPRESSED 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS 0x86A3 -#define GL_CLAMP_TO_BORDER 0x812D -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#define GL_COMBINE 0x8570 -#define GL_COMBINE_RGB 0x8571 -#define GL_COMBINE_ALPHA 0x8572 -#define GL_SOURCE0_RGB 0x8580 -#define GL_SOURCE1_RGB 0x8581 -#define GL_SOURCE2_RGB 0x8582 -#define GL_SOURCE0_ALPHA 0x8588 -#define GL_SOURCE1_ALPHA 0x8589 -#define GL_SOURCE2_ALPHA 0x858A -#define GL_OPERAND0_RGB 0x8590 -#define GL_OPERAND1_RGB 0x8591 -#define GL_OPERAND2_RGB 0x8592 -#define GL_OPERAND0_ALPHA 0x8598 -#define GL_OPERAND1_ALPHA 0x8599 -#define GL_OPERAND2_ALPHA 0x859A -#define GL_RGB_SCALE 0x8573 -#define GL_ADD_SIGNED 0x8574 -#define GL_INTERPOLATE 0x8575 -#define GL_SUBTRACT 0x84E7 -#define GL_CONSTANT 0x8576 -#define GL_PRIMARY_COLOR 0x8577 -#define GL_PREVIOUS 0x8578 -#define GL_DOT3_RGB 0x86AE -#define GL_DOT3_RGBA 0x86AF -#endif - -#ifndef GL_VERSION_1_4 -#define GL_BLEND_DST_RGB 0x80C8 -#define GL_BLEND_SRC_RGB 0x80C9 -#define GL_BLEND_DST_ALPHA 0x80CA -#define GL_BLEND_SRC_ALPHA 0x80CB -#define GL_POINT_SIZE_MIN 0x8126 -#define GL_POINT_SIZE_MAX 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION 0x8129 -#define GL_GENERATE_MIPMAP 0x8191 -#define GL_GENERATE_MIPMAP_HINT 0x8192 -#define GL_DEPTH_COMPONENT16 0x81A5 -#define GL_DEPTH_COMPONENT24 0x81A6 -#define GL_DEPTH_COMPONENT32 0x81A7 -#define GL_MIRRORED_REPEAT 0x8370 -#define GL_FOG_COORDINATE_SOURCE 0x8450 -#define GL_FOG_COORDINATE 0x8451 -#define GL_FRAGMENT_DEPTH 0x8452 -#define GL_CURRENT_FOG_COORDINATE 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER 0x8456 -#define GL_FOG_COORDINATE_ARRAY 0x8457 -#define GL_COLOR_SUM 0x8458 -#define GL_CURRENT_SECONDARY_COLOR 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER 0x845D -#define GL_SECONDARY_COLOR_ARRAY 0x845E -#define GL_MAX_TEXTURE_LOD_BIAS 0x84FD -#define GL_TEXTURE_FILTER_CONTROL 0x8500 -#define GL_TEXTURE_LOD_BIAS 0x8501 -#define GL_INCR_WRAP 0x8507 -#define GL_DECR_WRAP 0x8508 -#define GL_TEXTURE_DEPTH_SIZE 0x884A -#define GL_DEPTH_TEXTURE_MODE 0x884B -#define GL_TEXTURE_COMPARE_MODE 0x884C -#define GL_TEXTURE_COMPARE_FUNC 0x884D -#define GL_COMPARE_R_TO_TEXTURE 0x884E -#endif - -#ifndef GL_VERSION_1_5 -#define GL_BUFFER_SIZE 0x8764 -#define GL_BUFFER_USAGE 0x8765 -#define GL_QUERY_COUNTER_BITS 0x8864 -#define GL_CURRENT_QUERY 0x8865 -#define GL_QUERY_RESULT 0x8866 -#define GL_QUERY_RESULT_AVAILABLE 0x8867 -#define GL_ARRAY_BUFFER 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER 0x8893 -#define GL_ARRAY_BUFFER_BINDING 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING 0x889F -#define GL_READ_ONLY 0x88B8 -#define GL_WRITE_ONLY 0x88B9 -#define GL_READ_WRITE 0x88BA -#define GL_BUFFER_ACCESS 0x88BB -#define GL_BUFFER_MAPPED 0x88BC -#define GL_BUFFER_MAP_POINTER 0x88BD -#define GL_STREAM_DRAW 0x88E0 -#define GL_STREAM_READ 0x88E1 -#define GL_STREAM_COPY 0x88E2 -#define GL_STATIC_DRAW 0x88E4 -#define GL_STATIC_READ 0x88E5 -#define GL_STATIC_COPY 0x88E6 -#define GL_DYNAMIC_DRAW 0x88E8 -#define GL_DYNAMIC_READ 0x88E9 -#define GL_DYNAMIC_COPY 0x88EA -#define GL_SAMPLES_PASSED 0x8914 -#define GL_FOG_COORD_SRC GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD_SOURCE GL_FOG_COORDINATE_SOURCE -#define GL_FOG_COORD GL_FOG_COORDINATE -#define GL_CURRENT_FOG_COORD GL_CURRENT_FOG_COORDINATE -#define GL_FOG_COORD_ARRAY_TYPE GL_FOG_COORDINATE_ARRAY_TYPE -#define GL_FOG_COORD_ARRAY_STRIDE GL_FOG_COORDINATE_ARRAY_STRIDE -#define GL_FOG_COORD_ARRAY_POINTER GL_FOG_COORDINATE_ARRAY_POINTER -#define GL_FOG_COORD_ARRAY GL_FOG_COORDINATE_ARRAY -#define GL_FOG_COORD_ARRAY_BUFFER_BINDING GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING -#define GL_SRC0_RGB GL_SOURCE0_RGB -#define GL_SRC1_RGB GL_SOURCE1_RGB -#define GL_SRC2_RGB GL_SOURCE2_RGB -#define GL_SRC0_ALPHA GL_SOURCE0_ALPHA -#define GL_SRC1_ALPHA GL_SOURCE1_ALPHA -#define GL_SRC2_ALPHA GL_SOURCE2_ALPHA -#endif - -#ifndef GL_VERSION_2_0 -#define GL_BLEND_EQUATION_RGB GL_BLEND_EQUATION -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB 0x8626 -#define GL_VERTEX_PROGRAM_POINT_SIZE 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER 0x8645 -#define GL_STENCIL_BACK_FUNC 0x8800 -#define GL_STENCIL_BACK_FAIL 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS 0x8803 -#define GL_MAX_DRAW_BUFFERS 0x8824 -#define GL_DRAW_BUFFER0 0x8825 -#define GL_DRAW_BUFFER1 0x8826 -#define GL_DRAW_BUFFER2 0x8827 -#define GL_DRAW_BUFFER3 0x8828 -#define GL_DRAW_BUFFER4 0x8829 -#define GL_DRAW_BUFFER5 0x882A -#define GL_DRAW_BUFFER6 0x882B -#define GL_DRAW_BUFFER7 0x882C -#define GL_DRAW_BUFFER8 0x882D -#define GL_DRAW_BUFFER9 0x882E -#define GL_DRAW_BUFFER10 0x882F -#define GL_DRAW_BUFFER11 0x8830 -#define GL_DRAW_BUFFER12 0x8831 -#define GL_DRAW_BUFFER13 0x8832 -#define GL_DRAW_BUFFER14 0x8833 -#define GL_DRAW_BUFFER15 0x8834 -#define GL_BLEND_EQUATION_ALPHA 0x883D -#define GL_POINT_SPRITE 0x8861 -#define GL_COORD_REPLACE 0x8862 -#define GL_MAX_VERTEX_ATTRIBS 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED 0x886A -#define GL_MAX_TEXTURE_COORDS 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS 0x8872 -#define GL_FRAGMENT_SHADER 0x8B30 -#define GL_VERTEX_SHADER 0x8B31 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS 0x8B49 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS 0x8B4A -#define GL_MAX_VARYING_FLOATS 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS 0x8B4D -#define GL_SHADER_TYPE 0x8B4F -#define GL_FLOAT_VEC2 0x8B50 -#define GL_FLOAT_VEC3 0x8B51 -#define GL_FLOAT_VEC4 0x8B52 -#define GL_INT_VEC2 0x8B53 -#define GL_INT_VEC3 0x8B54 -#define GL_INT_VEC4 0x8B55 -#define GL_BOOL 0x8B56 -#define GL_BOOL_VEC2 0x8B57 -#define GL_BOOL_VEC3 0x8B58 -#define GL_BOOL_VEC4 0x8B59 -#define GL_FLOAT_MAT2 0x8B5A -#define GL_FLOAT_MAT3 0x8B5B -#define GL_FLOAT_MAT4 0x8B5C -#define GL_SAMPLER_1D 0x8B5D -#define GL_SAMPLER_2D 0x8B5E -#define GL_SAMPLER_3D 0x8B5F -#define GL_SAMPLER_CUBE 0x8B60 -#define GL_SAMPLER_1D_SHADOW 0x8B61 -#define GL_SAMPLER_2D_SHADOW 0x8B62 -#define GL_DELETE_STATUS 0x8B80 -#define GL_COMPILE_STATUS 0x8B81 -#define GL_LINK_STATUS 0x8B82 -#define GL_VALIDATE_STATUS 0x8B83 -#define GL_INFO_LOG_LENGTH 0x8B84 -#define GL_ATTACHED_SHADERS 0x8B85 -#define GL_ACTIVE_UNIFORMS 0x8B86 -#define GL_ACTIVE_UNIFORM_MAX_LENGTH 0x8B87 -#define GL_SHADER_SOURCE_LENGTH 0x8B88 -#define GL_ACTIVE_ATTRIBUTES 0x8B89 -#define GL_ACTIVE_ATTRIBUTE_MAX_LENGTH 0x8B8A -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT 0x8B8B -#define GL_SHADING_LANGUAGE_VERSION 0x8B8C -#define GL_CURRENT_PROGRAM 0x8B8D -#define GL_POINT_SPRITE_COORD_ORIGIN 0x8CA0 -#define GL_LOWER_LEFT 0x8CA1 -#define GL_UPPER_LEFT 0x8CA2 -#define GL_STENCIL_BACK_REF 0x8CA3 -#define GL_STENCIL_BACK_VALUE_MASK 0x8CA4 -#define GL_STENCIL_BACK_WRITEMASK 0x8CA5 -#endif - -#ifndef GL_ARB_multitexture -#define GL_TEXTURE0_ARB 0x84C0 -#define GL_TEXTURE1_ARB 0x84C1 -#define GL_TEXTURE2_ARB 0x84C2 -#define GL_TEXTURE3_ARB 0x84C3 -#define GL_TEXTURE4_ARB 0x84C4 -#define GL_TEXTURE5_ARB 0x84C5 -#define GL_TEXTURE6_ARB 0x84C6 -#define GL_TEXTURE7_ARB 0x84C7 -#define GL_TEXTURE8_ARB 0x84C8 -#define GL_TEXTURE9_ARB 0x84C9 -#define GL_TEXTURE10_ARB 0x84CA -#define GL_TEXTURE11_ARB 0x84CB -#define GL_TEXTURE12_ARB 0x84CC -#define GL_TEXTURE13_ARB 0x84CD -#define GL_TEXTURE14_ARB 0x84CE -#define GL_TEXTURE15_ARB 0x84CF -#define GL_TEXTURE16_ARB 0x84D0 -#define GL_TEXTURE17_ARB 0x84D1 -#define GL_TEXTURE18_ARB 0x84D2 -#define GL_TEXTURE19_ARB 0x84D3 -#define GL_TEXTURE20_ARB 0x84D4 -#define GL_TEXTURE21_ARB 0x84D5 -#define GL_TEXTURE22_ARB 0x84D6 -#define GL_TEXTURE23_ARB 0x84D7 -#define GL_TEXTURE24_ARB 0x84D8 -#define GL_TEXTURE25_ARB 0x84D9 -#define GL_TEXTURE26_ARB 0x84DA -#define GL_TEXTURE27_ARB 0x84DB -#define GL_TEXTURE28_ARB 0x84DC -#define GL_TEXTURE29_ARB 0x84DD -#define GL_TEXTURE30_ARB 0x84DE -#define GL_TEXTURE31_ARB 0x84DF -#define GL_ACTIVE_TEXTURE_ARB 0x84E0 -#define GL_CLIENT_ACTIVE_TEXTURE_ARB 0x84E1 -#define GL_MAX_TEXTURE_UNITS_ARB 0x84E2 -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_TRANSPOSE_MODELVIEW_MATRIX_ARB 0x84E3 -#define GL_TRANSPOSE_PROJECTION_MATRIX_ARB 0x84E4 -#define GL_TRANSPOSE_TEXTURE_MATRIX_ARB 0x84E5 -#define GL_TRANSPOSE_COLOR_MATRIX_ARB 0x84E6 -#endif - -#ifndef GL_ARB_multisample -#define GL_MULTISAMPLE_ARB 0x809D -#define GL_SAMPLE_ALPHA_TO_COVERAGE_ARB 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_ARB 0x809F -#define GL_SAMPLE_COVERAGE_ARB 0x80A0 -#define GL_SAMPLE_BUFFERS_ARB 0x80A8 -#define GL_SAMPLES_ARB 0x80A9 -#define GL_SAMPLE_COVERAGE_VALUE_ARB 0x80AA -#define GL_SAMPLE_COVERAGE_INVERT_ARB 0x80AB -#define GL_MULTISAMPLE_BIT_ARB 0x20000000 -#endif - -#ifndef GL_ARB_texture_env_add -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_NORMAL_MAP_ARB 0x8511 -#define GL_REFLECTION_MAP_ARB 0x8512 -#define GL_TEXTURE_CUBE_MAP_ARB 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_ARB 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_ARB 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_ARB 0x851C -#endif - -#ifndef GL_ARB_texture_compression -#define GL_COMPRESSED_ALPHA_ARB 0x84E9 -#define GL_COMPRESSED_LUMINANCE_ARB 0x84EA -#define GL_COMPRESSED_LUMINANCE_ALPHA_ARB 0x84EB -#define GL_COMPRESSED_INTENSITY_ARB 0x84EC -#define GL_COMPRESSED_RGB_ARB 0x84ED -#define GL_COMPRESSED_RGBA_ARB 0x84EE -#define GL_TEXTURE_COMPRESSION_HINT_ARB 0x84EF -#define GL_TEXTURE_COMPRESSED_IMAGE_SIZE_ARB 0x86A0 -#define GL_TEXTURE_COMPRESSED_ARB 0x86A1 -#define GL_NUM_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A2 -#define GL_COMPRESSED_TEXTURE_FORMATS_ARB 0x86A3 -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_CLAMP_TO_BORDER_ARB 0x812D -#endif - -#ifndef GL_ARB_point_parameters -#define GL_POINT_SIZE_MIN_ARB 0x8126 -#define GL_POINT_SIZE_MAX_ARB 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_ARB 0x8128 -#define GL_POINT_DISTANCE_ATTENUATION_ARB 0x8129 -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_MAX_VERTEX_UNITS_ARB 0x86A4 -#define GL_ACTIVE_VERTEX_UNITS_ARB 0x86A5 -#define GL_WEIGHT_SUM_UNITY_ARB 0x86A6 -#define GL_VERTEX_BLEND_ARB 0x86A7 -#define GL_CURRENT_WEIGHT_ARB 0x86A8 -#define GL_WEIGHT_ARRAY_TYPE_ARB 0x86A9 -#define GL_WEIGHT_ARRAY_STRIDE_ARB 0x86AA -#define GL_WEIGHT_ARRAY_SIZE_ARB 0x86AB -#define GL_WEIGHT_ARRAY_POINTER_ARB 0x86AC -#define GL_WEIGHT_ARRAY_ARB 0x86AD -#define GL_MODELVIEW0_ARB 0x1700 -#define GL_MODELVIEW1_ARB 0x850A -#define GL_MODELVIEW2_ARB 0x8722 -#define GL_MODELVIEW3_ARB 0x8723 -#define GL_MODELVIEW4_ARB 0x8724 -#define GL_MODELVIEW5_ARB 0x8725 -#define GL_MODELVIEW6_ARB 0x8726 -#define GL_MODELVIEW7_ARB 0x8727 -#define GL_MODELVIEW8_ARB 0x8728 -#define GL_MODELVIEW9_ARB 0x8729 -#define GL_MODELVIEW10_ARB 0x872A -#define GL_MODELVIEW11_ARB 0x872B -#define GL_MODELVIEW12_ARB 0x872C -#define GL_MODELVIEW13_ARB 0x872D -#define GL_MODELVIEW14_ARB 0x872E -#define GL_MODELVIEW15_ARB 0x872F -#define GL_MODELVIEW16_ARB 0x8730 -#define GL_MODELVIEW17_ARB 0x8731 -#define GL_MODELVIEW18_ARB 0x8732 -#define GL_MODELVIEW19_ARB 0x8733 -#define GL_MODELVIEW20_ARB 0x8734 -#define GL_MODELVIEW21_ARB 0x8735 -#define GL_MODELVIEW22_ARB 0x8736 -#define GL_MODELVIEW23_ARB 0x8737 -#define GL_MODELVIEW24_ARB 0x8738 -#define GL_MODELVIEW25_ARB 0x8739 -#define GL_MODELVIEW26_ARB 0x873A -#define GL_MODELVIEW27_ARB 0x873B -#define GL_MODELVIEW28_ARB 0x873C -#define GL_MODELVIEW29_ARB 0x873D -#define GL_MODELVIEW30_ARB 0x873E -#define GL_MODELVIEW31_ARB 0x873F -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_MATRIX_PALETTE_ARB 0x8840 -#define GL_MAX_MATRIX_PALETTE_STACK_DEPTH_ARB 0x8841 -#define GL_MAX_PALETTE_MATRICES_ARB 0x8842 -#define GL_CURRENT_PALETTE_MATRIX_ARB 0x8843 -#define GL_MATRIX_INDEX_ARRAY_ARB 0x8844 -#define GL_CURRENT_MATRIX_INDEX_ARB 0x8845 -#define GL_MATRIX_INDEX_ARRAY_SIZE_ARB 0x8846 -#define GL_MATRIX_INDEX_ARRAY_TYPE_ARB 0x8847 -#define GL_MATRIX_INDEX_ARRAY_STRIDE_ARB 0x8848 -#define GL_MATRIX_INDEX_ARRAY_POINTER_ARB 0x8849 -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_COMBINE_ARB 0x8570 -#define GL_COMBINE_RGB_ARB 0x8571 -#define GL_COMBINE_ALPHA_ARB 0x8572 -#define GL_SOURCE0_RGB_ARB 0x8580 -#define GL_SOURCE1_RGB_ARB 0x8581 -#define GL_SOURCE2_RGB_ARB 0x8582 -#define GL_SOURCE0_ALPHA_ARB 0x8588 -#define GL_SOURCE1_ALPHA_ARB 0x8589 -#define GL_SOURCE2_ALPHA_ARB 0x858A -#define GL_OPERAND0_RGB_ARB 0x8590 -#define GL_OPERAND1_RGB_ARB 0x8591 -#define GL_OPERAND2_RGB_ARB 0x8592 -#define GL_OPERAND0_ALPHA_ARB 0x8598 -#define GL_OPERAND1_ALPHA_ARB 0x8599 -#define GL_OPERAND2_ALPHA_ARB 0x859A -#define GL_RGB_SCALE_ARB 0x8573 -#define GL_ADD_SIGNED_ARB 0x8574 -#define GL_INTERPOLATE_ARB 0x8575 -#define GL_SUBTRACT_ARB 0x84E7 -#define GL_CONSTANT_ARB 0x8576 -#define GL_PRIMARY_COLOR_ARB 0x8577 -#define GL_PREVIOUS_ARB 0x8578 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_DOT3_RGB_ARB 0x86AE -#define GL_DOT3_RGBA_ARB 0x86AF -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_ARB 0x8370 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_DEPTH_COMPONENT16_ARB 0x81A5 -#define GL_DEPTH_COMPONENT24_ARB 0x81A6 -#define GL_DEPTH_COMPONENT32_ARB 0x81A7 -#define GL_TEXTURE_DEPTH_SIZE_ARB 0x884A -#define GL_DEPTH_TEXTURE_MODE_ARB 0x884B -#endif - -#ifndef GL_ARB_shadow -#define GL_TEXTURE_COMPARE_MODE_ARB 0x884C -#define GL_TEXTURE_COMPARE_FUNC_ARB 0x884D -#define GL_COMPARE_R_TO_TEXTURE_ARB 0x884E -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_TEXTURE_COMPARE_FAIL_VALUE_ARB 0x80BF -#endif - -#ifndef GL_ARB_window_pos -#endif - -#ifndef GL_ARB_vertex_program -#define GL_COLOR_SUM_ARB 0x8458 -#define GL_VERTEX_PROGRAM_ARB 0x8620 -#define GL_VERTEX_ATTRIB_ARRAY_ENABLED_ARB 0x8622 -#define GL_VERTEX_ATTRIB_ARRAY_SIZE_ARB 0x8623 -#define GL_VERTEX_ATTRIB_ARRAY_STRIDE_ARB 0x8624 -#define GL_VERTEX_ATTRIB_ARRAY_TYPE_ARB 0x8625 -#define GL_CURRENT_VERTEX_ATTRIB_ARB 0x8626 -#define GL_PROGRAM_LENGTH_ARB 0x8627 -#define GL_PROGRAM_STRING_ARB 0x8628 -#define GL_MAX_PROGRAM_MATRIX_STACK_DEPTH_ARB 0x862E -#define GL_MAX_PROGRAM_MATRICES_ARB 0x862F -#define GL_CURRENT_MATRIX_STACK_DEPTH_ARB 0x8640 -#define GL_CURRENT_MATRIX_ARB 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_ARB 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_ARB 0x8643 -#define GL_VERTEX_ATTRIB_ARRAY_POINTER_ARB 0x8645 -#define GL_PROGRAM_ERROR_POSITION_ARB 0x864B -#define GL_PROGRAM_BINDING_ARB 0x8677 -#define GL_MAX_VERTEX_ATTRIBS_ARB 0x8869 -#define GL_VERTEX_ATTRIB_ARRAY_NORMALIZED_ARB 0x886A -#define GL_PROGRAM_ERROR_STRING_ARB 0x8874 -#define GL_PROGRAM_FORMAT_ASCII_ARB 0x8875 -#define GL_PROGRAM_FORMAT_ARB 0x8876 -#define GL_PROGRAM_INSTRUCTIONS_ARB 0x88A0 -#define GL_MAX_PROGRAM_INSTRUCTIONS_ARB 0x88A1 -#define GL_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A2 -#define GL_MAX_PROGRAM_NATIVE_INSTRUCTIONS_ARB 0x88A3 -#define GL_PROGRAM_TEMPORARIES_ARB 0x88A4 -#define GL_MAX_PROGRAM_TEMPORARIES_ARB 0x88A5 -#define GL_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A6 -#define GL_MAX_PROGRAM_NATIVE_TEMPORARIES_ARB 0x88A7 -#define GL_PROGRAM_PARAMETERS_ARB 0x88A8 -#define GL_MAX_PROGRAM_PARAMETERS_ARB 0x88A9 -#define GL_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AA -#define GL_MAX_PROGRAM_NATIVE_PARAMETERS_ARB 0x88AB -#define GL_PROGRAM_ATTRIBS_ARB 0x88AC -#define GL_MAX_PROGRAM_ATTRIBS_ARB 0x88AD -#define GL_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AE -#define GL_MAX_PROGRAM_NATIVE_ATTRIBS_ARB 0x88AF -#define GL_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B0 -#define GL_MAX_PROGRAM_ADDRESS_REGISTERS_ARB 0x88B1 -#define GL_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B2 -#define GL_MAX_PROGRAM_NATIVE_ADDRESS_REGISTERS_ARB 0x88B3 -#define GL_MAX_PROGRAM_LOCAL_PARAMETERS_ARB 0x88B4 -#define GL_MAX_PROGRAM_ENV_PARAMETERS_ARB 0x88B5 -#define GL_PROGRAM_UNDER_NATIVE_LIMITS_ARB 0x88B6 -#define GL_TRANSPOSE_CURRENT_MATRIX_ARB 0x88B7 -#define GL_MATRIX0_ARB 0x88C0 -#define GL_MATRIX1_ARB 0x88C1 -#define GL_MATRIX2_ARB 0x88C2 -#define GL_MATRIX3_ARB 0x88C3 -#define GL_MATRIX4_ARB 0x88C4 -#define GL_MATRIX5_ARB 0x88C5 -#define GL_MATRIX6_ARB 0x88C6 -#define GL_MATRIX7_ARB 0x88C7 -#define GL_MATRIX8_ARB 0x88C8 -#define GL_MATRIX9_ARB 0x88C9 -#define GL_MATRIX10_ARB 0x88CA -#define GL_MATRIX11_ARB 0x88CB -#define GL_MATRIX12_ARB 0x88CC -#define GL_MATRIX13_ARB 0x88CD -#define GL_MATRIX14_ARB 0x88CE -#define GL_MATRIX15_ARB 0x88CF -#define GL_MATRIX16_ARB 0x88D0 -#define GL_MATRIX17_ARB 0x88D1 -#define GL_MATRIX18_ARB 0x88D2 -#define GL_MATRIX19_ARB 0x88D3 -#define GL_MATRIX20_ARB 0x88D4 -#define GL_MATRIX21_ARB 0x88D5 -#define GL_MATRIX22_ARB 0x88D6 -#define GL_MATRIX23_ARB 0x88D7 -#define GL_MATRIX24_ARB 0x88D8 -#define GL_MATRIX25_ARB 0x88D9 -#define GL_MATRIX26_ARB 0x88DA -#define GL_MATRIX27_ARB 0x88DB -#define GL_MATRIX28_ARB 0x88DC -#define GL_MATRIX29_ARB 0x88DD -#define GL_MATRIX30_ARB 0x88DE -#define GL_MATRIX31_ARB 0x88DF -#endif - -#ifndef GL_ARB_fragment_program -#define GL_FRAGMENT_PROGRAM_ARB 0x8804 -#define GL_PROGRAM_ALU_INSTRUCTIONS_ARB 0x8805 -#define GL_PROGRAM_TEX_INSTRUCTIONS_ARB 0x8806 -#define GL_PROGRAM_TEX_INDIRECTIONS_ARB 0x8807 -#define GL_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x8808 -#define GL_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x8809 -#define GL_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x880A -#define GL_MAX_PROGRAM_ALU_INSTRUCTIONS_ARB 0x880B -#define GL_MAX_PROGRAM_TEX_INSTRUCTIONS_ARB 0x880C -#define GL_MAX_PROGRAM_TEX_INDIRECTIONS_ARB 0x880D -#define GL_MAX_PROGRAM_NATIVE_ALU_INSTRUCTIONS_ARB 0x880E -#define GL_MAX_PROGRAM_NATIVE_TEX_INSTRUCTIONS_ARB 0x880F -#define GL_MAX_PROGRAM_NATIVE_TEX_INDIRECTIONS_ARB 0x8810 -#define GL_MAX_TEXTURE_COORDS_ARB 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_ARB 0x8872 -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_BUFFER_SIZE_ARB 0x8764 -#define GL_BUFFER_USAGE_ARB 0x8765 -#define GL_ARRAY_BUFFER_ARB 0x8892 -#define GL_ELEMENT_ARRAY_BUFFER_ARB 0x8893 -#define GL_ARRAY_BUFFER_BINDING_ARB 0x8894 -#define GL_ELEMENT_ARRAY_BUFFER_BINDING_ARB 0x8895 -#define GL_VERTEX_ARRAY_BUFFER_BINDING_ARB 0x8896 -#define GL_NORMAL_ARRAY_BUFFER_BINDING_ARB 0x8897 -#define GL_COLOR_ARRAY_BUFFER_BINDING_ARB 0x8898 -#define GL_INDEX_ARRAY_BUFFER_BINDING_ARB 0x8899 -#define GL_TEXTURE_COORD_ARRAY_BUFFER_BINDING_ARB 0x889A -#define GL_EDGE_FLAG_ARRAY_BUFFER_BINDING_ARB 0x889B -#define GL_SECONDARY_COLOR_ARRAY_BUFFER_BINDING_ARB 0x889C -#define GL_FOG_COORDINATE_ARRAY_BUFFER_BINDING_ARB 0x889D -#define GL_WEIGHT_ARRAY_BUFFER_BINDING_ARB 0x889E -#define GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING_ARB 0x889F -#define GL_READ_ONLY_ARB 0x88B8 -#define GL_WRITE_ONLY_ARB 0x88B9 -#define GL_READ_WRITE_ARB 0x88BA -#define GL_BUFFER_ACCESS_ARB 0x88BB -#define GL_BUFFER_MAPPED_ARB 0x88BC -#define GL_BUFFER_MAP_POINTER_ARB 0x88BD -#define GL_STREAM_DRAW_ARB 0x88E0 -#define GL_STREAM_READ_ARB 0x88E1 -#define GL_STREAM_COPY_ARB 0x88E2 -#define GL_STATIC_DRAW_ARB 0x88E4 -#define GL_STATIC_READ_ARB 0x88E5 -#define GL_STATIC_COPY_ARB 0x88E6 -#define GL_DYNAMIC_DRAW_ARB 0x88E8 -#define GL_DYNAMIC_READ_ARB 0x88E9 -#define GL_DYNAMIC_COPY_ARB 0x88EA -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_QUERY_COUNTER_BITS_ARB 0x8864 -#define GL_CURRENT_QUERY_ARB 0x8865 -#define GL_QUERY_RESULT_ARB 0x8866 -#define GL_QUERY_RESULT_AVAILABLE_ARB 0x8867 -#define GL_SAMPLES_PASSED_ARB 0x8914 -#endif - -#ifndef GL_ARB_shader_objects -#define GL_PROGRAM_OBJECT_ARB 0x8B40 -#define GL_SHADER_OBJECT_ARB 0x8B48 -#define GL_OBJECT_TYPE_ARB 0x8B4E -#define GL_OBJECT_SUBTYPE_ARB 0x8B4F -#define GL_FLOAT_VEC2_ARB 0x8B50 -#define GL_FLOAT_VEC3_ARB 0x8B51 -#define GL_FLOAT_VEC4_ARB 0x8B52 -#define GL_INT_VEC2_ARB 0x8B53 -#define GL_INT_VEC3_ARB 0x8B54 -#define GL_INT_VEC4_ARB 0x8B55 -#define GL_BOOL_ARB 0x8B56 -#define GL_BOOL_VEC2_ARB 0x8B57 -#define GL_BOOL_VEC3_ARB 0x8B58 -#define GL_BOOL_VEC4_ARB 0x8B59 -#define GL_FLOAT_MAT2_ARB 0x8B5A -#define GL_FLOAT_MAT3_ARB 0x8B5B -#define GL_FLOAT_MAT4_ARB 0x8B5C -#define GL_SAMPLER_1D_ARB 0x8B5D -#define GL_SAMPLER_2D_ARB 0x8B5E -#define GL_SAMPLER_3D_ARB 0x8B5F -#define GL_SAMPLER_CUBE_ARB 0x8B60 -#define GL_SAMPLER_1D_SHADOW_ARB 0x8B61 -#define GL_SAMPLER_2D_SHADOW_ARB 0x8B62 -#define GL_SAMPLER_2D_RECT_ARB 0x8B63 -#define GL_SAMPLER_2D_RECT_SHADOW_ARB 0x8B64 -#define GL_OBJECT_DELETE_STATUS_ARB 0x8B80 -#define GL_OBJECT_COMPILE_STATUS_ARB 0x8B81 -#define GL_OBJECT_LINK_STATUS_ARB 0x8B82 -#define GL_OBJECT_VALIDATE_STATUS_ARB 0x8B83 -#define GL_OBJECT_INFO_LOG_LENGTH_ARB 0x8B84 -#define GL_OBJECT_ATTACHED_OBJECTS_ARB 0x8B85 -#define GL_OBJECT_ACTIVE_UNIFORMS_ARB 0x8B86 -#define GL_OBJECT_ACTIVE_UNIFORM_MAX_LENGTH_ARB 0x8B87 -#define GL_OBJECT_SHADER_SOURCE_LENGTH_ARB 0x8B88 -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_VERTEX_SHADER_ARB 0x8B31 -#define GL_MAX_VERTEX_UNIFORM_COMPONENTS_ARB 0x8B4A -#define GL_MAX_VARYING_FLOATS_ARB 0x8B4B -#define GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB 0x8B4C -#define GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS_ARB 0x8B4D -#define GL_OBJECT_ACTIVE_ATTRIBUTES_ARB 0x8B89 -#define GL_OBJECT_ACTIVE_ATTRIBUTE_MAX_LENGTH_ARB 0x8B8A -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_FRAGMENT_SHADER_ARB 0x8B30 -#define GL_MAX_FRAGMENT_UNIFORM_COMPONENTS_ARB 0x8B49 -#define GL_FRAGMENT_SHADER_DERIVATIVE_HINT_ARB 0x8B8B -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_SHADING_LANGUAGE_VERSION_ARB 0x8B8C -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#endif - -#ifndef GL_ARB_point_sprite -#define GL_POINT_SPRITE_ARB 0x8861 -#define GL_COORD_REPLACE_ARB 0x8862 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ARB 0x8824 -#define GL_DRAW_BUFFER0_ARB 0x8825 -#define GL_DRAW_BUFFER1_ARB 0x8826 -#define GL_DRAW_BUFFER2_ARB 0x8827 -#define GL_DRAW_BUFFER3_ARB 0x8828 -#define GL_DRAW_BUFFER4_ARB 0x8829 -#define GL_DRAW_BUFFER5_ARB 0x882A -#define GL_DRAW_BUFFER6_ARB 0x882B -#define GL_DRAW_BUFFER7_ARB 0x882C -#define GL_DRAW_BUFFER8_ARB 0x882D -#define GL_DRAW_BUFFER9_ARB 0x882E -#define GL_DRAW_BUFFER10_ARB 0x882F -#define GL_DRAW_BUFFER11_ARB 0x8830 -#define GL_DRAW_BUFFER12_ARB 0x8831 -#define GL_DRAW_BUFFER13_ARB 0x8832 -#define GL_DRAW_BUFFER14_ARB 0x8833 -#define GL_DRAW_BUFFER15_ARB 0x8834 -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_TEXTURE_RECTANGLE_ARB 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_ARB 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_ARB 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_ARB 0x84F8 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_RGBA_FLOAT_MODE_ARB 0x8820 -#define GL_CLAMP_VERTEX_COLOR_ARB 0x891A -#define GL_CLAMP_FRAGMENT_COLOR_ARB 0x891B -#define GL_CLAMP_READ_COLOR_ARB 0x891C -#define GL_FIXED_ONLY_ARB 0x891D -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_HALF_FLOAT_ARB 0x140B -#endif - -#ifndef GL_ARB_texture_float -#define GL_TEXTURE_RED_TYPE_ARB 0x8C10 -#define GL_TEXTURE_GREEN_TYPE_ARB 0x8C11 -#define GL_TEXTURE_BLUE_TYPE_ARB 0x8C12 -#define GL_TEXTURE_ALPHA_TYPE_ARB 0x8C13 -#define GL_TEXTURE_LUMINANCE_TYPE_ARB 0x8C14 -#define GL_TEXTURE_INTENSITY_TYPE_ARB 0x8C15 -#define GL_TEXTURE_DEPTH_TYPE_ARB 0x8C16 -#define GL_UNSIGNED_NORMALIZED_ARB 0x8C17 -#define GL_RGBA32F_ARB 0x8814 -#define GL_RGB32F_ARB 0x8815 -#define GL_ALPHA32F_ARB 0x8816 -#define GL_INTENSITY32F_ARB 0x8817 -#define GL_LUMINANCE32F_ARB 0x8818 -#define GL_LUMINANCE_ALPHA32F_ARB 0x8819 -#define GL_RGBA16F_ARB 0x881A -#define GL_RGB16F_ARB 0x881B -#define GL_ALPHA16F_ARB 0x881C -#define GL_INTENSITY16F_ARB 0x881D -#define GL_LUMINANCE16F_ARB 0x881E -#define GL_LUMINANCE_ALPHA16F_ARB 0x881F -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_ARB 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_ARB 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_ARB 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_ARB 0x88EF -#endif - -#ifndef GL_EXT_abgr -#define GL_ABGR_EXT 0x8000 -#endif - -#ifndef GL_EXT_blend_color -#define GL_CONSTANT_COLOR_EXT 0x8001 -#define GL_ONE_MINUS_CONSTANT_COLOR_EXT 0x8002 -#define GL_CONSTANT_ALPHA_EXT 0x8003 -#define GL_ONE_MINUS_CONSTANT_ALPHA_EXT 0x8004 -#define GL_BLEND_COLOR_EXT 0x8005 -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_POLYGON_OFFSET_EXT 0x8037 -#define GL_POLYGON_OFFSET_FACTOR_EXT 0x8038 -#define GL_POLYGON_OFFSET_BIAS_EXT 0x8039 -#endif - -#ifndef GL_EXT_texture -#define GL_ALPHA4_EXT 0x803B -#define GL_ALPHA8_EXT 0x803C -#define GL_ALPHA12_EXT 0x803D -#define GL_ALPHA16_EXT 0x803E -#define GL_LUMINANCE4_EXT 0x803F -#define GL_LUMINANCE8_EXT 0x8040 -#define GL_LUMINANCE12_EXT 0x8041 -#define GL_LUMINANCE16_EXT 0x8042 -#define GL_LUMINANCE4_ALPHA4_EXT 0x8043 -#define GL_LUMINANCE6_ALPHA2_EXT 0x8044 -#define GL_LUMINANCE8_ALPHA8_EXT 0x8045 -#define GL_LUMINANCE12_ALPHA4_EXT 0x8046 -#define GL_LUMINANCE12_ALPHA12_EXT 0x8047 -#define GL_LUMINANCE16_ALPHA16_EXT 0x8048 -#define GL_INTENSITY_EXT 0x8049 -#define GL_INTENSITY4_EXT 0x804A -#define GL_INTENSITY8_EXT 0x804B -#define GL_INTENSITY12_EXT 0x804C -#define GL_INTENSITY16_EXT 0x804D -#define GL_RGB2_EXT 0x804E -#define GL_RGB4_EXT 0x804F -#define GL_RGB5_EXT 0x8050 -#define GL_RGB8_EXT 0x8051 -#define GL_RGB10_EXT 0x8052 -#define GL_RGB12_EXT 0x8053 -#define GL_RGB16_EXT 0x8054 -#define GL_RGBA2_EXT 0x8055 -#define GL_RGBA4_EXT 0x8056 -#define GL_RGB5_A1_EXT 0x8057 -#define GL_RGBA8_EXT 0x8058 -#define GL_RGB10_A2_EXT 0x8059 -#define GL_RGBA12_EXT 0x805A -#define GL_RGBA16_EXT 0x805B -#define GL_TEXTURE_RED_SIZE_EXT 0x805C -#define GL_TEXTURE_GREEN_SIZE_EXT 0x805D -#define GL_TEXTURE_BLUE_SIZE_EXT 0x805E -#define GL_TEXTURE_ALPHA_SIZE_EXT 0x805F -#define GL_TEXTURE_LUMINANCE_SIZE_EXT 0x8060 -#define GL_TEXTURE_INTENSITY_SIZE_EXT 0x8061 -#define GL_REPLACE_EXT 0x8062 -#define GL_PROXY_TEXTURE_1D_EXT 0x8063 -#define GL_PROXY_TEXTURE_2D_EXT 0x8064 -#define GL_TEXTURE_TOO_LARGE_EXT 0x8065 -#endif - -#ifndef GL_EXT_texture3D -#define GL_PACK_SKIP_IMAGES_EXT 0x806B -#define GL_PACK_IMAGE_HEIGHT_EXT 0x806C -#define GL_UNPACK_SKIP_IMAGES_EXT 0x806D -#define GL_UNPACK_IMAGE_HEIGHT_EXT 0x806E -#define GL_TEXTURE_3D_EXT 0x806F -#define GL_PROXY_TEXTURE_3D_EXT 0x8070 -#define GL_TEXTURE_DEPTH_EXT 0x8071 -#define GL_TEXTURE_WRAP_R_EXT 0x8072 -#define GL_MAX_3D_TEXTURE_SIZE_EXT 0x8073 -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_FILTER4_SGIS 0x8146 -#define GL_TEXTURE_FILTER4_SIZE_SGIS 0x8147 -#endif - -#ifndef GL_EXT_subtexture -#endif - -#ifndef GL_EXT_copy_texture -#endif - -#ifndef GL_EXT_histogram -#define GL_HISTOGRAM_EXT 0x8024 -#define GL_PROXY_HISTOGRAM_EXT 0x8025 -#define GL_HISTOGRAM_WIDTH_EXT 0x8026 -#define GL_HISTOGRAM_FORMAT_EXT 0x8027 -#define GL_HISTOGRAM_RED_SIZE_EXT 0x8028 -#define GL_HISTOGRAM_GREEN_SIZE_EXT 0x8029 -#define GL_HISTOGRAM_BLUE_SIZE_EXT 0x802A -#define GL_HISTOGRAM_ALPHA_SIZE_EXT 0x802B -#define GL_HISTOGRAM_LUMINANCE_SIZE_EXT 0x802C -#define GL_HISTOGRAM_SINK_EXT 0x802D -#define GL_MINMAX_EXT 0x802E -#define GL_MINMAX_FORMAT_EXT 0x802F -#define GL_MINMAX_SINK_EXT 0x8030 -#define GL_TABLE_TOO_LARGE_EXT 0x8031 -#endif - -#ifndef GL_EXT_convolution -#define GL_CONVOLUTION_1D_EXT 0x8010 -#define GL_CONVOLUTION_2D_EXT 0x8011 -#define GL_SEPARABLE_2D_EXT 0x8012 -#define GL_CONVOLUTION_BORDER_MODE_EXT 0x8013 -#define GL_CONVOLUTION_FILTER_SCALE_EXT 0x8014 -#define GL_CONVOLUTION_FILTER_BIAS_EXT 0x8015 -#define GL_REDUCE_EXT 0x8016 -#define GL_CONVOLUTION_FORMAT_EXT 0x8017 -#define GL_CONVOLUTION_WIDTH_EXT 0x8018 -#define GL_CONVOLUTION_HEIGHT_EXT 0x8019 -#define GL_MAX_CONVOLUTION_WIDTH_EXT 0x801A -#define GL_MAX_CONVOLUTION_HEIGHT_EXT 0x801B -#define GL_POST_CONVOLUTION_RED_SCALE_EXT 0x801C -#define GL_POST_CONVOLUTION_GREEN_SCALE_EXT 0x801D -#define GL_POST_CONVOLUTION_BLUE_SCALE_EXT 0x801E -#define GL_POST_CONVOLUTION_ALPHA_SCALE_EXT 0x801F -#define GL_POST_CONVOLUTION_RED_BIAS_EXT 0x8020 -#define GL_POST_CONVOLUTION_GREEN_BIAS_EXT 0x8021 -#define GL_POST_CONVOLUTION_BLUE_BIAS_EXT 0x8022 -#define GL_POST_CONVOLUTION_ALPHA_BIAS_EXT 0x8023 -#endif - -#ifndef GL_SGI_color_matrix -#define GL_COLOR_MATRIX_SGI 0x80B1 -#define GL_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B2 -#define GL_MAX_COLOR_MATRIX_STACK_DEPTH_SGI 0x80B3 -#define GL_POST_COLOR_MATRIX_RED_SCALE_SGI 0x80B4 -#define GL_POST_COLOR_MATRIX_GREEN_SCALE_SGI 0x80B5 -#define GL_POST_COLOR_MATRIX_BLUE_SCALE_SGI 0x80B6 -#define GL_POST_COLOR_MATRIX_ALPHA_SCALE_SGI 0x80B7 -#define GL_POST_COLOR_MATRIX_RED_BIAS_SGI 0x80B8 -#define GL_POST_COLOR_MATRIX_GREEN_BIAS_SGI 0x80B9 -#define GL_POST_COLOR_MATRIX_BLUE_BIAS_SGI 0x80BA -#define GL_POST_COLOR_MATRIX_ALPHA_BIAS_SGI 0x80BB -#endif - -#ifndef GL_SGI_color_table -#define GL_COLOR_TABLE_SGI 0x80D0 -#define GL_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D1 -#define GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D2 -#define GL_PROXY_COLOR_TABLE_SGI 0x80D3 -#define GL_PROXY_POST_CONVOLUTION_COLOR_TABLE_SGI 0x80D4 -#define GL_PROXY_POST_COLOR_MATRIX_COLOR_TABLE_SGI 0x80D5 -#define GL_COLOR_TABLE_SCALE_SGI 0x80D6 -#define GL_COLOR_TABLE_BIAS_SGI 0x80D7 -#define GL_COLOR_TABLE_FORMAT_SGI 0x80D8 -#define GL_COLOR_TABLE_WIDTH_SGI 0x80D9 -#define GL_COLOR_TABLE_RED_SIZE_SGI 0x80DA -#define GL_COLOR_TABLE_GREEN_SIZE_SGI 0x80DB -#define GL_COLOR_TABLE_BLUE_SIZE_SGI 0x80DC -#define GL_COLOR_TABLE_ALPHA_SIZE_SGI 0x80DD -#define GL_COLOR_TABLE_LUMINANCE_SIZE_SGI 0x80DE -#define GL_COLOR_TABLE_INTENSITY_SIZE_SGI 0x80DF -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_PIXEL_TEXTURE_SGIS 0x8353 -#define GL_PIXEL_FRAGMENT_RGB_SOURCE_SGIS 0x8354 -#define GL_PIXEL_FRAGMENT_ALPHA_SOURCE_SGIS 0x8355 -#define GL_PIXEL_GROUP_COLOR_SGIS 0x8356 -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_PIXEL_TEX_GEN_SGIX 0x8139 -#define GL_PIXEL_TEX_GEN_MODE_SGIX 0x832B -#endif - -#ifndef GL_SGIS_texture4D -#define GL_PACK_SKIP_VOLUMES_SGIS 0x8130 -#define GL_PACK_IMAGE_DEPTH_SGIS 0x8131 -#define GL_UNPACK_SKIP_VOLUMES_SGIS 0x8132 -#define GL_UNPACK_IMAGE_DEPTH_SGIS 0x8133 -#define GL_TEXTURE_4D_SGIS 0x8134 -#define GL_PROXY_TEXTURE_4D_SGIS 0x8135 -#define GL_TEXTURE_4DSIZE_SGIS 0x8136 -#define GL_TEXTURE_WRAP_Q_SGIS 0x8137 -#define GL_MAX_4D_TEXTURE_SIZE_SGIS 0x8138 -#define GL_TEXTURE_4D_BINDING_SGIS 0x814F -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_TEXTURE_COLOR_TABLE_SGI 0x80BC -#define GL_PROXY_TEXTURE_COLOR_TABLE_SGI 0x80BD -#endif - -#ifndef GL_EXT_cmyka -#define GL_CMYK_EXT 0x800C -#define GL_CMYKA_EXT 0x800D -#define GL_PACK_CMYK_HINT_EXT 0x800E -#define GL_UNPACK_CMYK_HINT_EXT 0x800F -#endif - -#ifndef GL_EXT_texture_object -#define GL_TEXTURE_PRIORITY_EXT 0x8066 -#define GL_TEXTURE_RESIDENT_EXT 0x8067 -#define GL_TEXTURE_1D_BINDING_EXT 0x8068 -#define GL_TEXTURE_2D_BINDING_EXT 0x8069 -#define GL_TEXTURE_3D_BINDING_EXT 0x806A -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_DETAIL_TEXTURE_2D_SGIS 0x8095 -#define GL_DETAIL_TEXTURE_2D_BINDING_SGIS 0x8096 -#define GL_LINEAR_DETAIL_SGIS 0x8097 -#define GL_LINEAR_DETAIL_ALPHA_SGIS 0x8098 -#define GL_LINEAR_DETAIL_COLOR_SGIS 0x8099 -#define GL_DETAIL_TEXTURE_LEVEL_SGIS 0x809A -#define GL_DETAIL_TEXTURE_MODE_SGIS 0x809B -#define GL_DETAIL_TEXTURE_FUNC_POINTS_SGIS 0x809C -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_LINEAR_SHARPEN_SGIS 0x80AD -#define GL_LINEAR_SHARPEN_ALPHA_SGIS 0x80AE -#define GL_LINEAR_SHARPEN_COLOR_SGIS 0x80AF -#define GL_SHARPEN_TEXTURE_FUNC_POINTS_SGIS 0x80B0 -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_UNSIGNED_BYTE_3_3_2_EXT 0x8032 -#define GL_UNSIGNED_SHORT_4_4_4_4_EXT 0x8033 -#define GL_UNSIGNED_SHORT_5_5_5_1_EXT 0x8034 -#define GL_UNSIGNED_INT_8_8_8_8_EXT 0x8035 -#define GL_UNSIGNED_INT_10_10_10_2_EXT 0x8036 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_TEXTURE_MIN_LOD_SGIS 0x813A -#define GL_TEXTURE_MAX_LOD_SGIS 0x813B -#define GL_TEXTURE_BASE_LEVEL_SGIS 0x813C -#define GL_TEXTURE_MAX_LEVEL_SGIS 0x813D -#endif - -#ifndef GL_SGIS_multisample -#define GL_MULTISAMPLE_SGIS 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_SGIS 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_SGIS 0x809F -#define GL_SAMPLE_MASK_SGIS 0x80A0 -#define GL_1PASS_SGIS 0x80A1 -#define GL_2PASS_0_SGIS 0x80A2 -#define GL_2PASS_1_SGIS 0x80A3 -#define GL_4PASS_0_SGIS 0x80A4 -#define GL_4PASS_1_SGIS 0x80A5 -#define GL_4PASS_2_SGIS 0x80A6 -#define GL_4PASS_3_SGIS 0x80A7 -#define GL_SAMPLE_BUFFERS_SGIS 0x80A8 -#define GL_SAMPLES_SGIS 0x80A9 -#define GL_SAMPLE_MASK_VALUE_SGIS 0x80AA -#define GL_SAMPLE_MASK_INVERT_SGIS 0x80AB -#define GL_SAMPLE_PATTERN_SGIS 0x80AC -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_RESCALE_NORMAL_EXT 0x803A -#endif - -#ifndef GL_EXT_vertex_array -#define GL_VERTEX_ARRAY_EXT 0x8074 -#define GL_NORMAL_ARRAY_EXT 0x8075 -#define GL_COLOR_ARRAY_EXT 0x8076 -#define GL_INDEX_ARRAY_EXT 0x8077 -#define GL_TEXTURE_COORD_ARRAY_EXT 0x8078 -#define GL_EDGE_FLAG_ARRAY_EXT 0x8079 -#define GL_VERTEX_ARRAY_SIZE_EXT 0x807A -#define GL_VERTEX_ARRAY_TYPE_EXT 0x807B -#define GL_VERTEX_ARRAY_STRIDE_EXT 0x807C -#define GL_VERTEX_ARRAY_COUNT_EXT 0x807D -#define GL_NORMAL_ARRAY_TYPE_EXT 0x807E -#define GL_NORMAL_ARRAY_STRIDE_EXT 0x807F -#define GL_NORMAL_ARRAY_COUNT_EXT 0x8080 -#define GL_COLOR_ARRAY_SIZE_EXT 0x8081 -#define GL_COLOR_ARRAY_TYPE_EXT 0x8082 -#define GL_COLOR_ARRAY_STRIDE_EXT 0x8083 -#define GL_COLOR_ARRAY_COUNT_EXT 0x8084 -#define GL_INDEX_ARRAY_TYPE_EXT 0x8085 -#define GL_INDEX_ARRAY_STRIDE_EXT 0x8086 -#define GL_INDEX_ARRAY_COUNT_EXT 0x8087 -#define GL_TEXTURE_COORD_ARRAY_SIZE_EXT 0x8088 -#define GL_TEXTURE_COORD_ARRAY_TYPE_EXT 0x8089 -#define GL_TEXTURE_COORD_ARRAY_STRIDE_EXT 0x808A -#define GL_TEXTURE_COORD_ARRAY_COUNT_EXT 0x808B -#define GL_EDGE_FLAG_ARRAY_STRIDE_EXT 0x808C -#define GL_EDGE_FLAG_ARRAY_COUNT_EXT 0x808D -#define GL_VERTEX_ARRAY_POINTER_EXT 0x808E -#define GL_NORMAL_ARRAY_POINTER_EXT 0x808F -#define GL_COLOR_ARRAY_POINTER_EXT 0x8090 -#define GL_INDEX_ARRAY_POINTER_EXT 0x8091 -#define GL_TEXTURE_COORD_ARRAY_POINTER_EXT 0x8092 -#define GL_EDGE_FLAG_ARRAY_POINTER_EXT 0x8093 -#endif - -#ifndef GL_EXT_misc_attribute -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_GENERATE_MIPMAP_SGIS 0x8191 -#define GL_GENERATE_MIPMAP_HINT_SGIS 0x8192 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_LINEAR_CLIPMAP_LINEAR_SGIX 0x8170 -#define GL_TEXTURE_CLIPMAP_CENTER_SGIX 0x8171 -#define GL_TEXTURE_CLIPMAP_FRAME_SGIX 0x8172 -#define GL_TEXTURE_CLIPMAP_OFFSET_SGIX 0x8173 -#define GL_TEXTURE_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8174 -#define GL_TEXTURE_CLIPMAP_LOD_OFFSET_SGIX 0x8175 -#define GL_TEXTURE_CLIPMAP_DEPTH_SGIX 0x8176 -#define GL_MAX_CLIPMAP_DEPTH_SGIX 0x8177 -#define GL_MAX_CLIPMAP_VIRTUAL_DEPTH_SGIX 0x8178 -#define GL_NEAREST_CLIPMAP_NEAREST_SGIX 0x844D -#define GL_NEAREST_CLIPMAP_LINEAR_SGIX 0x844E -#define GL_LINEAR_CLIPMAP_NEAREST_SGIX 0x844F -#endif - -#ifndef GL_SGIX_shadow -#define GL_TEXTURE_COMPARE_SGIX 0x819A -#define GL_TEXTURE_COMPARE_OPERATOR_SGIX 0x819B -#define GL_TEXTURE_LEQUAL_R_SGIX 0x819C -#define GL_TEXTURE_GEQUAL_R_SGIX 0x819D -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_CLAMP_TO_EDGE_SGIS 0x812F -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_CLAMP_TO_BORDER_SGIS 0x812D -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_FUNC_ADD_EXT 0x8006 -#define GL_MIN_EXT 0x8007 -#define GL_MAX_EXT 0x8008 -#define GL_BLEND_EQUATION_EXT 0x8009 -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_FUNC_SUBTRACT_EXT 0x800A -#define GL_FUNC_REVERSE_SUBTRACT_EXT 0x800B -#endif - -#ifndef GL_EXT_blend_logic_op -#endif - -#ifndef GL_SGIX_interlace -#define GL_INTERLACE_SGIX 0x8094 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_PIXEL_TILE_BEST_ALIGNMENT_SGIX 0x813E -#define GL_PIXEL_TILE_CACHE_INCREMENT_SGIX 0x813F -#define GL_PIXEL_TILE_WIDTH_SGIX 0x8140 -#define GL_PIXEL_TILE_HEIGHT_SGIX 0x8141 -#define GL_PIXEL_TILE_GRID_WIDTH_SGIX 0x8142 -#define GL_PIXEL_TILE_GRID_HEIGHT_SGIX 0x8143 -#define GL_PIXEL_TILE_GRID_DEPTH_SGIX 0x8144 -#define GL_PIXEL_TILE_CACHE_SIZE_SGIX 0x8145 -#endif - -#ifndef GL_SGIS_texture_select -#define GL_DUAL_ALPHA4_SGIS 0x8110 -#define GL_DUAL_ALPHA8_SGIS 0x8111 -#define GL_DUAL_ALPHA12_SGIS 0x8112 -#define GL_DUAL_ALPHA16_SGIS 0x8113 -#define GL_DUAL_LUMINANCE4_SGIS 0x8114 -#define GL_DUAL_LUMINANCE8_SGIS 0x8115 -#define GL_DUAL_LUMINANCE12_SGIS 0x8116 -#define GL_DUAL_LUMINANCE16_SGIS 0x8117 -#define GL_DUAL_INTENSITY4_SGIS 0x8118 -#define GL_DUAL_INTENSITY8_SGIS 0x8119 -#define GL_DUAL_INTENSITY12_SGIS 0x811A -#define GL_DUAL_INTENSITY16_SGIS 0x811B -#define GL_DUAL_LUMINANCE_ALPHA4_SGIS 0x811C -#define GL_DUAL_LUMINANCE_ALPHA8_SGIS 0x811D -#define GL_QUAD_ALPHA4_SGIS 0x811E -#define GL_QUAD_ALPHA8_SGIS 0x811F -#define GL_QUAD_LUMINANCE4_SGIS 0x8120 -#define GL_QUAD_LUMINANCE8_SGIS 0x8121 -#define GL_QUAD_INTENSITY4_SGIS 0x8122 -#define GL_QUAD_INTENSITY8_SGIS 0x8123 -#define GL_DUAL_TEXTURE_SELECT_SGIS 0x8124 -#define GL_QUAD_TEXTURE_SELECT_SGIS 0x8125 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SPRITE_SGIX 0x8148 -#define GL_SPRITE_MODE_SGIX 0x8149 -#define GL_SPRITE_AXIS_SGIX 0x814A -#define GL_SPRITE_TRANSLATION_SGIX 0x814B -#define GL_SPRITE_AXIAL_SGIX 0x814C -#define GL_SPRITE_OBJECT_ALIGNED_SGIX 0x814D -#define GL_SPRITE_EYE_ALIGNED_SGIX 0x814E -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_TEXTURE_MULTI_BUFFER_HINT_SGIX 0x812E -#endif - -#ifndef GL_EXT_point_parameters -#define GL_POINT_SIZE_MIN_EXT 0x8126 -#define GL_POINT_SIZE_MAX_EXT 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_EXT 0x8128 -#define GL_DISTANCE_ATTENUATION_EXT 0x8129 -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_POINT_SIZE_MIN_SGIS 0x8126 -#define GL_POINT_SIZE_MAX_SGIS 0x8127 -#define GL_POINT_FADE_THRESHOLD_SIZE_SGIS 0x8128 -#define GL_DISTANCE_ATTENUATION_SGIS 0x8129 -#endif - -#ifndef GL_SGIX_instruments -#define GL_INSTRUMENT_BUFFER_POINTER_SGIX 0x8180 -#define GL_INSTRUMENT_MEASUREMENTS_SGIX 0x8181 -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_POST_TEXTURE_FILTER_BIAS_SGIX 0x8179 -#define GL_POST_TEXTURE_FILTER_SCALE_SGIX 0x817A -#define GL_POST_TEXTURE_FILTER_BIAS_RANGE_SGIX 0x817B -#define GL_POST_TEXTURE_FILTER_SCALE_RANGE_SGIX 0x817C -#endif - -#ifndef GL_SGIX_framezoom -#define GL_FRAMEZOOM_SGIX 0x818B -#define GL_FRAMEZOOM_FACTOR_SGIX 0x818C -#define GL_MAX_FRAMEZOOM_FACTOR_SGIX 0x818D -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#endif - -#ifndef GL_FfdMaskSGIX -#define GL_TEXTURE_DEFORMATION_BIT_SGIX 0x00000001 -#define GL_GEOMETRY_DEFORMATION_BIT_SGIX 0x00000002 -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_GEOMETRY_DEFORMATION_SGIX 0x8194 -#define GL_TEXTURE_DEFORMATION_SGIX 0x8195 -#define GL_DEFORMATIONS_MASK_SGIX 0x8196 -#define GL_MAX_DEFORMATION_ORDER_SGIX 0x8197 -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_REFERENCE_PLANE_SGIX 0x817D -#define GL_REFERENCE_PLANE_EQUATION_SGIX 0x817E -#endif - -#ifndef GL_SGIX_flush_raster -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_DEPTH_COMPONENT16_SGIX 0x81A5 -#define GL_DEPTH_COMPONENT24_SGIX 0x81A6 -#define GL_DEPTH_COMPONENT32_SGIX 0x81A7 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_FOG_FUNC_SGIS 0x812A -#define GL_FOG_FUNC_POINTS_SGIS 0x812B -#define GL_MAX_FOG_FUNC_POINTS_SGIS 0x812C -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_FOG_OFFSET_SGIX 0x8198 -#define GL_FOG_OFFSET_VALUE_SGIX 0x8199 -#endif - -#ifndef GL_HP_image_transform -#define GL_IMAGE_SCALE_X_HP 0x8155 -#define GL_IMAGE_SCALE_Y_HP 0x8156 -#define GL_IMAGE_TRANSLATE_X_HP 0x8157 -#define GL_IMAGE_TRANSLATE_Y_HP 0x8158 -#define GL_IMAGE_ROTATE_ANGLE_HP 0x8159 -#define GL_IMAGE_ROTATE_ORIGIN_X_HP 0x815A -#define GL_IMAGE_ROTATE_ORIGIN_Y_HP 0x815B -#define GL_IMAGE_MAG_FILTER_HP 0x815C -#define GL_IMAGE_MIN_FILTER_HP 0x815D -#define GL_IMAGE_CUBIC_WEIGHT_HP 0x815E -#define GL_CUBIC_HP 0x815F -#define GL_AVERAGE_HP 0x8160 -#define GL_IMAGE_TRANSFORM_2D_HP 0x8161 -#define GL_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8162 -#define GL_PROXY_POST_IMAGE_TRANSFORM_COLOR_TABLE_HP 0x8163 -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_IGNORE_BORDER_HP 0x8150 -#define GL_CONSTANT_BORDER_HP 0x8151 -#define GL_REPLICATE_BORDER_HP 0x8153 -#define GL_CONVOLUTION_BORDER_COLOR_HP 0x8154 -#endif - -#ifndef GL_INGR_palette_buffer -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_TEXTURE_ENV_BIAS_SGIX 0x80BE -#endif - -#ifndef GL_EXT_color_subtable -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_VERTEX_DATA_HINT_PGI 0x1A22A -#define GL_VERTEX_CONSISTENT_HINT_PGI 0x1A22B -#define GL_MATERIAL_SIDE_HINT_PGI 0x1A22C -#define GL_MAX_VERTEX_HINT_PGI 0x1A22D -#define GL_COLOR3_BIT_PGI 0x00010000 -#define GL_COLOR4_BIT_PGI 0x00020000 -#define GL_EDGEFLAG_BIT_PGI 0x00040000 -#define GL_INDEX_BIT_PGI 0x00080000 -#define GL_MAT_AMBIENT_BIT_PGI 0x00100000 -#define GL_MAT_AMBIENT_AND_DIFFUSE_BIT_PGI 0x00200000 -#define GL_MAT_DIFFUSE_BIT_PGI 0x00400000 -#define GL_MAT_EMISSION_BIT_PGI 0x00800000 -#define GL_MAT_COLOR_INDEXES_BIT_PGI 0x01000000 -#define GL_MAT_SHININESS_BIT_PGI 0x02000000 -#define GL_MAT_SPECULAR_BIT_PGI 0x04000000 -#define GL_NORMAL_BIT_PGI 0x08000000 -#define GL_TEXCOORD1_BIT_PGI 0x10000000 -#define GL_TEXCOORD2_BIT_PGI 0x20000000 -#define GL_TEXCOORD3_BIT_PGI 0x40000000 -#define GL_TEXCOORD4_BIT_PGI 0x80000000 -#define GL_VERTEX23_BIT_PGI 0x00000004 -#define GL_VERTEX4_BIT_PGI 0x00000008 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PREFER_DOUBLEBUFFER_HINT_PGI 0x1A1F8 -#define GL_CONSERVE_MEMORY_HINT_PGI 0x1A1FD -#define GL_RECLAIM_MEMORY_HINT_PGI 0x1A1FE -#define GL_NATIVE_GRAPHICS_HANDLE_PGI 0x1A202 -#define GL_NATIVE_GRAPHICS_BEGIN_HINT_PGI 0x1A203 -#define GL_NATIVE_GRAPHICS_END_HINT_PGI 0x1A204 -#define GL_ALWAYS_FAST_HINT_PGI 0x1A20C -#define GL_ALWAYS_SOFT_HINT_PGI 0x1A20D -#define GL_ALLOW_DRAW_OBJ_HINT_PGI 0x1A20E -#define GL_ALLOW_DRAW_WIN_HINT_PGI 0x1A20F -#define GL_ALLOW_DRAW_FRG_HINT_PGI 0x1A210 -#define GL_ALLOW_DRAW_MEM_HINT_PGI 0x1A211 -#define GL_STRICT_DEPTHFUNC_HINT_PGI 0x1A216 -#define GL_STRICT_LIGHTING_HINT_PGI 0x1A217 -#define GL_STRICT_SCISSOR_HINT_PGI 0x1A218 -#define GL_FULL_STIPPLE_HINT_PGI 0x1A219 -#define GL_CLIP_NEAR_HINT_PGI 0x1A220 -#define GL_CLIP_FAR_HINT_PGI 0x1A221 -#define GL_WIDE_LINE_HINT_PGI 0x1A222 -#define GL_BACK_NORMALS_HINT_PGI 0x1A223 -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_COLOR_INDEX1_EXT 0x80E2 -#define GL_COLOR_INDEX2_EXT 0x80E3 -#define GL_COLOR_INDEX4_EXT 0x80E4 -#define GL_COLOR_INDEX8_EXT 0x80E5 -#define GL_COLOR_INDEX12_EXT 0x80E6 -#define GL_COLOR_INDEX16_EXT 0x80E7 -#define GL_TEXTURE_INDEX_SIZE_EXT 0x80ED -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_CLIP_VOLUME_CLIPPING_HINT_EXT 0x80F0 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_LIST_PRIORITY_SGIX 0x8182 -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_IR_INSTRUMENT1_SGIX 0x817F -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_CALLIGRAPHIC_FRAGMENT_SGIX 0x8183 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_TEXTURE_LOD_BIAS_S_SGIX 0x818E -#define GL_TEXTURE_LOD_BIAS_T_SGIX 0x818F -#define GL_TEXTURE_LOD_BIAS_R_SGIX 0x8190 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SHADOW_AMBIENT_SGIX 0x80BF -#endif - -#ifndef GL_EXT_index_texture -#endif - -#ifndef GL_EXT_index_material -#define GL_INDEX_MATERIAL_EXT 0x81B8 -#define GL_INDEX_MATERIAL_PARAMETER_EXT 0x81B9 -#define GL_INDEX_MATERIAL_FACE_EXT 0x81BA -#endif - -#ifndef GL_EXT_index_func -#define GL_INDEX_TEST_EXT 0x81B5 -#define GL_INDEX_TEST_FUNC_EXT 0x81B6 -#define GL_INDEX_TEST_REF_EXT 0x81B7 -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_IUI_V2F_EXT 0x81AD -#define GL_IUI_V3F_EXT 0x81AE -#define GL_IUI_N3F_V2F_EXT 0x81AF -#define GL_IUI_N3F_V3F_EXT 0x81B0 -#define GL_T2F_IUI_V2F_EXT 0x81B1 -#define GL_T2F_IUI_V3F_EXT 0x81B2 -#define GL_T2F_IUI_N3F_V2F_EXT 0x81B3 -#define GL_T2F_IUI_N3F_V3F_EXT 0x81B4 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_ARRAY_ELEMENT_LOCK_FIRST_EXT 0x81A8 -#define GL_ARRAY_ELEMENT_LOCK_COUNT_EXT 0x81A9 -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_CULL_VERTEX_EXT 0x81AA -#define GL_CULL_VERTEX_EYE_POSITION_EXT 0x81AB -#define GL_CULL_VERTEX_OBJECT_POSITION_EXT 0x81AC -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_YCRCB_422_SGIX 0x81BB -#define GL_YCRCB_444_SGIX 0x81BC -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_FRAGMENT_LIGHTING_SGIX 0x8400 -#define GL_FRAGMENT_COLOR_MATERIAL_SGIX 0x8401 -#define GL_FRAGMENT_COLOR_MATERIAL_FACE_SGIX 0x8402 -#define GL_FRAGMENT_COLOR_MATERIAL_PARAMETER_SGIX 0x8403 -#define GL_MAX_FRAGMENT_LIGHTS_SGIX 0x8404 -#define GL_MAX_ACTIVE_LIGHTS_SGIX 0x8405 -#define GL_CURRENT_RASTER_NORMAL_SGIX 0x8406 -#define GL_LIGHT_ENV_MODE_SGIX 0x8407 -#define GL_FRAGMENT_LIGHT_MODEL_LOCAL_VIEWER_SGIX 0x8408 -#define GL_FRAGMENT_LIGHT_MODEL_TWO_SIDE_SGIX 0x8409 -#define GL_FRAGMENT_LIGHT_MODEL_AMBIENT_SGIX 0x840A -#define GL_FRAGMENT_LIGHT_MODEL_NORMAL_INTERPOLATION_SGIX 0x840B -#define GL_FRAGMENT_LIGHT0_SGIX 0x840C -#define GL_FRAGMENT_LIGHT1_SGIX 0x840D -#define GL_FRAGMENT_LIGHT2_SGIX 0x840E -#define GL_FRAGMENT_LIGHT3_SGIX 0x840F -#define GL_FRAGMENT_LIGHT4_SGIX 0x8410 -#define GL_FRAGMENT_LIGHT5_SGIX 0x8411 -#define GL_FRAGMENT_LIGHT6_SGIX 0x8412 -#define GL_FRAGMENT_LIGHT7_SGIX 0x8413 -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_RASTER_POSITION_UNCLIPPED_IBM 0x19262 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_TEXTURE_LIGHTING_MODE_HP 0x8167 -#define GL_TEXTURE_POST_SPECULAR_HP 0x8168 -#define GL_TEXTURE_PRE_SPECULAR_HP 0x8169 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_MAX_ELEMENTS_VERTICES_EXT 0x80E8 -#define GL_MAX_ELEMENTS_INDICES_EXT 0x80E9 -#endif - -#ifndef GL_WIN_phong_shading -#define GL_PHONG_WIN 0x80EA -#define GL_PHONG_HINT_WIN 0x80EB -#endif - -#ifndef GL_WIN_specular_fog -#define GL_FOG_SPECULAR_TEXTURE_WIN 0x80EC -#endif - -#ifndef GL_EXT_light_texture -#define GL_FRAGMENT_MATERIAL_EXT 0x8349 -#define GL_FRAGMENT_NORMAL_EXT 0x834A -#define GL_FRAGMENT_COLOR_EXT 0x834C -#define GL_ATTENUATION_EXT 0x834D -#define GL_SHADOW_ATTENUATION_EXT 0x834E -#define GL_TEXTURE_APPLICATION_MODE_EXT 0x834F -#define GL_TEXTURE_LIGHT_EXT 0x8350 -#define GL_TEXTURE_MATERIAL_FACE_EXT 0x8351 -#define GL_TEXTURE_MATERIAL_PARAMETER_EXT 0x8352 -/* reuse GL_FRAGMENT_DEPTH_EXT */ -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_ALPHA_MIN_SGIX 0x8320 -#define GL_ALPHA_MAX_SGIX 0x8321 -#endif - -#ifndef GL_SGIX_impact_pixel_texture -#define GL_PIXEL_TEX_GEN_Q_CEILING_SGIX 0x8184 -#define GL_PIXEL_TEX_GEN_Q_ROUND_SGIX 0x8185 -#define GL_PIXEL_TEX_GEN_Q_FLOOR_SGIX 0x8186 -#define GL_PIXEL_TEX_GEN_ALPHA_REPLACE_SGIX 0x8187 -#define GL_PIXEL_TEX_GEN_ALPHA_NO_REPLACE_SGIX 0x8188 -#define GL_PIXEL_TEX_GEN_ALPHA_LS_SGIX 0x8189 -#define GL_PIXEL_TEX_GEN_ALPHA_MS_SGIX 0x818A -#endif - -#ifndef GL_EXT_bgra -#define GL_BGR_EXT 0x80E0 -#define GL_BGRA_EXT 0x80E1 -#endif - -#ifndef GL_SGIX_async -#define GL_ASYNC_MARKER_SGIX 0x8329 -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_ASYNC_TEX_IMAGE_SGIX 0x835C -#define GL_ASYNC_DRAW_PIXELS_SGIX 0x835D -#define GL_ASYNC_READ_PIXELS_SGIX 0x835E -#define GL_MAX_ASYNC_TEX_IMAGE_SGIX 0x835F -#define GL_MAX_ASYNC_DRAW_PIXELS_SGIX 0x8360 -#define GL_MAX_ASYNC_READ_PIXELS_SGIX 0x8361 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_ASYNC_HISTOGRAM_SGIX 0x832C -#define GL_MAX_ASYNC_HISTOGRAM_SGIX 0x832D -#endif - -#ifndef GL_INTEL_texture_scissor -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_PARALLEL_ARRAYS_INTEL 0x83F4 -#define GL_VERTEX_ARRAY_PARALLEL_POINTERS_INTEL 0x83F5 -#define GL_NORMAL_ARRAY_PARALLEL_POINTERS_INTEL 0x83F6 -#define GL_COLOR_ARRAY_PARALLEL_POINTERS_INTEL 0x83F7 -#define GL_TEXTURE_COORD_ARRAY_PARALLEL_POINTERS_INTEL 0x83F8 -#endif - -#ifndef GL_HP_occlusion_test -#define GL_OCCLUSION_TEST_HP 0x8165 -#define GL_OCCLUSION_TEST_RESULT_HP 0x8166 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_PIXEL_TRANSFORM_2D_EXT 0x8330 -#define GL_PIXEL_MAG_FILTER_EXT 0x8331 -#define GL_PIXEL_MIN_FILTER_EXT 0x8332 -#define GL_PIXEL_CUBIC_WEIGHT_EXT 0x8333 -#define GL_CUBIC_EXT 0x8334 -#define GL_AVERAGE_EXT 0x8335 -#define GL_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8336 -#define GL_MAX_PIXEL_TRANSFORM_2D_STACK_DEPTH_EXT 0x8337 -#define GL_PIXEL_TRANSFORM_2D_MATRIX_EXT 0x8338 -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_SHARED_TEXTURE_PALETTE_EXT 0x81FB -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_LIGHT_MODEL_COLOR_CONTROL_EXT 0x81F8 -#define GL_SINGLE_COLOR_EXT 0x81F9 -#define GL_SEPARATE_SPECULAR_COLOR_EXT 0x81FA -#endif - -#ifndef GL_EXT_secondary_color -#define GL_COLOR_SUM_EXT 0x8458 -#define GL_CURRENT_SECONDARY_COLOR_EXT 0x8459 -#define GL_SECONDARY_COLOR_ARRAY_SIZE_EXT 0x845A -#define GL_SECONDARY_COLOR_ARRAY_TYPE_EXT 0x845B -#define GL_SECONDARY_COLOR_ARRAY_STRIDE_EXT 0x845C -#define GL_SECONDARY_COLOR_ARRAY_POINTER_EXT 0x845D -#define GL_SECONDARY_COLOR_ARRAY_EXT 0x845E -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_PERTURB_EXT 0x85AE -#define GL_TEXTURE_NORMAL_EXT 0x85AF -#endif - -#ifndef GL_EXT_multi_draw_arrays -#endif - -#ifndef GL_EXT_fog_coord -#define GL_FOG_COORDINATE_SOURCE_EXT 0x8450 -#define GL_FOG_COORDINATE_EXT 0x8451 -#define GL_FRAGMENT_DEPTH_EXT 0x8452 -#define GL_CURRENT_FOG_COORDINATE_EXT 0x8453 -#define GL_FOG_COORDINATE_ARRAY_TYPE_EXT 0x8454 -#define GL_FOG_COORDINATE_ARRAY_STRIDE_EXT 0x8455 -#define GL_FOG_COORDINATE_ARRAY_POINTER_EXT 0x8456 -#define GL_FOG_COORDINATE_ARRAY_EXT 0x8457 -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_SCREEN_COORDINATES_REND 0x8490 -#define GL_INVERTED_SCREEN_W_REND 0x8491 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_TANGENT_ARRAY_EXT 0x8439 -#define GL_BINORMAL_ARRAY_EXT 0x843A -#define GL_CURRENT_TANGENT_EXT 0x843B -#define GL_CURRENT_BINORMAL_EXT 0x843C -#define GL_TANGENT_ARRAY_TYPE_EXT 0x843E -#define GL_TANGENT_ARRAY_STRIDE_EXT 0x843F -#define GL_BINORMAL_ARRAY_TYPE_EXT 0x8440 -#define GL_BINORMAL_ARRAY_STRIDE_EXT 0x8441 -#define GL_TANGENT_ARRAY_POINTER_EXT 0x8442 -#define GL_BINORMAL_ARRAY_POINTER_EXT 0x8443 -#define GL_MAP1_TANGENT_EXT 0x8444 -#define GL_MAP2_TANGENT_EXT 0x8445 -#define GL_MAP1_BINORMAL_EXT 0x8446 -#define GL_MAP2_BINORMAL_EXT 0x8447 -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_COMBINE_EXT 0x8570 -#define GL_COMBINE_RGB_EXT 0x8571 -#define GL_COMBINE_ALPHA_EXT 0x8572 -#define GL_RGB_SCALE_EXT 0x8573 -#define GL_ADD_SIGNED_EXT 0x8574 -#define GL_INTERPOLATE_EXT 0x8575 -#define GL_CONSTANT_EXT 0x8576 -#define GL_PRIMARY_COLOR_EXT 0x8577 -#define GL_PREVIOUS_EXT 0x8578 -#define GL_SOURCE0_RGB_EXT 0x8580 -#define GL_SOURCE1_RGB_EXT 0x8581 -#define GL_SOURCE2_RGB_EXT 0x8582 -#define GL_SOURCE0_ALPHA_EXT 0x8588 -#define GL_SOURCE1_ALPHA_EXT 0x8589 -#define GL_SOURCE2_ALPHA_EXT 0x858A -#define GL_OPERAND0_RGB_EXT 0x8590 -#define GL_OPERAND1_RGB_EXT 0x8591 -#define GL_OPERAND2_RGB_EXT 0x8592 -#define GL_OPERAND0_ALPHA_EXT 0x8598 -#define GL_OPERAND1_ALPHA_EXT 0x8599 -#define GL_OPERAND2_ALPHA_EXT 0x859A -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_LIGHT_MODEL_SPECULAR_VECTOR_APPLE 0x85B0 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_TRANSFORM_HINT_APPLE 0x85B1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_FOG_SCALE_SGIX 0x81FC -#define GL_FOG_SCALE_VALUE_SGIX 0x81FD -#endif - -#ifndef GL_SUNX_constant_data -#define GL_UNPACK_CONSTANT_DATA_SUNX 0x81D5 -#define GL_TEXTURE_CONSTANT_DATA_SUNX 0x81D6 -#endif - -#ifndef GL_SUN_global_alpha -#define GL_GLOBAL_ALPHA_SUN 0x81D9 -#define GL_GLOBAL_ALPHA_FACTOR_SUN 0x81DA -#endif - -#ifndef GL_SUN_triangle_list -#define GL_RESTART_SUN 0x0001 -#define GL_REPLACE_MIDDLE_SUN 0x0002 -#define GL_REPLACE_OLDEST_SUN 0x0003 -#define GL_TRIANGLE_LIST_SUN 0x81D7 -#define GL_REPLACEMENT_CODE_SUN 0x81D8 -#define GL_REPLACEMENT_CODE_ARRAY_SUN 0x85C0 -#define GL_REPLACEMENT_CODE_ARRAY_TYPE_SUN 0x85C1 -#define GL_REPLACEMENT_CODE_ARRAY_STRIDE_SUN 0x85C2 -#define GL_REPLACEMENT_CODE_ARRAY_POINTER_SUN 0x85C3 -#define GL_R1UI_V3F_SUN 0x85C4 -#define GL_R1UI_C4UB_V3F_SUN 0x85C5 -#define GL_R1UI_C3F_V3F_SUN 0x85C6 -#define GL_R1UI_N3F_V3F_SUN 0x85C7 -#define GL_R1UI_C4F_N3F_V3F_SUN 0x85C8 -#define GL_R1UI_T2F_V3F_SUN 0x85C9 -#define GL_R1UI_T2F_N3F_V3F_SUN 0x85CA -#define GL_R1UI_T2F_C4F_N3F_V3F_SUN 0x85CB -#endif - -#ifndef GL_SUN_vertex -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_BLEND_DST_RGB_EXT 0x80C8 -#define GL_BLEND_SRC_RGB_EXT 0x80C9 -#define GL_BLEND_DST_ALPHA_EXT 0x80CA -#define GL_BLEND_SRC_ALPHA_EXT 0x80CB -#endif - -#ifndef GL_INGR_color_clamp -#define GL_RED_MIN_CLAMP_INGR 0x8560 -#define GL_GREEN_MIN_CLAMP_INGR 0x8561 -#define GL_BLUE_MIN_CLAMP_INGR 0x8562 -#define GL_ALPHA_MIN_CLAMP_INGR 0x8563 -#define GL_RED_MAX_CLAMP_INGR 0x8564 -#define GL_GREEN_MAX_CLAMP_INGR 0x8565 -#define GL_BLUE_MAX_CLAMP_INGR 0x8566 -#define GL_ALPHA_MAX_CLAMP_INGR 0x8567 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INTERLACE_READ_INGR 0x8568 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_INCR_WRAP_EXT 0x8507 -#define GL_DECR_WRAP_EXT 0x8508 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_422_EXT 0x80CC -#define GL_422_REV_EXT 0x80CD -#define GL_422_AVERAGE_EXT 0x80CE -#define GL_422_REV_AVERAGE_EXT 0x80CF -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NORMAL_MAP_NV 0x8511 -#define GL_REFLECTION_MAP_NV 0x8512 -#endif - -#ifndef GL_EXT_texture_cube_map -#define GL_NORMAL_MAP_EXT 0x8511 -#define GL_REFLECTION_MAP_EXT 0x8512 -#define GL_TEXTURE_CUBE_MAP_EXT 0x8513 -#define GL_TEXTURE_BINDING_CUBE_MAP_EXT 0x8514 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_EXT 0x8515 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_EXT 0x8516 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_EXT 0x8517 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_EXT 0x8518 -#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_EXT 0x8519 -#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_EXT 0x851A -#define GL_PROXY_TEXTURE_CUBE_MAP_EXT 0x851B -#define GL_MAX_CUBE_MAP_TEXTURE_SIZE_EXT 0x851C -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_WRAP_BORDER_SUN 0x81D4 -#endif - -#ifndef GL_EXT_texture_env_add -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_MAX_TEXTURE_LOD_BIAS_EXT 0x84FD -#define GL_TEXTURE_FILTER_CONTROL_EXT 0x8500 -#define GL_TEXTURE_LOD_BIAS_EXT 0x8501 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_TEXTURE_MAX_ANISOTROPY_EXT 0x84FE -#define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT 0x84FF -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_MODELVIEW0_STACK_DEPTH_EXT GL_MODELVIEW_STACK_DEPTH -#define GL_MODELVIEW1_STACK_DEPTH_EXT 0x8502 -#define GL_MODELVIEW0_MATRIX_EXT GL_MODELVIEW_MATRIX -#define GL_MODELVIEW1_MATRIX_EXT 0x8506 -#define GL_VERTEX_WEIGHTING_EXT 0x8509 -#define GL_MODELVIEW0_EXT GL_MODELVIEW -#define GL_MODELVIEW1_EXT 0x850A -#define GL_CURRENT_VERTEX_WEIGHT_EXT 0x850B -#define GL_VERTEX_WEIGHT_ARRAY_EXT 0x850C -#define GL_VERTEX_WEIGHT_ARRAY_SIZE_EXT 0x850D -#define GL_VERTEX_WEIGHT_ARRAY_TYPE_EXT 0x850E -#define GL_VERTEX_WEIGHT_ARRAY_STRIDE_EXT 0x850F -#define GL_VERTEX_WEIGHT_ARRAY_POINTER_EXT 0x8510 -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_MAX_SHININESS_NV 0x8504 -#define GL_MAX_SPOT_EXPONENT_NV 0x8505 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_NV 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_NV 0x851E -#define GL_VERTEX_ARRAY_RANGE_VALID_NV 0x851F -#define GL_MAX_VERTEX_ARRAY_RANGE_ELEMENT_NV 0x8520 -#define GL_VERTEX_ARRAY_RANGE_POINTER_NV 0x8521 -#endif - -#ifndef GL_NV_register_combiners -#define GL_REGISTER_COMBINERS_NV 0x8522 -#define GL_VARIABLE_A_NV 0x8523 -#define GL_VARIABLE_B_NV 0x8524 -#define GL_VARIABLE_C_NV 0x8525 -#define GL_VARIABLE_D_NV 0x8526 -#define GL_VARIABLE_E_NV 0x8527 -#define GL_VARIABLE_F_NV 0x8528 -#define GL_VARIABLE_G_NV 0x8529 -#define GL_CONSTANT_COLOR0_NV 0x852A -#define GL_CONSTANT_COLOR1_NV 0x852B -#define GL_PRIMARY_COLOR_NV 0x852C -#define GL_SECONDARY_COLOR_NV 0x852D -#define GL_SPARE0_NV 0x852E -#define GL_SPARE1_NV 0x852F -#define GL_DISCARD_NV 0x8530 -#define GL_E_TIMES_F_NV 0x8531 -#define GL_SPARE0_PLUS_SECONDARY_COLOR_NV 0x8532 -#define GL_UNSIGNED_IDENTITY_NV 0x8536 -#define GL_UNSIGNED_INVERT_NV 0x8537 -#define GL_EXPAND_NORMAL_NV 0x8538 -#define GL_EXPAND_NEGATE_NV 0x8539 -#define GL_HALF_BIAS_NORMAL_NV 0x853A -#define GL_HALF_BIAS_NEGATE_NV 0x853B -#define GL_SIGNED_IDENTITY_NV 0x853C -#define GL_SIGNED_NEGATE_NV 0x853D -#define GL_SCALE_BY_TWO_NV 0x853E -#define GL_SCALE_BY_FOUR_NV 0x853F -#define GL_SCALE_BY_ONE_HALF_NV 0x8540 -#define GL_BIAS_BY_NEGATIVE_ONE_HALF_NV 0x8541 -#define GL_COMBINER_INPUT_NV 0x8542 -#define GL_COMBINER_MAPPING_NV 0x8543 -#define GL_COMBINER_COMPONENT_USAGE_NV 0x8544 -#define GL_COMBINER_AB_DOT_PRODUCT_NV 0x8545 -#define GL_COMBINER_CD_DOT_PRODUCT_NV 0x8546 -#define GL_COMBINER_MUX_SUM_NV 0x8547 -#define GL_COMBINER_SCALE_NV 0x8548 -#define GL_COMBINER_BIAS_NV 0x8549 -#define GL_COMBINER_AB_OUTPUT_NV 0x854A -#define GL_COMBINER_CD_OUTPUT_NV 0x854B -#define GL_COMBINER_SUM_OUTPUT_NV 0x854C -#define GL_MAX_GENERAL_COMBINERS_NV 0x854D -#define GL_NUM_GENERAL_COMBINERS_NV 0x854E -#define GL_COLOR_SUM_CLAMP_NV 0x854F -#define GL_COMBINER0_NV 0x8550 -#define GL_COMBINER1_NV 0x8551 -#define GL_COMBINER2_NV 0x8552 -#define GL_COMBINER3_NV 0x8553 -#define GL_COMBINER4_NV 0x8554 -#define GL_COMBINER5_NV 0x8555 -#define GL_COMBINER6_NV 0x8556 -#define GL_COMBINER7_NV 0x8557 -/* reuse GL_TEXTURE0_ARB */ -/* reuse GL_TEXTURE1_ARB */ -/* reuse GL_ZERO */ -/* reuse GL_NONE */ -/* reuse GL_FOG */ -#endif - -#ifndef GL_NV_fog_distance -#define GL_FOG_DISTANCE_MODE_NV 0x855A -#define GL_EYE_RADIAL_NV 0x855B -#define GL_EYE_PLANE_ABSOLUTE_NV 0x855C -/* reuse GL_EYE_PLANE */ -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_EMBOSS_LIGHT_NV 0x855D -#define GL_EMBOSS_CONSTANT_NV 0x855E -#define GL_EMBOSS_MAP_NV 0x855F -#endif - -#ifndef GL_NV_blend_square -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_COMBINE4_NV 0x8503 -#define GL_SOURCE3_RGB_NV 0x8583 -#define GL_SOURCE3_ALPHA_NV 0x858B -#define GL_OPERAND3_RGB_NV 0x8593 -#define GL_OPERAND3_ALPHA_NV 0x859B -#endif - -#ifndef GL_MESA_resize_buffers -#endif - -#ifndef GL_MESA_window_pos -#endif - -#ifndef GL_EXT_texture_compression_s3tc -#define GL_COMPRESSED_RGB_S3TC_DXT1_EXT 0x83F0 -#define GL_COMPRESSED_RGBA_S3TC_DXT1_EXT 0x83F1 -#define GL_COMPRESSED_RGBA_S3TC_DXT3_EXT 0x83F2 -#define GL_COMPRESSED_RGBA_S3TC_DXT5_EXT 0x83F3 -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_CULL_VERTEX_IBM 103050 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_VERTEX_ARRAY_LIST_IBM 103070 -#define GL_NORMAL_ARRAY_LIST_IBM 103071 -#define GL_COLOR_ARRAY_LIST_IBM 103072 -#define GL_INDEX_ARRAY_LIST_IBM 103073 -#define GL_TEXTURE_COORD_ARRAY_LIST_IBM 103074 -#define GL_EDGE_FLAG_ARRAY_LIST_IBM 103075 -#define GL_FOG_COORDINATE_ARRAY_LIST_IBM 103076 -#define GL_SECONDARY_COLOR_ARRAY_LIST_IBM 103077 -#define GL_VERTEX_ARRAY_LIST_STRIDE_IBM 103080 -#define GL_NORMAL_ARRAY_LIST_STRIDE_IBM 103081 -#define GL_COLOR_ARRAY_LIST_STRIDE_IBM 103082 -#define GL_INDEX_ARRAY_LIST_STRIDE_IBM 103083 -#define GL_TEXTURE_COORD_ARRAY_LIST_STRIDE_IBM 103084 -#define GL_EDGE_FLAG_ARRAY_LIST_STRIDE_IBM 103085 -#define GL_FOG_COORDINATE_ARRAY_LIST_STRIDE_IBM 103086 -#define GL_SECONDARY_COLOR_ARRAY_LIST_STRIDE_IBM 103087 -#endif - -#ifndef GL_SGIX_subsample -#define GL_PACK_SUBSAMPLE_RATE_SGIX 0x85A0 -#define GL_UNPACK_SUBSAMPLE_RATE_SGIX 0x85A1 -#define GL_PIXEL_SUBSAMPLE_4444_SGIX 0x85A2 -#define GL_PIXEL_SUBSAMPLE_2424_SGIX 0x85A3 -#define GL_PIXEL_SUBSAMPLE_4242_SGIX 0x85A4 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_YCRCB_SGIX 0x8318 -#define GL_YCRCBA_SGIX 0x8319 -#endif - -#ifndef GL_SGI_depth_pass_instrument -#define GL_DEPTH_PASS_INSTRUMENT_SGIX 0x8310 -#define GL_DEPTH_PASS_INSTRUMENT_COUNTERS_SGIX 0x8311 -#define GL_DEPTH_PASS_INSTRUMENT_MAX_SGIX 0x8312 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_COMPRESSED_RGB_FXT1_3DFX 0x86B0 -#define GL_COMPRESSED_RGBA_FXT1_3DFX 0x86B1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_MULTISAMPLE_3DFX 0x86B2 -#define GL_SAMPLE_BUFFERS_3DFX 0x86B3 -#define GL_SAMPLES_3DFX 0x86B4 -#define GL_MULTISAMPLE_BIT_3DFX 0x20000000 -#endif - -#ifndef GL_3DFX_tbuffer -#endif - -#ifndef GL_EXT_multisample -#define GL_MULTISAMPLE_EXT 0x809D -#define GL_SAMPLE_ALPHA_TO_MASK_EXT 0x809E -#define GL_SAMPLE_ALPHA_TO_ONE_EXT 0x809F -#define GL_SAMPLE_MASK_EXT 0x80A0 -#define GL_1PASS_EXT 0x80A1 -#define GL_2PASS_0_EXT 0x80A2 -#define GL_2PASS_1_EXT 0x80A3 -#define GL_4PASS_0_EXT 0x80A4 -#define GL_4PASS_1_EXT 0x80A5 -#define GL_4PASS_2_EXT 0x80A6 -#define GL_4PASS_3_EXT 0x80A7 -#define GL_SAMPLE_BUFFERS_EXT 0x80A8 -#define GL_SAMPLES_EXT 0x80A9 -#define GL_SAMPLE_MASK_VALUE_EXT 0x80AA -#define GL_SAMPLE_MASK_INVERT_EXT 0x80AB -#define GL_SAMPLE_PATTERN_EXT 0x80AC -#define GL_MULTISAMPLE_BIT_EXT 0x20000000 -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_VERTEX_PRECLIP_SGIX 0x83EE -#define GL_VERTEX_PRECLIP_HINT_SGIX 0x83EF -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_CONVOLUTION_HINT_SGIX 0x8316 -#endif - -#ifndef GL_SGIX_resample -#define GL_PACK_RESAMPLE_SGIX 0x842C -#define GL_UNPACK_RESAMPLE_SGIX 0x842D -#define GL_RESAMPLE_REPLICATE_SGIX 0x842E -#define GL_RESAMPLE_ZERO_FILL_SGIX 0x842F -#define GL_RESAMPLE_DECIMATE_SGIX 0x8430 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_EYE_DISTANCE_TO_POINT_SGIS 0x81F0 -#define GL_OBJECT_DISTANCE_TO_POINT_SGIS 0x81F1 -#define GL_EYE_DISTANCE_TO_LINE_SGIS 0x81F2 -#define GL_OBJECT_DISTANCE_TO_LINE_SGIS 0x81F3 -#define GL_EYE_POINT_SGIS 0x81F4 -#define GL_OBJECT_POINT_SGIS 0x81F5 -#define GL_EYE_LINE_SGIS 0x81F6 -#define GL_OBJECT_LINE_SGIS 0x81F7 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_TEXTURE_COLOR_WRITEMASK_SGIS 0x81EF -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_DOT3_RGB_EXT 0x8740 -#define GL_DOT3_RGBA_EXT 0x8741 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_MIRROR_CLAMP_ATI 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_ATI 0x8743 -#endif - -#ifndef GL_NV_fence -#define GL_ALL_COMPLETED_NV 0x84F2 -#define GL_FENCE_STATUS_NV 0x84F3 -#define GL_FENCE_CONDITION_NV 0x84F4 -#endif - -#ifndef GL_IBM_texture_mirrored_repeat -#define GL_MIRRORED_REPEAT_IBM 0x8370 -#endif - -#ifndef GL_NV_evaluators -#define GL_EVAL_2D_NV 0x86C0 -#define GL_EVAL_TRIANGULAR_2D_NV 0x86C1 -#define GL_MAP_TESSELLATION_NV 0x86C2 -#define GL_MAP_ATTRIB_U_ORDER_NV 0x86C3 -#define GL_MAP_ATTRIB_V_ORDER_NV 0x86C4 -#define GL_EVAL_FRACTIONAL_TESSELLATION_NV 0x86C5 -#define GL_EVAL_VERTEX_ATTRIB0_NV 0x86C6 -#define GL_EVAL_VERTEX_ATTRIB1_NV 0x86C7 -#define GL_EVAL_VERTEX_ATTRIB2_NV 0x86C8 -#define GL_EVAL_VERTEX_ATTRIB3_NV 0x86C9 -#define GL_EVAL_VERTEX_ATTRIB4_NV 0x86CA -#define GL_EVAL_VERTEX_ATTRIB5_NV 0x86CB -#define GL_EVAL_VERTEX_ATTRIB6_NV 0x86CC -#define GL_EVAL_VERTEX_ATTRIB7_NV 0x86CD -#define GL_EVAL_VERTEX_ATTRIB8_NV 0x86CE -#define GL_EVAL_VERTEX_ATTRIB9_NV 0x86CF -#define GL_EVAL_VERTEX_ATTRIB10_NV 0x86D0 -#define GL_EVAL_VERTEX_ATTRIB11_NV 0x86D1 -#define GL_EVAL_VERTEX_ATTRIB12_NV 0x86D2 -#define GL_EVAL_VERTEX_ATTRIB13_NV 0x86D3 -#define GL_EVAL_VERTEX_ATTRIB14_NV 0x86D4 -#define GL_EVAL_VERTEX_ATTRIB15_NV 0x86D5 -#define GL_MAX_MAP_TESSELLATION_NV 0x86D6 -#define GL_MAX_RATIONAL_EVAL_ORDER_NV 0x86D7 -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_DEPTH_STENCIL_NV 0x84F9 -#define GL_UNSIGNED_INT_24_8_NV 0x84FA -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_PER_STAGE_CONSTANTS_NV 0x8535 -#endif - -#ifndef GL_NV_texture_compression_vtc -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_TEXTURE_RECTANGLE_NV 0x84F5 -#define GL_TEXTURE_BINDING_RECTANGLE_NV 0x84F6 -#define GL_PROXY_TEXTURE_RECTANGLE_NV 0x84F7 -#define GL_MAX_RECTANGLE_TEXTURE_SIZE_NV 0x84F8 -#endif - -#ifndef GL_NV_texture_shader -#define GL_OFFSET_TEXTURE_RECTANGLE_NV 0x864C -#define GL_OFFSET_TEXTURE_RECTANGLE_SCALE_NV 0x864D -#define GL_DOT_PRODUCT_TEXTURE_RECTANGLE_NV 0x864E -#define GL_RGBA_UNSIGNED_DOT_PRODUCT_MAPPING_NV 0x86D9 -#define GL_UNSIGNED_INT_S8_S8_8_8_NV 0x86DA -#define GL_UNSIGNED_INT_8_8_S8_S8_REV_NV 0x86DB -#define GL_DSDT_MAG_INTENSITY_NV 0x86DC -#define GL_SHADER_CONSISTENT_NV 0x86DD -#define GL_TEXTURE_SHADER_NV 0x86DE -#define GL_SHADER_OPERATION_NV 0x86DF -#define GL_CULL_MODES_NV 0x86E0 -#define GL_OFFSET_TEXTURE_MATRIX_NV 0x86E1 -#define GL_OFFSET_TEXTURE_SCALE_NV 0x86E2 -#define GL_OFFSET_TEXTURE_BIAS_NV 0x86E3 -#define GL_OFFSET_TEXTURE_2D_MATRIX_NV GL_OFFSET_TEXTURE_MATRIX_NV -#define GL_OFFSET_TEXTURE_2D_SCALE_NV GL_OFFSET_TEXTURE_SCALE_NV -#define GL_OFFSET_TEXTURE_2D_BIAS_NV GL_OFFSET_TEXTURE_BIAS_NV -#define GL_PREVIOUS_TEXTURE_INPUT_NV 0x86E4 -#define GL_CONST_EYE_NV 0x86E5 -#define GL_PASS_THROUGH_NV 0x86E6 -#define GL_CULL_FRAGMENT_NV 0x86E7 -#define GL_OFFSET_TEXTURE_2D_NV 0x86E8 -#define GL_DEPENDENT_AR_TEXTURE_2D_NV 0x86E9 -#define GL_DEPENDENT_GB_TEXTURE_2D_NV 0x86EA -#define GL_DOT_PRODUCT_NV 0x86EC -#define GL_DOT_PRODUCT_DEPTH_REPLACE_NV 0x86ED -#define GL_DOT_PRODUCT_TEXTURE_2D_NV 0x86EE -#define GL_DOT_PRODUCT_TEXTURE_CUBE_MAP_NV 0x86F0 -#define GL_DOT_PRODUCT_DIFFUSE_CUBE_MAP_NV 0x86F1 -#define GL_DOT_PRODUCT_REFLECT_CUBE_MAP_NV 0x86F2 -#define GL_DOT_PRODUCT_CONST_EYE_REFLECT_CUBE_MAP_NV 0x86F3 -#define GL_HILO_NV 0x86F4 -#define GL_DSDT_NV 0x86F5 -#define GL_DSDT_MAG_NV 0x86F6 -#define GL_DSDT_MAG_VIB_NV 0x86F7 -#define GL_HILO16_NV 0x86F8 -#define GL_SIGNED_HILO_NV 0x86F9 -#define GL_SIGNED_HILO16_NV 0x86FA -#define GL_SIGNED_RGBA_NV 0x86FB -#define GL_SIGNED_RGBA8_NV 0x86FC -#define GL_SIGNED_RGB_NV 0x86FE -#define GL_SIGNED_RGB8_NV 0x86FF -#define GL_SIGNED_LUMINANCE_NV 0x8701 -#define GL_SIGNED_LUMINANCE8_NV 0x8702 -#define GL_SIGNED_LUMINANCE_ALPHA_NV 0x8703 -#define GL_SIGNED_LUMINANCE8_ALPHA8_NV 0x8704 -#define GL_SIGNED_ALPHA_NV 0x8705 -#define GL_SIGNED_ALPHA8_NV 0x8706 -#define GL_SIGNED_INTENSITY_NV 0x8707 -#define GL_SIGNED_INTENSITY8_NV 0x8708 -#define GL_DSDT8_NV 0x8709 -#define GL_DSDT8_MAG8_NV 0x870A -#define GL_DSDT8_MAG8_INTENSITY8_NV 0x870B -#define GL_SIGNED_RGB_UNSIGNED_ALPHA_NV 0x870C -#define GL_SIGNED_RGB8_UNSIGNED_ALPHA8_NV 0x870D -#define GL_HI_SCALE_NV 0x870E -#define GL_LO_SCALE_NV 0x870F -#define GL_DS_SCALE_NV 0x8710 -#define GL_DT_SCALE_NV 0x8711 -#define GL_MAGNITUDE_SCALE_NV 0x8712 -#define GL_VIBRANCE_SCALE_NV 0x8713 -#define GL_HI_BIAS_NV 0x8714 -#define GL_LO_BIAS_NV 0x8715 -#define GL_DS_BIAS_NV 0x8716 -#define GL_DT_BIAS_NV 0x8717 -#define GL_MAGNITUDE_BIAS_NV 0x8718 -#define GL_VIBRANCE_BIAS_NV 0x8719 -#define GL_TEXTURE_BORDER_VALUES_NV 0x871A -#define GL_TEXTURE_HI_SIZE_NV 0x871B -#define GL_TEXTURE_LO_SIZE_NV 0x871C -#define GL_TEXTURE_DS_SIZE_NV 0x871D -#define GL_TEXTURE_DT_SIZE_NV 0x871E -#define GL_TEXTURE_MAG_SIZE_NV 0x871F -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_DOT_PRODUCT_TEXTURE_3D_NV 0x86EF -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_VERTEX_ARRAY_RANGE_WITHOUT_FLUSH_NV 0x8533 -#endif - -#ifndef GL_NV_vertex_program -#define GL_VERTEX_PROGRAM_NV 0x8620 -#define GL_VERTEX_STATE_PROGRAM_NV 0x8621 -#define GL_ATTRIB_ARRAY_SIZE_NV 0x8623 -#define GL_ATTRIB_ARRAY_STRIDE_NV 0x8624 -#define GL_ATTRIB_ARRAY_TYPE_NV 0x8625 -#define GL_CURRENT_ATTRIB_NV 0x8626 -#define GL_PROGRAM_LENGTH_NV 0x8627 -#define GL_PROGRAM_STRING_NV 0x8628 -#define GL_MODELVIEW_PROJECTION_NV 0x8629 -#define GL_IDENTITY_NV 0x862A -#define GL_INVERSE_NV 0x862B -#define GL_TRANSPOSE_NV 0x862C -#define GL_INVERSE_TRANSPOSE_NV 0x862D -#define GL_MAX_TRACK_MATRIX_STACK_DEPTH_NV 0x862E -#define GL_MAX_TRACK_MATRICES_NV 0x862F -#define GL_MATRIX0_NV 0x8630 -#define GL_MATRIX1_NV 0x8631 -#define GL_MATRIX2_NV 0x8632 -#define GL_MATRIX3_NV 0x8633 -#define GL_MATRIX4_NV 0x8634 -#define GL_MATRIX5_NV 0x8635 -#define GL_MATRIX6_NV 0x8636 -#define GL_MATRIX7_NV 0x8637 -#define GL_CURRENT_MATRIX_STACK_DEPTH_NV 0x8640 -#define GL_CURRENT_MATRIX_NV 0x8641 -#define GL_VERTEX_PROGRAM_POINT_SIZE_NV 0x8642 -#define GL_VERTEX_PROGRAM_TWO_SIDE_NV 0x8643 -#define GL_PROGRAM_PARAMETER_NV 0x8644 -#define GL_ATTRIB_ARRAY_POINTER_NV 0x8645 -#define GL_PROGRAM_TARGET_NV 0x8646 -#define GL_PROGRAM_RESIDENT_NV 0x8647 -#define GL_TRACK_MATRIX_NV 0x8648 -#define GL_TRACK_MATRIX_TRANSFORM_NV 0x8649 -#define GL_VERTEX_PROGRAM_BINDING_NV 0x864A -#define GL_PROGRAM_ERROR_POSITION_NV 0x864B -#define GL_VERTEX_ATTRIB_ARRAY0_NV 0x8650 -#define GL_VERTEX_ATTRIB_ARRAY1_NV 0x8651 -#define GL_VERTEX_ATTRIB_ARRAY2_NV 0x8652 -#define GL_VERTEX_ATTRIB_ARRAY3_NV 0x8653 -#define GL_VERTEX_ATTRIB_ARRAY4_NV 0x8654 -#define GL_VERTEX_ATTRIB_ARRAY5_NV 0x8655 -#define GL_VERTEX_ATTRIB_ARRAY6_NV 0x8656 -#define GL_VERTEX_ATTRIB_ARRAY7_NV 0x8657 -#define GL_VERTEX_ATTRIB_ARRAY8_NV 0x8658 -#define GL_VERTEX_ATTRIB_ARRAY9_NV 0x8659 -#define GL_VERTEX_ATTRIB_ARRAY10_NV 0x865A -#define GL_VERTEX_ATTRIB_ARRAY11_NV 0x865B -#define GL_VERTEX_ATTRIB_ARRAY12_NV 0x865C -#define GL_VERTEX_ATTRIB_ARRAY13_NV 0x865D -#define GL_VERTEX_ATTRIB_ARRAY14_NV 0x865E -#define GL_VERTEX_ATTRIB_ARRAY15_NV 0x865F -#define GL_MAP1_VERTEX_ATTRIB0_4_NV 0x8660 -#define GL_MAP1_VERTEX_ATTRIB1_4_NV 0x8661 -#define GL_MAP1_VERTEX_ATTRIB2_4_NV 0x8662 -#define GL_MAP1_VERTEX_ATTRIB3_4_NV 0x8663 -#define GL_MAP1_VERTEX_ATTRIB4_4_NV 0x8664 -#define GL_MAP1_VERTEX_ATTRIB5_4_NV 0x8665 -#define GL_MAP1_VERTEX_ATTRIB6_4_NV 0x8666 -#define GL_MAP1_VERTEX_ATTRIB7_4_NV 0x8667 -#define GL_MAP1_VERTEX_ATTRIB8_4_NV 0x8668 -#define GL_MAP1_VERTEX_ATTRIB9_4_NV 0x8669 -#define GL_MAP1_VERTEX_ATTRIB10_4_NV 0x866A -#define GL_MAP1_VERTEX_ATTRIB11_4_NV 0x866B -#define GL_MAP1_VERTEX_ATTRIB12_4_NV 0x866C -#define GL_MAP1_VERTEX_ATTRIB13_4_NV 0x866D -#define GL_MAP1_VERTEX_ATTRIB14_4_NV 0x866E -#define GL_MAP1_VERTEX_ATTRIB15_4_NV 0x866F -#define GL_MAP2_VERTEX_ATTRIB0_4_NV 0x8670 -#define GL_MAP2_VERTEX_ATTRIB1_4_NV 0x8671 -#define GL_MAP2_VERTEX_ATTRIB2_4_NV 0x8672 -#define GL_MAP2_VERTEX_ATTRIB3_4_NV 0x8673 -#define GL_MAP2_VERTEX_ATTRIB4_4_NV 0x8674 -#define GL_MAP2_VERTEX_ATTRIB5_4_NV 0x8675 -#define GL_MAP2_VERTEX_ATTRIB6_4_NV 0x8676 -#define GL_MAP2_VERTEX_ATTRIB7_4_NV 0x8677 -#define GL_MAP2_VERTEX_ATTRIB8_4_NV 0x8678 -#define GL_MAP2_VERTEX_ATTRIB9_4_NV 0x8679 -#define GL_MAP2_VERTEX_ATTRIB10_4_NV 0x867A -#define GL_MAP2_VERTEX_ATTRIB11_4_NV 0x867B -#define GL_MAP2_VERTEX_ATTRIB12_4_NV 0x867C -#define GL_MAP2_VERTEX_ATTRIB13_4_NV 0x867D -#define GL_MAP2_VERTEX_ATTRIB14_4_NV 0x867E -#define GL_MAP2_VERTEX_ATTRIB15_4_NV 0x867F -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_TEXTURE_MAX_CLAMP_S_SGIX 0x8369 -#define GL_TEXTURE_MAX_CLAMP_T_SGIX 0x836A -#define GL_TEXTURE_MAX_CLAMP_R_SGIX 0x836B -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SCALEBIAS_HINT_SGIX 0x8322 -#endif - -#ifndef GL_OML_interlace -#define GL_INTERLACE_OML 0x8980 -#define GL_INTERLACE_READ_OML 0x8981 -#endif - -#ifndef GL_OML_subsample -#define GL_FORMAT_SUBSAMPLE_24_24_OML 0x8982 -#define GL_FORMAT_SUBSAMPLE_244_244_OML 0x8983 -#endif - -#ifndef GL_OML_resample -#define GL_PACK_RESAMPLE_OML 0x8984 -#define GL_UNPACK_RESAMPLE_OML 0x8985 -#define GL_RESAMPLE_REPLICATE_OML 0x8986 -#define GL_RESAMPLE_ZERO_FILL_OML 0x8987 -#define GL_RESAMPLE_AVERAGE_OML 0x8988 -#define GL_RESAMPLE_DECIMATE_OML 0x8989 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_DEPTH_STENCIL_TO_RGBA_NV 0x886E -#define GL_DEPTH_STENCIL_TO_BGRA_NV 0x886F -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_BUMP_ROT_MATRIX_ATI 0x8775 -#define GL_BUMP_ROT_MATRIX_SIZE_ATI 0x8776 -#define GL_BUMP_NUM_TEX_UNITS_ATI 0x8777 -#define GL_BUMP_TEX_UNITS_ATI 0x8778 -#define GL_DUDV_ATI 0x8779 -#define GL_DU8DV8_ATI 0x877A -#define GL_BUMP_ENVMAP_ATI 0x877B -#define GL_BUMP_TARGET_ATI 0x877C -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_FRAGMENT_SHADER_ATI 0x8920 -#define GL_REG_0_ATI 0x8921 -#define GL_REG_1_ATI 0x8922 -#define GL_REG_2_ATI 0x8923 -#define GL_REG_3_ATI 0x8924 -#define GL_REG_4_ATI 0x8925 -#define GL_REG_5_ATI 0x8926 -#define GL_REG_6_ATI 0x8927 -#define GL_REG_7_ATI 0x8928 -#define GL_REG_8_ATI 0x8929 -#define GL_REG_9_ATI 0x892A -#define GL_REG_10_ATI 0x892B -#define GL_REG_11_ATI 0x892C -#define GL_REG_12_ATI 0x892D -#define GL_REG_13_ATI 0x892E -#define GL_REG_14_ATI 0x892F -#define GL_REG_15_ATI 0x8930 -#define GL_REG_16_ATI 0x8931 -#define GL_REG_17_ATI 0x8932 -#define GL_REG_18_ATI 0x8933 -#define GL_REG_19_ATI 0x8934 -#define GL_REG_20_ATI 0x8935 -#define GL_REG_21_ATI 0x8936 -#define GL_REG_22_ATI 0x8937 -#define GL_REG_23_ATI 0x8938 -#define GL_REG_24_ATI 0x8939 -#define GL_REG_25_ATI 0x893A -#define GL_REG_26_ATI 0x893B -#define GL_REG_27_ATI 0x893C -#define GL_REG_28_ATI 0x893D -#define GL_REG_29_ATI 0x893E -#define GL_REG_30_ATI 0x893F -#define GL_REG_31_ATI 0x8940 -#define GL_CON_0_ATI 0x8941 -#define GL_CON_1_ATI 0x8942 -#define GL_CON_2_ATI 0x8943 -#define GL_CON_3_ATI 0x8944 -#define GL_CON_4_ATI 0x8945 -#define GL_CON_5_ATI 0x8946 -#define GL_CON_6_ATI 0x8947 -#define GL_CON_7_ATI 0x8948 -#define GL_CON_8_ATI 0x8949 -#define GL_CON_9_ATI 0x894A -#define GL_CON_10_ATI 0x894B -#define GL_CON_11_ATI 0x894C -#define GL_CON_12_ATI 0x894D -#define GL_CON_13_ATI 0x894E -#define GL_CON_14_ATI 0x894F -#define GL_CON_15_ATI 0x8950 -#define GL_CON_16_ATI 0x8951 -#define GL_CON_17_ATI 0x8952 -#define GL_CON_18_ATI 0x8953 -#define GL_CON_19_ATI 0x8954 -#define GL_CON_20_ATI 0x8955 -#define GL_CON_21_ATI 0x8956 -#define GL_CON_22_ATI 0x8957 -#define GL_CON_23_ATI 0x8958 -#define GL_CON_24_ATI 0x8959 -#define GL_CON_25_ATI 0x895A -#define GL_CON_26_ATI 0x895B -#define GL_CON_27_ATI 0x895C -#define GL_CON_28_ATI 0x895D -#define GL_CON_29_ATI 0x895E -#define GL_CON_30_ATI 0x895F -#define GL_CON_31_ATI 0x8960 -#define GL_MOV_ATI 0x8961 -#define GL_ADD_ATI 0x8963 -#define GL_MUL_ATI 0x8964 -#define GL_SUB_ATI 0x8965 -#define GL_DOT3_ATI 0x8966 -#define GL_DOT4_ATI 0x8967 -#define GL_MAD_ATI 0x8968 -#define GL_LERP_ATI 0x8969 -#define GL_CND_ATI 0x896A -#define GL_CND0_ATI 0x896B -#define GL_DOT2_ADD_ATI 0x896C -#define GL_SECONDARY_INTERPOLATOR_ATI 0x896D -#define GL_NUM_FRAGMENT_REGISTERS_ATI 0x896E -#define GL_NUM_FRAGMENT_CONSTANTS_ATI 0x896F -#define GL_NUM_PASSES_ATI 0x8970 -#define GL_NUM_INSTRUCTIONS_PER_PASS_ATI 0x8971 -#define GL_NUM_INSTRUCTIONS_TOTAL_ATI 0x8972 -#define GL_NUM_INPUT_INTERPOLATOR_COMPONENTS_ATI 0x8973 -#define GL_NUM_LOOPBACK_COMPONENTS_ATI 0x8974 -#define GL_COLOR_ALPHA_PAIRING_ATI 0x8975 -#define GL_SWIZZLE_STR_ATI 0x8976 -#define GL_SWIZZLE_STQ_ATI 0x8977 -#define GL_SWIZZLE_STR_DR_ATI 0x8978 -#define GL_SWIZZLE_STQ_DQ_ATI 0x8979 -#define GL_SWIZZLE_STRQ_ATI 0x897A -#define GL_SWIZZLE_STRQ_DQ_ATI 0x897B -#define GL_RED_BIT_ATI 0x00000001 -#define GL_GREEN_BIT_ATI 0x00000002 -#define GL_BLUE_BIT_ATI 0x00000004 -#define GL_2X_BIT_ATI 0x00000001 -#define GL_4X_BIT_ATI 0x00000002 -#define GL_8X_BIT_ATI 0x00000004 -#define GL_HALF_BIT_ATI 0x00000008 -#define GL_QUARTER_BIT_ATI 0x00000010 -#define GL_EIGHTH_BIT_ATI 0x00000020 -#define GL_SATURATE_BIT_ATI 0x00000040 -#define GL_COMP_BIT_ATI 0x00000002 -#define GL_NEGATE_BIT_ATI 0x00000004 -#define GL_BIAS_BIT_ATI 0x00000008 -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_PN_TRIANGLES_ATI 0x87F0 -#define GL_MAX_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F1 -#define GL_PN_TRIANGLES_POINT_MODE_ATI 0x87F2 -#define GL_PN_TRIANGLES_NORMAL_MODE_ATI 0x87F3 -#define GL_PN_TRIANGLES_TESSELATION_LEVEL_ATI 0x87F4 -#define GL_PN_TRIANGLES_POINT_MODE_LINEAR_ATI 0x87F5 -#define GL_PN_TRIANGLES_POINT_MODE_CUBIC_ATI 0x87F6 -#define GL_PN_TRIANGLES_NORMAL_MODE_LINEAR_ATI 0x87F7 -#define GL_PN_TRIANGLES_NORMAL_MODE_QUADRATIC_ATI 0x87F8 -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_STATIC_ATI 0x8760 -#define GL_DYNAMIC_ATI 0x8761 -#define GL_PRESERVE_ATI 0x8762 -#define GL_DISCARD_ATI 0x8763 -#define GL_OBJECT_BUFFER_SIZE_ATI 0x8764 -#define GL_OBJECT_BUFFER_USAGE_ATI 0x8765 -#define GL_ARRAY_OBJECT_BUFFER_ATI 0x8766 -#define GL_ARRAY_OBJECT_OFFSET_ATI 0x8767 -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_VERTEX_SHADER_EXT 0x8780 -#define GL_VERTEX_SHADER_BINDING_EXT 0x8781 -#define GL_OP_INDEX_EXT 0x8782 -#define GL_OP_NEGATE_EXT 0x8783 -#define GL_OP_DOT3_EXT 0x8784 -#define GL_OP_DOT4_EXT 0x8785 -#define GL_OP_MUL_EXT 0x8786 -#define GL_OP_ADD_EXT 0x8787 -#define GL_OP_MADD_EXT 0x8788 -#define GL_OP_FRAC_EXT 0x8789 -#define GL_OP_MAX_EXT 0x878A -#define GL_OP_MIN_EXT 0x878B -#define GL_OP_SET_GE_EXT 0x878C -#define GL_OP_SET_LT_EXT 0x878D -#define GL_OP_CLAMP_EXT 0x878E -#define GL_OP_FLOOR_EXT 0x878F -#define GL_OP_ROUND_EXT 0x8790 -#define GL_OP_EXP_BASE_2_EXT 0x8791 -#define GL_OP_LOG_BASE_2_EXT 0x8792 -#define GL_OP_POWER_EXT 0x8793 -#define GL_OP_RECIP_EXT 0x8794 -#define GL_OP_RECIP_SQRT_EXT 0x8795 -#define GL_OP_SUB_EXT 0x8796 -#define GL_OP_CROSS_PRODUCT_EXT 0x8797 -#define GL_OP_MULTIPLY_MATRIX_EXT 0x8798 -#define GL_OP_MOV_EXT 0x8799 -#define GL_OUTPUT_VERTEX_EXT 0x879A -#define GL_OUTPUT_COLOR0_EXT 0x879B -#define GL_OUTPUT_COLOR1_EXT 0x879C -#define GL_OUTPUT_TEXTURE_COORD0_EXT 0x879D -#define GL_OUTPUT_TEXTURE_COORD1_EXT 0x879E -#define GL_OUTPUT_TEXTURE_COORD2_EXT 0x879F -#define GL_OUTPUT_TEXTURE_COORD3_EXT 0x87A0 -#define GL_OUTPUT_TEXTURE_COORD4_EXT 0x87A1 -#define GL_OUTPUT_TEXTURE_COORD5_EXT 0x87A2 -#define GL_OUTPUT_TEXTURE_COORD6_EXT 0x87A3 -#define GL_OUTPUT_TEXTURE_COORD7_EXT 0x87A4 -#define GL_OUTPUT_TEXTURE_COORD8_EXT 0x87A5 -#define GL_OUTPUT_TEXTURE_COORD9_EXT 0x87A6 -#define GL_OUTPUT_TEXTURE_COORD10_EXT 0x87A7 -#define GL_OUTPUT_TEXTURE_COORD11_EXT 0x87A8 -#define GL_OUTPUT_TEXTURE_COORD12_EXT 0x87A9 -#define GL_OUTPUT_TEXTURE_COORD13_EXT 0x87AA -#define GL_OUTPUT_TEXTURE_COORD14_EXT 0x87AB -#define GL_OUTPUT_TEXTURE_COORD15_EXT 0x87AC -#define GL_OUTPUT_TEXTURE_COORD16_EXT 0x87AD -#define GL_OUTPUT_TEXTURE_COORD17_EXT 0x87AE -#define GL_OUTPUT_TEXTURE_COORD18_EXT 0x87AF -#define GL_OUTPUT_TEXTURE_COORD19_EXT 0x87B0 -#define GL_OUTPUT_TEXTURE_COORD20_EXT 0x87B1 -#define GL_OUTPUT_TEXTURE_COORD21_EXT 0x87B2 -#define GL_OUTPUT_TEXTURE_COORD22_EXT 0x87B3 -#define GL_OUTPUT_TEXTURE_COORD23_EXT 0x87B4 -#define GL_OUTPUT_TEXTURE_COORD24_EXT 0x87B5 -#define GL_OUTPUT_TEXTURE_COORD25_EXT 0x87B6 -#define GL_OUTPUT_TEXTURE_COORD26_EXT 0x87B7 -#define GL_OUTPUT_TEXTURE_COORD27_EXT 0x87B8 -#define GL_OUTPUT_TEXTURE_COORD28_EXT 0x87B9 -#define GL_OUTPUT_TEXTURE_COORD29_EXT 0x87BA -#define GL_OUTPUT_TEXTURE_COORD30_EXT 0x87BB -#define GL_OUTPUT_TEXTURE_COORD31_EXT 0x87BC -#define GL_OUTPUT_FOG_EXT 0x87BD -#define GL_SCALAR_EXT 0x87BE -#define GL_VECTOR_EXT 0x87BF -#define GL_MATRIX_EXT 0x87C0 -#define GL_VARIANT_EXT 0x87C1 -#define GL_INVARIANT_EXT 0x87C2 -#define GL_LOCAL_CONSTANT_EXT 0x87C3 -#define GL_LOCAL_EXT 0x87C4 -#define GL_MAX_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87C5 -#define GL_MAX_VERTEX_SHADER_VARIANTS_EXT 0x87C6 -#define GL_MAX_VERTEX_SHADER_INVARIANTS_EXT 0x87C7 -#define GL_MAX_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87C8 -#define GL_MAX_VERTEX_SHADER_LOCALS_EXT 0x87C9 -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CA -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_VARIANTS_EXT 0x87CB -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87CC -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_INVARIANTS_EXT 0x87CD -#define GL_MAX_OPTIMIZED_VERTEX_SHADER_LOCALS_EXT 0x87CE -#define GL_VERTEX_SHADER_INSTRUCTIONS_EXT 0x87CF -#define GL_VERTEX_SHADER_VARIANTS_EXT 0x87D0 -#define GL_VERTEX_SHADER_INVARIANTS_EXT 0x87D1 -#define GL_VERTEX_SHADER_LOCAL_CONSTANTS_EXT 0x87D2 -#define GL_VERTEX_SHADER_LOCALS_EXT 0x87D3 -#define GL_VERTEX_SHADER_OPTIMIZED_EXT 0x87D4 -#define GL_X_EXT 0x87D5 -#define GL_Y_EXT 0x87D6 -#define GL_Z_EXT 0x87D7 -#define GL_W_EXT 0x87D8 -#define GL_NEGATIVE_X_EXT 0x87D9 -#define GL_NEGATIVE_Y_EXT 0x87DA -#define GL_NEGATIVE_Z_EXT 0x87DB -#define GL_NEGATIVE_W_EXT 0x87DC -#define GL_ZERO_EXT 0x87DD -#define GL_ONE_EXT 0x87DE -#define GL_NEGATIVE_ONE_EXT 0x87DF -#define GL_NORMALIZED_RANGE_EXT 0x87E0 -#define GL_FULL_RANGE_EXT 0x87E1 -#define GL_CURRENT_VERTEX_EXT 0x87E2 -#define GL_MVP_MATRIX_EXT 0x87E3 -#define GL_VARIANT_VALUE_EXT 0x87E4 -#define GL_VARIANT_DATATYPE_EXT 0x87E5 -#define GL_VARIANT_ARRAY_STRIDE_EXT 0x87E6 -#define GL_VARIANT_ARRAY_TYPE_EXT 0x87E7 -#define GL_VARIANT_ARRAY_EXT 0x87E8 -#define GL_VARIANT_ARRAY_POINTER_EXT 0x87E9 -#define GL_INVARIANT_VALUE_EXT 0x87EA -#define GL_INVARIANT_DATATYPE_EXT 0x87EB -#define GL_LOCAL_CONSTANT_VALUE_EXT 0x87EC -#define GL_LOCAL_CONSTANT_DATATYPE_EXT 0x87ED -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_MAX_VERTEX_STREAMS_ATI 0x876B -#define GL_VERTEX_STREAM0_ATI 0x876C -#define GL_VERTEX_STREAM1_ATI 0x876D -#define GL_VERTEX_STREAM2_ATI 0x876E -#define GL_VERTEX_STREAM3_ATI 0x876F -#define GL_VERTEX_STREAM4_ATI 0x8770 -#define GL_VERTEX_STREAM5_ATI 0x8771 -#define GL_VERTEX_STREAM6_ATI 0x8772 -#define GL_VERTEX_STREAM7_ATI 0x8773 -#define GL_VERTEX_SOURCE_ATI 0x8774 -#endif - -#ifndef GL_ATI_element_array -#define GL_ELEMENT_ARRAY_ATI 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_ATI 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_ATI 0x876A -#endif - -#ifndef GL_SUN_mesh_array -#define GL_QUAD_MESH_SUN 0x8614 -#define GL_TRIANGLE_MESH_SUN 0x8615 -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SLICE_ACCUM_SUN 0x85CC -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_MULTISAMPLE_FILTER_HINT_NV 0x8534 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_DEPTH_CLAMP_NV 0x864F -#endif - -#ifndef GL_NV_occlusion_query -#define GL_PIXEL_COUNTER_BITS_NV 0x8864 -#define GL_CURRENT_OCCLUSION_QUERY_ID_NV 0x8865 -#define GL_PIXEL_COUNT_NV 0x8866 -#define GL_PIXEL_COUNT_AVAILABLE_NV 0x8867 -#endif - -#ifndef GL_NV_point_sprite -#define GL_POINT_SPRITE_NV 0x8861 -#define GL_COORD_REPLACE_NV 0x8862 -#define GL_POINT_SPRITE_R_MODE_NV 0x8863 -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_NV 0x8850 -#define GL_OFFSET_PROJECTIVE_TEXTURE_2D_SCALE_NV 0x8851 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8852 -#define GL_OFFSET_PROJECTIVE_TEXTURE_RECTANGLE_SCALE_NV 0x8853 -#define GL_OFFSET_HILO_TEXTURE_2D_NV 0x8854 -#define GL_OFFSET_HILO_TEXTURE_RECTANGLE_NV 0x8855 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_2D_NV 0x8856 -#define GL_OFFSET_HILO_PROJECTIVE_TEXTURE_RECTANGLE_NV 0x8857 -#define GL_DEPENDENT_HILO_TEXTURE_2D_NV 0x8858 -#define GL_DEPENDENT_RGB_TEXTURE_3D_NV 0x8859 -#define GL_DEPENDENT_RGB_TEXTURE_CUBE_MAP_NV 0x885A -#define GL_DOT_PRODUCT_PASS_THROUGH_NV 0x885B -#define GL_DOT_PRODUCT_TEXTURE_1D_NV 0x885C -#define GL_DOT_PRODUCT_AFFINE_DEPTH_REPLACE_NV 0x885D -#define GL_HILO8_NV 0x885E -#define GL_SIGNED_HILO8_NV 0x885F -#define GL_FORCE_BLUE_TO_ONE_NV 0x8860 -#endif - -#ifndef GL_NV_vertex_program1_1 -#endif - -#ifndef GL_EXT_shadow_funcs -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_STENCIL_TEST_TWO_SIDE_EXT 0x8910 -#define GL_ACTIVE_STENCIL_FACE_EXT 0x8911 -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_TEXT_FRAGMENT_SHADER_ATI 0x8200 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_UNPACK_CLIENT_STORAGE_APPLE 0x85B2 -#endif - -#ifndef GL_APPLE_element_array -#define GL_ELEMENT_ARRAY_APPLE 0x8768 -#define GL_ELEMENT_ARRAY_TYPE_APPLE 0x8769 -#define GL_ELEMENT_ARRAY_POINTER_APPLE 0x876A -#endif - -#ifndef GL_APPLE_fence -#define GL_DRAW_PIXELS_APPLE 0x8A0A -#define GL_FENCE_APPLE 0x8A0B -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_VERTEX_ARRAY_BINDING_APPLE 0x85B5 -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_VERTEX_ARRAY_RANGE_APPLE 0x851D -#define GL_VERTEX_ARRAY_RANGE_LENGTH_APPLE 0x851E -#define GL_VERTEX_ARRAY_STORAGE_HINT_APPLE 0x851F -#define GL_VERTEX_ARRAY_RANGE_POINTER_APPLE 0x8521 -#define GL_STORAGE_CACHED_APPLE 0x85BE -#define GL_STORAGE_SHARED_APPLE 0x85BF -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_YCBCR_422_APPLE 0x85B9 -#define GL_UNSIGNED_SHORT_8_8_APPLE 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_APPLE 0x85BB -#endif - -#ifndef GL_S3_s3tc -#define GL_RGB_S3TC 0x83A0 -#define GL_RGB4_S3TC 0x83A1 -#define GL_RGBA_S3TC 0x83A2 -#define GL_RGBA4_S3TC 0x83A3 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_MAX_DRAW_BUFFERS_ATI 0x8824 -#define GL_DRAW_BUFFER0_ATI 0x8825 -#define GL_DRAW_BUFFER1_ATI 0x8826 -#define GL_DRAW_BUFFER2_ATI 0x8827 -#define GL_DRAW_BUFFER3_ATI 0x8828 -#define GL_DRAW_BUFFER4_ATI 0x8829 -#define GL_DRAW_BUFFER5_ATI 0x882A -#define GL_DRAW_BUFFER6_ATI 0x882B -#define GL_DRAW_BUFFER7_ATI 0x882C -#define GL_DRAW_BUFFER8_ATI 0x882D -#define GL_DRAW_BUFFER9_ATI 0x882E -#define GL_DRAW_BUFFER10_ATI 0x882F -#define GL_DRAW_BUFFER11_ATI 0x8830 -#define GL_DRAW_BUFFER12_ATI 0x8831 -#define GL_DRAW_BUFFER13_ATI 0x8832 -#define GL_DRAW_BUFFER14_ATI 0x8833 -#define GL_DRAW_BUFFER15_ATI 0x8834 -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_TYPE_RGBA_FLOAT_ATI 0x8820 -#define GL_COLOR_CLEAR_UNCLAMPED_VALUE_ATI 0x8835 -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_MODULATE_ADD_ATI 0x8744 -#define GL_MODULATE_SIGNED_ADD_ATI 0x8745 -#define GL_MODULATE_SUBTRACT_ATI 0x8746 -#endif - -#ifndef GL_ATI_texture_float -#define GL_RGBA_FLOAT32_ATI 0x8814 -#define GL_RGB_FLOAT32_ATI 0x8815 -#define GL_ALPHA_FLOAT32_ATI 0x8816 -#define GL_INTENSITY_FLOAT32_ATI 0x8817 -#define GL_LUMINANCE_FLOAT32_ATI 0x8818 -#define GL_LUMINANCE_ALPHA_FLOAT32_ATI 0x8819 -#define GL_RGBA_FLOAT16_ATI 0x881A -#define GL_RGB_FLOAT16_ATI 0x881B -#define GL_ALPHA_FLOAT16_ATI 0x881C -#define GL_INTENSITY_FLOAT16_ATI 0x881D -#define GL_LUMINANCE_FLOAT16_ATI 0x881E -#define GL_LUMINANCE_ALPHA_FLOAT16_ATI 0x881F -#endif - -#ifndef GL_NV_float_buffer -#define GL_FLOAT_R_NV 0x8880 -#define GL_FLOAT_RG_NV 0x8881 -#define GL_FLOAT_RGB_NV 0x8882 -#define GL_FLOAT_RGBA_NV 0x8883 -#define GL_FLOAT_R16_NV 0x8884 -#define GL_FLOAT_R32_NV 0x8885 -#define GL_FLOAT_RG16_NV 0x8886 -#define GL_FLOAT_RG32_NV 0x8887 -#define GL_FLOAT_RGB16_NV 0x8888 -#define GL_FLOAT_RGB32_NV 0x8889 -#define GL_FLOAT_RGBA16_NV 0x888A -#define GL_FLOAT_RGBA32_NV 0x888B -#define GL_TEXTURE_FLOAT_COMPONENTS_NV 0x888C -#define GL_FLOAT_CLEAR_COLOR_VALUE_NV 0x888D -#define GL_FLOAT_RGBA_MODE_NV 0x888E -#endif - -#ifndef GL_NV_fragment_program -#define GL_MAX_FRAGMENT_PROGRAM_LOCAL_PARAMETERS_NV 0x8868 -#define GL_FRAGMENT_PROGRAM_NV 0x8870 -#define GL_MAX_TEXTURE_COORDS_NV 0x8871 -#define GL_MAX_TEXTURE_IMAGE_UNITS_NV 0x8872 -#define GL_FRAGMENT_PROGRAM_BINDING_NV 0x8873 -#define GL_PROGRAM_ERROR_STRING_NV 0x8874 -#endif - -#ifndef GL_NV_half_float -#define GL_HALF_FLOAT_NV 0x140B -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_WRITE_PIXEL_DATA_RANGE_NV 0x8878 -#define GL_READ_PIXEL_DATA_RANGE_NV 0x8879 -#define GL_WRITE_PIXEL_DATA_RANGE_LENGTH_NV 0x887A -#define GL_READ_PIXEL_DATA_RANGE_LENGTH_NV 0x887B -#define GL_WRITE_PIXEL_DATA_RANGE_POINTER_NV 0x887C -#define GL_READ_PIXEL_DATA_RANGE_POINTER_NV 0x887D -#endif - -#ifndef GL_NV_primitive_restart -#define GL_PRIMITIVE_RESTART_NV 0x8558 -#define GL_PRIMITIVE_RESTART_INDEX_NV 0x8559 -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_TEXTURE_UNSIGNED_REMAP_MODE_NV 0x888F -#endif - -#ifndef GL_NV_vertex_program2 -#endif - -#ifndef GL_ATI_map_object_buffer -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_STENCIL_BACK_FUNC_ATI 0x8800 -#define GL_STENCIL_BACK_FAIL_ATI 0x8801 -#define GL_STENCIL_BACK_PASS_DEPTH_FAIL_ATI 0x8802 -#define GL_STENCIL_BACK_PASS_DEPTH_PASS_ATI 0x8803 -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#endif - -#ifndef GL_OES_read_format -#define GL_IMPLEMENTATION_COLOR_READ_TYPE_OES 0x8B9A -#define GL_IMPLEMENTATION_COLOR_READ_FORMAT_OES 0x8B9B -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_DEPTH_BOUNDS_TEST_EXT 0x8890 -#define GL_DEPTH_BOUNDS_EXT 0x8891 -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_MIRROR_CLAMP_EXT 0x8742 -#define GL_MIRROR_CLAMP_TO_EDGE_EXT 0x8743 -#define GL_MIRROR_CLAMP_TO_BORDER_EXT 0x8912 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_BLEND_EQUATION_RGB_EXT GL_BLEND_EQUATION -#define GL_BLEND_EQUATION_ALPHA_EXT 0x883D -#endif - -#ifndef GL_MESA_pack_invert -#define GL_PACK_INVERT_MESA 0x8758 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_UNSIGNED_SHORT_8_8_MESA 0x85BA -#define GL_UNSIGNED_SHORT_8_8_REV_MESA 0x85BB -#define GL_YCBCR_MESA 0x8757 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_PIXEL_PACK_BUFFER_EXT 0x88EB -#define GL_PIXEL_UNPACK_BUFFER_EXT 0x88EC -#define GL_PIXEL_PACK_BUFFER_BINDING_EXT 0x88ED -#define GL_PIXEL_UNPACK_BUFFER_BINDING_EXT 0x88EF -#endif - -#ifndef GL_NV_fragment_program_option -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV 0x88F4 -#define GL_MAX_PROGRAM_CALL_DEPTH_NV 0x88F5 -#define GL_MAX_PROGRAM_IF_DEPTH_NV 0x88F6 -#define GL_MAX_PROGRAM_LOOP_DEPTH_NV 0x88F7 -#define GL_MAX_PROGRAM_LOOP_COUNT_NV 0x88F8 -#endif - -#ifndef GL_NV_vertex_program2_option -/* reuse GL_MAX_PROGRAM_EXEC_INSTRUCTIONS_NV */ -/* reuse GL_MAX_PROGRAM_CALL_DEPTH_NV */ -#endif - -#ifndef GL_NV_vertex_program3 -/* reuse GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS_ARB */ -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_INVALID_FRAMEBUFFER_OPERATION_EXT 0x0506 -#define GL_MAX_RENDERBUFFER_SIZE_EXT 0x84E8 -#define GL_FRAMEBUFFER_BINDING_EXT 0x8CA6 -#define GL_RENDERBUFFER_BINDING_EXT 0x8CA7 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE_EXT 0x8CD0 -#define GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME_EXT 0x8CD1 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL_EXT 0x8CD2 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE_EXT 0x8CD3 -#define GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_3D_ZOFFSET_EXT 0x8CD4 -#define GL_FRAMEBUFFER_COMPLETE_EXT 0x8CD5 -#define GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT_EXT 0x8CD6 -#define GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT_EXT 0x8CD7 -#define GL_FRAMEBUFFER_INCOMPLETE_DUPLICATE_ATTACHMENT_EXT 0x8CD8 -#define GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS_EXT 0x8CD9 -#define GL_FRAMEBUFFER_INCOMPLETE_FORMATS_EXT 0x8CDA -#define GL_FRAMEBUFFER_INCOMPLETE_DRAW_BUFFER_EXT 0x8CDB -#define GL_FRAMEBUFFER_INCOMPLETE_READ_BUFFER_EXT 0x8CDC -#define GL_FRAMEBUFFER_UNSUPPORTED_EXT 0x8CDD -#define GL_MAX_COLOR_ATTACHMENTS_EXT 0x8CDF -#define GL_COLOR_ATTACHMENT0_EXT 0x8CE0 -#define GL_COLOR_ATTACHMENT1_EXT 0x8CE1 -#define GL_COLOR_ATTACHMENT2_EXT 0x8CE2 -#define GL_COLOR_ATTACHMENT3_EXT 0x8CE3 -#define GL_COLOR_ATTACHMENT4_EXT 0x8CE4 -#define GL_COLOR_ATTACHMENT5_EXT 0x8CE5 -#define GL_COLOR_ATTACHMENT6_EXT 0x8CE6 -#define GL_COLOR_ATTACHMENT7_EXT 0x8CE7 -#define GL_COLOR_ATTACHMENT8_EXT 0x8CE8 -#define GL_COLOR_ATTACHMENT9_EXT 0x8CE9 -#define GL_COLOR_ATTACHMENT10_EXT 0x8CEA -#define GL_COLOR_ATTACHMENT11_EXT 0x8CEB -#define GL_COLOR_ATTACHMENT12_EXT 0x8CEC -#define GL_COLOR_ATTACHMENT13_EXT 0x8CED -#define GL_COLOR_ATTACHMENT14_EXT 0x8CEE -#define GL_COLOR_ATTACHMENT15_EXT 0x8CEF -#define GL_DEPTH_ATTACHMENT_EXT 0x8D00 -#define GL_STENCIL_ATTACHMENT_EXT 0x8D20 -#define GL_FRAMEBUFFER_EXT 0x8D40 -#define GL_RENDERBUFFER_EXT 0x8D41 -#define GL_RENDERBUFFER_WIDTH_EXT 0x8D42 -#define GL_RENDERBUFFER_HEIGHT_EXT 0x8D43 -#define GL_RENDERBUFFER_INTERNAL_FORMAT_EXT 0x8D44 -#define GL_STENCIL_INDEX1_EXT 0x8D46 -#define GL_STENCIL_INDEX4_EXT 0x8D47 -#define GL_STENCIL_INDEX8_EXT 0x8D48 -#define GL_STENCIL_INDEX16_EXT 0x8D49 -#define GL_RENDERBUFFER_RED_SIZE_EXT 0x8D50 -#define GL_RENDERBUFFER_GREEN_SIZE_EXT 0x8D51 -#define GL_RENDERBUFFER_BLUE_SIZE_EXT 0x8D52 -#define GL_RENDERBUFFER_ALPHA_SIZE_EXT 0x8D53 -#define GL_RENDERBUFFER_DEPTH_SIZE_EXT 0x8D54 -#define GL_RENDERBUFFER_STENCIL_SIZE_EXT 0x8D55 -#endif - -#ifndef GL_GREMEDY_string_marker -#endif - - -/*************************************************************/ - -#include -#ifndef GL_VERSION_2_0 -/* GL type for program/shader text */ -typedef char GLchar; /* native character */ -#endif - -#ifndef GL_VERSION_1_5 -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptr; -typedef ptrdiff_t GLsizeiptr; -#endif - -#ifndef GL_ARB_vertex_buffer_object -/* GL types for handling large vertex buffer objects */ -typedef ptrdiff_t GLintptrARB; -typedef ptrdiff_t GLsizeiptrARB; -#endif - -#ifndef GL_ARB_shader_objects -/* GL types for handling shader object handles and program/shader text */ -typedef char GLcharARB; /* native character */ -typedef unsigned int GLhandleARB; /* shader object handle */ -#endif - -/* GL types for "half" precision (s10e5) float data in host memory */ -#ifndef GL_ARB_half_float_pixel -typedef unsigned short GLhalfARB; -#endif - -#ifndef GL_NV_half_float -/* GL type for representing NVIDIA "half" floating point type in host memory */ -typedef unsigned short GLhalfNV; -#endif - -#ifndef GL_VERSION_1_2 -#define GL_VERSION_1_2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColor (GLclampf, GLclampf, GLclampf, GLclampf); -GLAPI void APIENTRY glBlendEquation (GLenum); -GLAPI void APIENTRY glDrawRangeElements (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTable (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTable (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTable (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glColorSubTable (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTable (GLenum, GLsizei, GLint, GLint, GLsizei); -GLAPI void APIENTRY glConvolutionFilter1D (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterf (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfv (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteri (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameteriv (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1D (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2D (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilter (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilter (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2D (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -GLAPI void APIENTRY glGetHistogram (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmax (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfv (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogram (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmax (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogram (GLenum); -GLAPI void APIENTRY glResetMinmax (GLenum); -GLAPI void APIENTRY glTexImage3D (GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLORPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -typedef void (APIENTRYP PFNGLBLENDEQUATIONPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -typedef void (APIENTRYP PFNGLCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLEPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTERPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXPROC) (GLenum target); -typedef void (APIENTRYP PFNGLTEXIMAGE3DPROC) (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_VERSION_1_3 -#define GL_VERSION_1_3 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTexture (GLenum); -GLAPI void APIENTRY glClientActiveTexture (GLenum); -GLAPI void APIENTRY glMultiTexCoord1d (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1f (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1i (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1s (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2d (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2f (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2i (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2s (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3d (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3f (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3i (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3s (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3sv (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4d (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dv (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4f (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fv (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4i (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4iv (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4s (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4sv (GLenum, const GLshort *); -GLAPI void APIENTRY glLoadTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixf (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixd (const GLdouble *); -GLAPI void APIENTRY glSampleCoverage (GLclampf, GLboolean); -GLAPI void APIENTRY glCompressedTexImage3D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2D (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1D (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3D (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2D (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1D (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImage (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_VERSION_1_4 -#define GL_VERSION_1_4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glFogCoordf (GLfloat); -GLAPI void APIENTRY glFogCoordfv (const GLfloat *); -GLAPI void APIENTRY glFogCoordd (GLdouble); -GLAPI void APIENTRY glFogCoorddv (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointer (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glMultiDrawArrays (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElements (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -GLAPI void APIENTRY glPointParameterf (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfv (GLenum, const GLfloat *); -GLAPI void APIENTRY glPointParameteri (GLenum, GLint); -GLAPI void APIENTRY glPointParameteriv (GLenum, const GLint *); -GLAPI void APIENTRY glSecondaryColor3b (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bv (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dv (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fv (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3i (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3iv (const GLint *); -GLAPI void APIENTRY glSecondaryColor3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3sv (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ub (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubv (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3ui (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uiv (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3us (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usv (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointer (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glWindowPos2d (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos2f (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos2i (GLint, GLint); -GLAPI void APIENTRY glWindowPos2iv (const GLint *); -GLAPI void APIENTRY glWindowPos2s (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2sv (const GLshort *); -GLAPI void APIENTRY glWindowPos3d (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dv (const GLdouble *); -GLAPI void APIENTRY glWindowPos3f (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fv (const GLfloat *); -GLAPI void APIENTRY glWindowPos3i (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3iv (const GLint *); -GLAPI void APIENTRY glWindowPos3s (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3sv (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -typedef void (APIENTRYP PFNGLFOGCOORDFPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLWINDOWPOS2DPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVPROC) (const GLshort *v); -#endif - -#ifndef GL_VERSION_1_5 -#define GL_VERSION_1_5 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueries (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueries (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQuery (GLuint); -GLAPI void APIENTRY glBeginQuery (GLenum, GLuint); -GLAPI void APIENTRY glEndQuery (GLenum); -GLAPI void APIENTRY glGetQueryiv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuiv (GLuint, GLenum, GLuint *); -GLAPI void APIENTRY glBindBuffer (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffers (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffers (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBuffer (GLuint); -GLAPI void APIENTRY glBufferData (GLenum, GLsizeiptr, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubData (GLenum, GLintptr, GLsizeiptr, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubData (GLenum, GLintptr, GLsizeiptr, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBuffer (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBuffer (GLenum); -GLAPI void APIENTRY glGetBufferParameteriv (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointerv (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVPROC) (GLuint id, GLenum pname, GLuint *params); -typedef void (APIENTRYP PFNGLBINDBUFFERPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAPROC) (GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAPROC) (GLenum target, GLintptr offset, GLsizeiptr size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_VERSION_2_0 -#define GL_VERSION_2_0 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparate (GLenum, GLenum); -GLAPI void APIENTRY glDrawBuffers (GLsizei, const GLenum *); -GLAPI void APIENTRY glStencilOpSeparate (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparate (GLenum, GLenum, GLint, GLuint); -GLAPI void APIENTRY glStencilMaskSeparate (GLenum, GLuint); -GLAPI void APIENTRY glAttachShader (GLuint, GLuint); -GLAPI void APIENTRY glBindAttribLocation (GLuint, GLuint, const GLchar *); -GLAPI void APIENTRY glCompileShader (GLuint); -GLAPI GLuint APIENTRY glCreateProgram (void); -GLAPI GLuint APIENTRY glCreateShader (GLenum); -GLAPI void APIENTRY glDeleteProgram (GLuint); -GLAPI void APIENTRY glDeleteShader (GLuint); -GLAPI void APIENTRY glDetachShader (GLuint, GLuint); -GLAPI void APIENTRY glDisableVertexAttribArray (GLuint); -GLAPI void APIENTRY glEnableVertexAttribArray (GLuint); -GLAPI void APIENTRY glGetActiveAttrib (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetActiveUniform (GLuint, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLchar *); -GLAPI void APIENTRY glGetAttachedShaders (GLuint, GLsizei, GLsizei *, GLuint *); -GLAPI GLint APIENTRY glGetAttribLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetProgramiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetShaderInfoLog (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI void APIENTRY glGetShaderSource (GLuint, GLsizei, GLsizei *, GLchar *); -GLAPI GLint APIENTRY glGetUniformLocation (GLuint, const GLchar *); -GLAPI void APIENTRY glGetUniformfv (GLuint, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformiv (GLuint, GLint, GLint *); -GLAPI void APIENTRY glGetVertexAttribdv (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfv (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribiv (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointerv (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgram (GLuint); -GLAPI GLboolean APIENTRY glIsShader (GLuint); -GLAPI void APIENTRY glLinkProgram (GLuint); -GLAPI void APIENTRY glShaderSource (GLuint, GLsizei, const GLchar* *, const GLint *); -GLAPI void APIENTRY glUseProgram (GLuint); -GLAPI void APIENTRY glUniform1f (GLint, GLfloat); -GLAPI void APIENTRY glUniform2f (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3f (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4f (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1i (GLint, GLint); -GLAPI void APIENTRY glUniform2i (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3i (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4i (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fv (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4iv (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fv (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glValidateProgram (GLuint); -GLAPI void APIENTRY glVertexAttrib1d (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1f (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1s (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2d (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2f (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2s (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3d (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3f (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3s (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nbv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4Niv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4Nsv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4Nub (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4Nubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4Nuiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4Nusv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bv (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4d (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dv (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4f (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fv (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4iv (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4s (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4sv (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubv (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uiv (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usv (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointer (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEPROC) (GLenum modeRGB, GLenum modeAlpha); -typedef void (APIENTRYP PFNGLDRAWBUFFERSPROC) (GLsizei n, const GLenum *bufs); -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -typedef void (APIENTRYP PFNGLSTENCILMASKSEPARATEPROC) (GLenum face, GLuint mask); -typedef void (APIENTRYP PFNGLATTACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONPROC) (GLuint program, GLuint index, const GLchar *name); -typedef void (APIENTRYP PFNGLCOMPILESHADERPROC) (GLuint shader); -typedef GLuint (APIENTRYP PFNGLCREATEPROGRAMPROC) (void); -typedef GLuint (APIENTRYP PFNGLCREATESHADERPROC) (GLenum type); -typedef void (APIENTRYP PFNGLDELETEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLDELETESHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLDETACHSHADERPROC) (GLuint program, GLuint shader); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYPROC) (GLuint index); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMPROC) (GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name); -typedef void (APIENTRYP PFNGLGETATTACHEDSHADERSPROC) (GLuint program, GLsizei maxCount, GLsizei *count, GLuint *obj); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETPROGRAMIVPROC) (GLuint program, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMINFOLOGPROC) (GLuint program, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERIVPROC) (GLuint shader, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERINFOLOGPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *infoLog); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEPROC) (GLuint shader, GLsizei bufSize, GLsizei *length, GLchar *source); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONPROC) (GLuint program, const GLchar *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVPROC) (GLuint program, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVPROC) (GLuint program, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMPROC) (GLuint program); -typedef GLboolean (APIENTRYP PFNGLISSHADERPROC) (GLuint shader); -typedef void (APIENTRYP PFNGLLINKPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLSHADERSOURCEPROC) (GLuint shader, GLsizei count, const GLchar* *string, const GLint *length); -typedef void (APIENTRYP PFNGLUSEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLUNIFORM1FPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMPROC) (GLuint program); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_multitexture -#define GL_ARB_multitexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveTextureARB (GLenum); -GLAPI void APIENTRY glClientActiveTextureARB (GLenum); -GLAPI void APIENTRY glMultiTexCoord1dARB (GLenum, GLdouble); -GLAPI void APIENTRY glMultiTexCoord1dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord1fARB (GLenum, GLfloat); -GLAPI void APIENTRY glMultiTexCoord1fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord1iARB (GLenum, GLint); -GLAPI void APIENTRY glMultiTexCoord1ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord1sARB (GLenum, GLshort); -GLAPI void APIENTRY glMultiTexCoord1svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord2dARB (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord2dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord2fARB (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord2fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord2iARB (GLenum, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord2ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord2sARB (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord2svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord3dARB (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord3dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord3fARB (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord3fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord3iARB (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord3ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord3sARB (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord3svARB (GLenum, const GLshort *); -GLAPI void APIENTRY glMultiTexCoord4dARB (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glMultiTexCoord4dvARB (GLenum, const GLdouble *); -GLAPI void APIENTRY glMultiTexCoord4fARB (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glMultiTexCoord4fvARB (GLenum, const GLfloat *); -GLAPI void APIENTRY glMultiTexCoord4iARB (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glMultiTexCoord4ivARB (GLenum, const GLint *); -GLAPI void APIENTRY glMultiTexCoord4sARB (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glMultiTexCoord4svARB (GLenum, const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLCLIENTACTIVETEXTUREARBPROC) (GLenum texture); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DARBPROC) (GLenum target, GLdouble s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FARBPROC) (GLenum target, GLfloat s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IARBPROC) (GLenum target, GLint s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SARBPROC) (GLenum target, GLshort s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DARBPROC) (GLenum target, GLdouble s, GLdouble t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FARBPROC) (GLenum target, GLfloat s, GLfloat t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IARBPROC) (GLenum target, GLint s, GLint t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SARBPROC) (GLenum target, GLshort s, GLshort t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IARBPROC) (GLenum target, GLint s, GLint t, GLint r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3SVARBPROC) (GLenum target, const GLshort *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DARBPROC) (GLenum target, GLdouble s, GLdouble t, GLdouble r, GLdouble q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4DVARBPROC) (GLenum target, const GLdouble *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FARBPROC) (GLenum target, GLfloat s, GLfloat t, GLfloat r, GLfloat q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4FVARBPROC) (GLenum target, const GLfloat *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IARBPROC) (GLenum target, GLint s, GLint t, GLint r, GLint q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4IVARBPROC) (GLenum target, const GLint *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SARBPROC) (GLenum target, GLshort s, GLshort t, GLshort r, GLshort q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4SVARBPROC) (GLenum target, const GLshort *v); -#endif - -#ifndef GL_ARB_transpose_matrix -#define GL_ARB_transpose_matrix 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLoadTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glLoadTransposeMatrixdARB (const GLdouble *); -GLAPI void APIENTRY glMultTransposeMatrixfARB (const GLfloat *); -GLAPI void APIENTRY glMultTransposeMatrixdARB (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLLOADTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXFARBPROC) (const GLfloat *m); -typedef void (APIENTRYP PFNGLMULTTRANSPOSEMATRIXDARBPROC) (const GLdouble *m); -#endif - -#ifndef GL_ARB_multisample -#define GL_ARB_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleCoverageARB (GLclampf, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLECOVERAGEARBPROC) (GLclampf value, GLboolean invert); -#endif - -#ifndef GL_ARB_texture_env_add -#define GL_ARB_texture_env_add 1 -#endif - -#ifndef GL_ARB_texture_cube_map -#define GL_ARB_texture_cube_map 1 -#endif - -#ifndef GL_ARB_texture_compression -#define GL_ARB_texture_compression 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCompressedTexImage3DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage2DARB (GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexImage1DARB (GLenum, GLint, GLenum, GLsizei, GLint, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage3DARB (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage2DARB (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glCompressedTexSubImage1DARB (GLenum, GLint, GLint, GLsizei, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glGetCompressedTexImageARB (GLenum, GLint, GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE3DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE2DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXIMAGE1DARBPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLint border, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE3DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE2DARBPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOMPRESSEDTEXSUBIMAGE1DARBPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLsizei imageSize, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOMPRESSEDTEXIMAGEARBPROC) (GLenum target, GLint level, GLvoid *img); -#endif - -#ifndef GL_ARB_texture_border_clamp -#define GL_ARB_texture_border_clamp 1 -#endif - -#ifndef GL_ARB_point_parameters -#define GL_ARB_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfARB (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvARB (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFARBPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVARBPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_ARB_vertex_blend -#define GL_ARB_vertex_blend 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWeightbvARB (GLint, const GLbyte *); -GLAPI void APIENTRY glWeightsvARB (GLint, const GLshort *); -GLAPI void APIENTRY glWeightivARB (GLint, const GLint *); -GLAPI void APIENTRY glWeightfvARB (GLint, const GLfloat *); -GLAPI void APIENTRY glWeightdvARB (GLint, const GLdouble *); -GLAPI void APIENTRY glWeightubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glWeightusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glWeightuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glWeightPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexBlendARB (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWEIGHTBVARBPROC) (GLint size, const GLbyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTSVARBPROC) (GLint size, const GLshort *weights); -typedef void (APIENTRYP PFNGLWEIGHTIVARBPROC) (GLint size, const GLint *weights); -typedef void (APIENTRYP PFNGLWEIGHTFVARBPROC) (GLint size, const GLfloat *weights); -typedef void (APIENTRYP PFNGLWEIGHTDVARBPROC) (GLint size, const GLdouble *weights); -typedef void (APIENTRYP PFNGLWEIGHTUBVARBPROC) (GLint size, const GLubyte *weights); -typedef void (APIENTRYP PFNGLWEIGHTUSVARBPROC) (GLint size, const GLushort *weights); -typedef void (APIENTRYP PFNGLWEIGHTUIVARBPROC) (GLint size, const GLuint *weights); -typedef void (APIENTRYP PFNGLWEIGHTPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXBLENDARBPROC) (GLint count); -#endif - -#ifndef GL_ARB_matrix_palette -#define GL_ARB_matrix_palette 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCurrentPaletteMatrixARB (GLint); -GLAPI void APIENTRY glMatrixIndexubvARB (GLint, const GLubyte *); -GLAPI void APIENTRY glMatrixIndexusvARB (GLint, const GLushort *); -GLAPI void APIENTRY glMatrixIndexuivARB (GLint, const GLuint *); -GLAPI void APIENTRY glMatrixIndexPointerARB (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCURRENTPALETTEMATRIXARBPROC) (GLint index); -typedef void (APIENTRYP PFNGLMATRIXINDEXUBVARBPROC) (GLint size, const GLubyte *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUSVARBPROC) (GLint size, const GLushort *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXUIVARBPROC) (GLint size, const GLuint *indices); -typedef void (APIENTRYP PFNGLMATRIXINDEXPOINTERARBPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_ARB_texture_env_combine -#define GL_ARB_texture_env_combine 1 -#endif - -#ifndef GL_ARB_texture_env_crossbar -#define GL_ARB_texture_env_crossbar 1 -#endif - -#ifndef GL_ARB_texture_env_dot3 -#define GL_ARB_texture_env_dot3 1 -#endif - -#ifndef GL_ARB_texture_mirrored_repeat -#define GL_ARB_texture_mirrored_repeat 1 -#endif - -#ifndef GL_ARB_depth_texture -#define GL_ARB_depth_texture 1 -#endif - -#ifndef GL_ARB_shadow -#define GL_ARB_shadow 1 -#endif - -#ifndef GL_ARB_shadow_ambient -#define GL_ARB_shadow_ambient 1 -#endif - -#ifndef GL_ARB_window_pos -#define GL_ARB_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dARB (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fARB (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iARB (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos2sARB (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svARB (const GLshort *); -GLAPI void APIENTRY glWindowPos3dARB (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvARB (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fARB (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvARB (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivARB (const GLint *); -GLAPI void APIENTRY glWindowPos3sARB (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svARB (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DARBPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FARBPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IARBPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SARBPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVARBPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DARBPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVARBPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FARBPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVARBPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IARBPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVARBPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SARBPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVARBPROC) (const GLshort *v); -#endif - -#ifndef GL_ARB_vertex_program -#define GL_ARB_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttrib1dARB (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fARB (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sARB (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dARB (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fARB (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sARB (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dARB (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fARB (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sARB (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NbvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4NivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4NsvARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4NubARB (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4NubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4NuivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4NusvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttrib4bvARB (GLuint, const GLbyte *); -GLAPI void APIENTRY glVertexAttrib4dARB (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvARB (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fARB (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvARB (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4ivARB (GLuint, const GLint *); -GLAPI void APIENTRY glVertexAttrib4sARB (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svARB (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubvARB (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttrib4uivARB (GLuint, const GLuint *); -GLAPI void APIENTRY glVertexAttrib4usvARB (GLuint, const GLushort *); -GLAPI void APIENTRY glVertexAttribPointerARB (GLuint, GLint, GLenum, GLboolean, GLsizei, const GLvoid *); -GLAPI void APIENTRY glEnableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glDisableVertexAttribArrayARB (GLuint); -GLAPI void APIENTRY glProgramStringARB (GLenum, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBindProgramARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenProgramsARB (GLsizei, GLuint *); -GLAPI void APIENTRY glProgramEnvParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramEnvParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramEnvParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramEnvParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramLocalParameter4dARB (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramLocalParameter4dvARB (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramLocalParameter4fARB (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramLocalParameter4fvARB (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGetProgramEnvParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramEnvParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramLocalParameterdvARB (GLenum, GLuint, GLdouble *); -GLAPI void APIENTRY glGetProgramLocalParameterfvARB (GLenum, GLuint, GLfloat *); -GLAPI void APIENTRY glGetProgramivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringARB (GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetVertexAttribdvARB (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvARB (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervARB (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramARB (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DARBPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FARBPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SARBPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DARBPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FARBPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SARBPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NBVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NIVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NSVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBARBPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4NUSVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4BVARBPROC) (GLuint index, const GLbyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DARBPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVARBPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FARBPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVARBPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4IVARBPROC) (GLuint index, const GLint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SARBPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVARBPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVARBPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UIVARBPROC) (GLuint index, const GLuint *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4USVARBPROC) (GLuint index, const GLushort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERARBPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLENABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLDISABLEVERTEXATTRIBARRAYARBPROC) (GLuint index); -typedef void (APIENTRYP PFNGLPROGRAMSTRINGARBPROC) (GLenum target, GLenum format, GLsizei len, const GLvoid *string); -typedef void (APIENTRYP PFNGLBINDPROGRAMARBPROC) (GLenum target, GLuint program); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSARBPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLGENPROGRAMSARBPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMENVPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DARBPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4DVARBPROC) (GLenum target, GLuint index, const GLdouble *params); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FARBPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMLOCALPARAMETER4FVARBPROC) (GLenum target, GLuint index, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMENVPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERDVARBPROC) (GLenum target, GLuint index, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMLOCALPARAMETERFVARBPROC) (GLenum target, GLuint index, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGARBPROC) (GLenum target, GLenum pname, GLvoid *string); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVARBPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVARBPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVARBPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVARBPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMARBPROC) (GLuint program); -#endif - -#ifndef GL_ARB_fragment_program -#define GL_ARB_fragment_program 1 -/* All ARB_fragment_program entry points are shared with ARB_vertex_program. */ -#endif - -#ifndef GL_ARB_vertex_buffer_object -#define GL_ARB_vertex_buffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindBufferARB (GLenum, GLuint); -GLAPI void APIENTRY glDeleteBuffersARB (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenBuffersARB (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsBufferARB (GLuint); -GLAPI void APIENTRY glBufferDataARB (GLenum, GLsizeiptrARB, const GLvoid *, GLenum); -GLAPI void APIENTRY glBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, const GLvoid *); -GLAPI void APIENTRY glGetBufferSubDataARB (GLenum, GLintptrARB, GLsizeiptrARB, GLvoid *); -GLAPI GLvoid* APIENTRY glMapBufferARB (GLenum, GLenum); -GLAPI GLboolean APIENTRY glUnmapBufferARB (GLenum); -GLAPI void APIENTRY glGetBufferParameterivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetBufferPointervARB (GLenum, GLenum, GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDBUFFERARBPROC) (GLenum target, GLuint buffer); -typedef void (APIENTRYP PFNGLDELETEBUFFERSARBPROC) (GLsizei n, const GLuint *buffers); -typedef void (APIENTRYP PFNGLGENBUFFERSARBPROC) (GLsizei n, GLuint *buffers); -typedef GLboolean (APIENTRYP PFNGLISBUFFERARBPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLBUFFERDATAARBPROC) (GLenum target, GLsizeiptrARB size, const GLvoid *data, GLenum usage); -typedef void (APIENTRYP PFNGLBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, const GLvoid *data); -typedef void (APIENTRYP PFNGLGETBUFFERSUBDATAARBPROC) (GLenum target, GLintptrARB offset, GLsizeiptrARB size, GLvoid *data); -typedef GLvoid* (APIENTRYP PFNGLMAPBUFFERARBPROC) (GLenum target, GLenum access); -typedef GLboolean (APIENTRYP PFNGLUNMAPBUFFERARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETBUFFERPARAMETERIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETBUFFERPOINTERVARBPROC) (GLenum target, GLenum pname, GLvoid* *params); -#endif - -#ifndef GL_ARB_occlusion_query -#define GL_ARB_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenQueriesARB (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteQueriesARB (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsQueryARB (GLuint); -GLAPI void APIENTRY glBeginQueryARB (GLenum, GLuint); -GLAPI void APIENTRY glEndQueryARB (GLenum); -GLAPI void APIENTRY glGetQueryivARB (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectivARB (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetQueryObjectuivARB (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENQUERIESARBPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEQUERIESARBPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISQUERYARBPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINQUERYARBPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLENDQUERYARBPROC) (GLenum target); -typedef void (APIENTRYP PFNGLGETQUERYIVARBPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTIVARBPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETQUERYOBJECTUIVARBPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_ARB_shader_objects -#define GL_ARB_shader_objects 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteObjectARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glGetHandleARB (GLenum); -GLAPI void APIENTRY glDetachObjectARB (GLhandleARB, GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateShaderObjectARB (GLenum); -GLAPI void APIENTRY glShaderSourceARB (GLhandleARB, GLsizei, const GLcharARB* *, const GLint *); -GLAPI void APIENTRY glCompileShaderARB (GLhandleARB); -GLAPI GLhandleARB APIENTRY glCreateProgramObjectARB (void); -GLAPI void APIENTRY glAttachObjectARB (GLhandleARB, GLhandleARB); -GLAPI void APIENTRY glLinkProgramARB (GLhandleARB); -GLAPI void APIENTRY glUseProgramObjectARB (GLhandleARB); -GLAPI void APIENTRY glValidateProgramARB (GLhandleARB); -GLAPI void APIENTRY glUniform1fARB (GLint, GLfloat); -GLAPI void APIENTRY glUniform2fARB (GLint, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform3fARB (GLint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform4fARB (GLint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glUniform1iARB (GLint, GLint); -GLAPI void APIENTRY glUniform2iARB (GLint, GLint, GLint); -GLAPI void APIENTRY glUniform3iARB (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform4iARB (GLint, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glUniform1fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform2fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform3fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform4fvARB (GLint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glUniform1ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform2ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform3ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniform4ivARB (GLint, GLsizei, const GLint *); -GLAPI void APIENTRY glUniformMatrix2fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix3fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glUniformMatrix4fvARB (GLint, GLsizei, GLboolean, const GLfloat *); -GLAPI void APIENTRY glGetObjectParameterfvARB (GLhandleARB, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectParameterivARB (GLhandleARB, GLenum, GLint *); -GLAPI void APIENTRY glGetInfoLogARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -GLAPI void APIENTRY glGetAttachedObjectsARB (GLhandleARB, GLsizei, GLsizei *, GLhandleARB *); -GLAPI GLint APIENTRY glGetUniformLocationARB (GLhandleARB, const GLcharARB *); -GLAPI void APIENTRY glGetActiveUniformARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI void APIENTRY glGetUniformfvARB (GLhandleARB, GLint, GLfloat *); -GLAPI void APIENTRY glGetUniformivARB (GLhandleARB, GLint, GLint *); -GLAPI void APIENTRY glGetShaderSourceARB (GLhandleARB, GLsizei, GLsizei *, GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEOBJECTARBPROC) (GLhandleARB obj); -typedef GLhandleARB (APIENTRYP PFNGLGETHANDLEARBPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLDETACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB attachedObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATESHADEROBJECTARBPROC) (GLenum shaderType); -typedef void (APIENTRYP PFNGLSHADERSOURCEARBPROC) (GLhandleARB shaderObj, GLsizei count, const GLcharARB* *string, const GLint *length); -typedef void (APIENTRYP PFNGLCOMPILESHADERARBPROC) (GLhandleARB shaderObj); -typedef GLhandleARB (APIENTRYP PFNGLCREATEPROGRAMOBJECTARBPROC) (void); -typedef void (APIENTRYP PFNGLATTACHOBJECTARBPROC) (GLhandleARB containerObj, GLhandleARB obj); -typedef void (APIENTRYP PFNGLLINKPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUSEPROGRAMOBJECTARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLVALIDATEPROGRAMARBPROC) (GLhandleARB programObj); -typedef void (APIENTRYP PFNGLUNIFORM1FARBPROC) (GLint location, GLfloat v0); -typedef void (APIENTRYP PFNGLUNIFORM2FARBPROC) (GLint location, GLfloat v0, GLfloat v1); -typedef void (APIENTRYP PFNGLUNIFORM3FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2); -typedef void (APIENTRYP PFNGLUNIFORM4FARBPROC) (GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3); -typedef void (APIENTRYP PFNGLUNIFORM1IARBPROC) (GLint location, GLint v0); -typedef void (APIENTRYP PFNGLUNIFORM2IARBPROC) (GLint location, GLint v0, GLint v1); -typedef void (APIENTRYP PFNGLUNIFORM3IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2); -typedef void (APIENTRYP PFNGLUNIFORM4IARBPROC) (GLint location, GLint v0, GLint v1, GLint v2, GLint v3); -typedef void (APIENTRYP PFNGLUNIFORM1FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM2FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM3FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM4FVARBPROC) (GLint location, GLsizei count, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORM1IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM2IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM3IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORM4IVARBPROC) (GLint location, GLsizei count, const GLint *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX2FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX3FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLUNIFORMMATRIX4FVARBPROC) (GLint location, GLsizei count, GLboolean transpose, const GLfloat *value); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERFVARBPROC) (GLhandleARB obj, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTPARAMETERIVARBPROC) (GLhandleARB obj, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETINFOLOGARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *infoLog); -typedef void (APIENTRYP PFNGLGETATTACHEDOBJECTSARBPROC) (GLhandleARB containerObj, GLsizei maxCount, GLsizei *count, GLhandleARB *obj); -typedef GLint (APIENTRYP PFNGLGETUNIFORMLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEUNIFORMARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef void (APIENTRYP PFNGLGETUNIFORMFVARBPROC) (GLhandleARB programObj, GLint location, GLfloat *params); -typedef void (APIENTRYP PFNGLGETUNIFORMIVARBPROC) (GLhandleARB programObj, GLint location, GLint *params); -typedef void (APIENTRYP PFNGLGETSHADERSOURCEARBPROC) (GLhandleARB obj, GLsizei maxLength, GLsizei *length, GLcharARB *source); -#endif - -#ifndef GL_ARB_vertex_shader -#define GL_ARB_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindAttribLocationARB (GLhandleARB, GLuint, const GLcharARB *); -GLAPI void APIENTRY glGetActiveAttribARB (GLhandleARB, GLuint, GLsizei, GLsizei *, GLint *, GLenum *, GLcharARB *); -GLAPI GLint APIENTRY glGetAttribLocationARB (GLhandleARB, const GLcharARB *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDATTRIBLOCATIONARBPROC) (GLhandleARB programObj, GLuint index, const GLcharARB *name); -typedef void (APIENTRYP PFNGLGETACTIVEATTRIBARBPROC) (GLhandleARB programObj, GLuint index, GLsizei maxLength, GLsizei *length, GLint *size, GLenum *type, GLcharARB *name); -typedef GLint (APIENTRYP PFNGLGETATTRIBLOCATIONARBPROC) (GLhandleARB programObj, const GLcharARB *name); -#endif - -#ifndef GL_ARB_fragment_shader -#define GL_ARB_fragment_shader 1 -#endif - -#ifndef GL_ARB_shading_language_100 -#define GL_ARB_shading_language_100 1 -#endif - -#ifndef GL_ARB_texture_non_power_of_two -#define GL_ARB_texture_non_power_of_two 1 -#endif - -#ifndef GL_ARB_point_sprite -#define GL_ARB_point_sprite 1 -#endif - -#ifndef GL_ARB_fragment_program_shadow -#define GL_ARB_fragment_program_shadow 1 -#endif - -#ifndef GL_ARB_draw_buffers -#define GL_ARB_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersARB (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSARBPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ARB_texture_rectangle -#define GL_ARB_texture_rectangle 1 -#endif - -#ifndef GL_ARB_color_buffer_float -#define GL_ARB_color_buffer_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glClampColorARB (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCLAMPCOLORARBPROC) (GLenum target, GLenum clamp); -#endif - -#ifndef GL_ARB_half_float_pixel -#define GL_ARB_half_float_pixel 1 -#endif - -#ifndef GL_ARB_texture_float -#define GL_ARB_texture_float 1 -#endif - -#ifndef GL_ARB_pixel_buffer_object -#define GL_ARB_pixel_buffer_object 1 -#endif - -#ifndef GL_EXT_abgr -#define GL_EXT_abgr 1 -#endif - -#ifndef GL_EXT_blend_color -#define GL_EXT_blend_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendColorEXT (GLclampf, GLclampf, GLclampf, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDCOLOREXTPROC) (GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha); -#endif - -#ifndef GL_EXT_polygon_offset -#define GL_EXT_polygon_offset 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPolygonOffsetEXT (GLfloat, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOLYGONOFFSETEXTPROC) (GLfloat factor, GLfloat bias); -#endif - -#ifndef GL_EXT_texture -#define GL_EXT_texture 1 -#endif - -#ifndef GL_EXT_texture3D -#define GL_EXT_texture3D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage3DEXT (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE3DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGIS_texture_filter4 -#define GL_SGIS_texture_filter4 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetTexFilterFuncSGIS (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glTexFilterFuncSGIS (GLenum, GLenum, GLsizei, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLfloat *weights); -typedef void (APIENTRYP PFNGLTEXFILTERFUNCSGISPROC) (GLenum target, GLenum filter, GLsizei n, const GLfloat *weights); -#endif - -#ifndef GL_EXT_subtexture -#define GL_EXT_subtexture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexSubImage1DEXT (GLenum, GLint, GLint, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLsizei width, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_EXT_copy_texture -#define GL_EXT_copy_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCopyTexImage1DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexImage2DEXT (GLenum, GLint, GLenum, GLint, GLint, GLsizei, GLsizei, GLint); -GLAPI void APIENTRY glCopyTexSubImage1DEXT (GLenum, GLint, GLint, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage2DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glCopyTexSubImage3DEXT (GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE1DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXIMAGE2DEXTPROC) (GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE1DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE2DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLCOPYTEXSUBIMAGE3DEXTPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height); -#endif - -#ifndef GL_EXT_histogram -#define GL_EXT_histogram 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetHistogramEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetHistogramParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetHistogramParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMinmaxEXT (GLenum, GLboolean, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetMinmaxParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMinmaxParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glHistogramEXT (GLenum, GLsizei, GLenum, GLboolean); -GLAPI void APIENTRY glMinmaxEXT (GLenum, GLenum, GLboolean); -GLAPI void APIENTRY glResetHistogramEXT (GLenum); -GLAPI void APIENTRY glResetMinmaxEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETHISTOGRAMEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETHISTOGRAMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMINMAXEXTPROC) (GLenum target, GLboolean reset, GLenum format, GLenum type, GLvoid *values); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMINMAXPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLHISTOGRAMEXTPROC) (GLenum target, GLsizei width, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLMINMAXEXTPROC) (GLenum target, GLenum internalformat, GLboolean sink); -typedef void (APIENTRYP PFNGLRESETHISTOGRAMEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLRESETMINMAXEXTPROC) (GLenum target); -#endif - -#ifndef GL_EXT_convolution -#define GL_EXT_convolution 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glConvolutionFilter1DEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glConvolutionParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glConvolutionParameterfvEXT (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glConvolutionParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glConvolutionParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyConvolutionFilter1DEXT (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glCopyConvolutionFilter2DEXT (GLenum, GLenum, GLint, GLint, GLsizei, GLsizei); -GLAPI void APIENTRY glGetConvolutionFilterEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetConvolutionParameterfvEXT (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetConvolutionParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetSeparableFilterEXT (GLenum, GLenum, GLenum, GLvoid *, GLvoid *, GLvoid *); -GLAPI void APIENTRY glSeparableFilter2DEXT (GLenum, GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *image); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint params); -typedef void (APIENTRYP PFNGLCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER1DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLCOPYCONVOLUTIONFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *image); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCONVOLUTIONPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETSEPARABLEFILTEREXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *row, GLvoid *column, GLvoid *span); -typedef void (APIENTRYP PFNGLSEPARABLEFILTER2DEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *row, const GLvoid *column); -#endif - -#ifndef GL_EXT_color_matrix -#define GL_EXT_color_matrix 1 -#endif - -#ifndef GL_SGI_color_table -#define GL_SGI_color_table 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableSGI (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glColorTableParameterfvSGI (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glColorTableParameterivSGI (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glCopyColorTableSGI (GLenum, GLenum, GLint, GLint, GLsizei); -GLAPI void APIENTRY glGetColorTableSGI (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterfvSGI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetColorTableParameterivSGI (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOPYCOLORTABLESGIPROC) (GLenum target, GLenum internalformat, GLint x, GLint y, GLsizei width); -typedef void (APIENTRYP PFNGLGETCOLORTABLESGIPROC) (GLenum target, GLenum format, GLenum type, GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVSGIPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVSGIPROC) (GLenum target, GLenum pname, GLint *params); -#endif - -#ifndef GL_SGIX_pixel_texture -#define GL_SGIX_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenSGIX (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENSGIXPROC) (GLenum mode); -#endif - -#ifndef GL_SGIS_pixel_texture -#define GL_SGIS_pixel_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTexGenParameteriSGIS (GLenum, GLint); -GLAPI void APIENTRY glPixelTexGenParameterivSGIS (GLenum, const GLint *); -GLAPI void APIENTRY glPixelTexGenParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPixelTexGenParameterfvSGIS (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetPixelTexGenParameterivSGIS (GLenum, GLint *); -GLAPI void APIENTRY glGetPixelTexGenParameterfvSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERISGISPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERIVSGISPROC) (GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPIXELTEXGENPARAMETERFVSGISPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIS_texture4D -#define GL_SGIS_texture4D 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexImage4DSGIS (GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glTexSubImage4DSGIS (GLenum, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXIMAGE4DSGISPROC) (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLint border, GLenum format, GLenum type, const GLvoid *pixels); -typedef void (APIENTRYP PFNGLTEXSUBIMAGE4DSGISPROC) (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint woffset, GLsizei width, GLsizei height, GLsizei depth, GLsizei size4d, GLenum format, GLenum type, const GLvoid *pixels); -#endif - -#ifndef GL_SGI_texture_color_table -#define GL_SGI_texture_color_table 1 -#endif - -#ifndef GL_EXT_cmyka -#define GL_EXT_cmyka 1 -#endif - -#ifndef GL_EXT_texture_object -#define GL_EXT_texture_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreTexturesResidentEXT (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindTextureEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteTexturesEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenTexturesEXT (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsTextureEXT (GLuint); -GLAPI void APIENTRY glPrioritizeTexturesEXT (GLsizei, const GLuint *, const GLclampf *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLARETEXTURESRESIDENTEXTPROC) (GLsizei n, const GLuint *textures, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDTEXTUREEXTPROC) (GLenum target, GLuint texture); -typedef void (APIENTRYP PFNGLDELETETEXTURESEXTPROC) (GLsizei n, const GLuint *textures); -typedef void (APIENTRYP PFNGLGENTEXTURESEXTPROC) (GLsizei n, GLuint *textures); -typedef GLboolean (APIENTRYP PFNGLISTEXTUREEXTPROC) (GLuint texture); -typedef void (APIENTRYP PFNGLPRIORITIZETEXTURESEXTPROC) (GLsizei n, const GLuint *textures, const GLclampf *priorities); -#endif - -#ifndef GL_SGIS_detail_texture -#define GL_SGIS_detail_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDetailTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetDetailTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDETAILTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETDETAILTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_SGIS_sharpen_texture -#define GL_SGIS_sharpen_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSharpenTexFuncSGIS (GLenum, GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetSharpenTexFuncSGIS (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSHARPENTEXFUNCSGISPROC) (GLenum target, GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETSHARPENTEXFUNCSGISPROC) (GLenum target, GLfloat *points); -#endif - -#ifndef GL_EXT_packed_pixels -#define GL_EXT_packed_pixels 1 -#endif - -#ifndef GL_SGIS_texture_lod -#define GL_SGIS_texture_lod 1 -#endif - -#ifndef GL_SGIS_multisample -#define GL_SGIS_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskSGIS (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternSGIS (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKSGISPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNSGISPROC) (GLenum pattern); -#endif - -#ifndef GL_EXT_rescale_normal -#define GL_EXT_rescale_normal 1 -#endif - -#ifndef GL_EXT_vertex_array -#define GL_EXT_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glArrayElementEXT (GLint); -GLAPI void APIENTRY glColorPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glDrawArraysEXT (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glEdgeFlagPointerEXT (GLsizei, GLsizei, const GLboolean *); -GLAPI void APIENTRY glGetPointervEXT (GLenum, GLvoid* *); -GLAPI void APIENTRY glIndexPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glNormalPointerEXT (GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glTexCoordPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexPointerEXT (GLint, GLenum, GLsizei, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLARRAYELEMENTEXTPROC) (GLint i); -typedef void (APIENTRYP PFNGLCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWARRAYSEXTPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTEREXTPROC) (GLsizei stride, GLsizei count, const GLboolean *pointer); -typedef void (APIENTRYP PFNGLGETPOINTERVEXTPROC) (GLenum pname, GLvoid* *params); -typedef void (APIENTRYP PFNGLINDEXPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, GLsizei count, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_misc_attribute -#define GL_EXT_misc_attribute 1 -#endif - -#ifndef GL_SGIS_generate_mipmap -#define GL_SGIS_generate_mipmap 1 -#endif - -#ifndef GL_SGIX_clipmap -#define GL_SGIX_clipmap 1 -#endif - -#ifndef GL_SGIX_shadow -#define GL_SGIX_shadow 1 -#endif - -#ifndef GL_SGIS_texture_edge_clamp -#define GL_SGIS_texture_edge_clamp 1 -#endif - -#ifndef GL_SGIS_texture_border_clamp -#define GL_SGIS_texture_border_clamp 1 -#endif - -#ifndef GL_EXT_blend_minmax -#define GL_EXT_blend_minmax 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_blend_subtract -#define GL_EXT_blend_subtract 1 -#endif - -#ifndef GL_EXT_blend_logic_op -#define GL_EXT_blend_logic_op 1 -#endif - -#ifndef GL_SGIX_interlace -#define GL_SGIX_interlace 1 -#endif - -#ifndef GL_SGIX_pixel_tiles -#define GL_SGIX_pixel_tiles 1 -#endif - -#ifndef GL_SGIX_texture_select -#define GL_SGIX_texture_select 1 -#endif - -#ifndef GL_SGIX_sprite -#define GL_SGIX_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSpriteParameterfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glSpriteParameterfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glSpriteParameteriSGIX (GLenum, GLint); -GLAPI void APIENTRY glSpriteParameterivSGIX (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLSPRITEPARAMETERIVSGIXPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_texture_multi_buffer -#define GL_SGIX_texture_multi_buffer 1 -#endif - -#ifndef GL_EXT_point_parameters -#define GL_EXT_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfEXT (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvEXT (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFEXTPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVEXTPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIS_point_parameters -#define GL_SGIS_point_parameters 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameterfSGIS (GLenum, GLfloat); -GLAPI void APIENTRY glPointParameterfvSGIS (GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERFSGISPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERFVSGISPROC) (GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_SGIX_instruments -#define GL_SGIX_instruments 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLint APIENTRY glGetInstrumentsSGIX (void); -GLAPI void APIENTRY glInstrumentsBufferSGIX (GLsizei, GLint *); -GLAPI GLint APIENTRY glPollInstrumentsSGIX (GLint *); -GLAPI void APIENTRY glReadInstrumentsSGIX (GLint); -GLAPI void APIENTRY glStartInstrumentsSGIX (void); -GLAPI void APIENTRY glStopInstrumentsSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLint (APIENTRYP PFNGLGETINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLINSTRUMENTSBUFFERSGIXPROC) (GLsizei size, GLint *buffer); -typedef GLint (APIENTRYP PFNGLPOLLINSTRUMENTSSGIXPROC) (GLint *marker_p); -typedef void (APIENTRYP PFNGLREADINSTRUMENTSSGIXPROC) (GLint marker); -typedef void (APIENTRYP PFNGLSTARTINSTRUMENTSSGIXPROC) (void); -typedef void (APIENTRYP PFNGLSTOPINSTRUMENTSSGIXPROC) (GLint marker); -#endif - -#ifndef GL_SGIX_texture_scale_bias -#define GL_SGIX_texture_scale_bias 1 -#endif - -#ifndef GL_SGIX_framezoom -#define GL_SGIX_framezoom 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFrameZoomSGIX (GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAMEZOOMSGIXPROC) (GLint factor); -#endif - -#ifndef GL_SGIX_tag_sample_buffer -#define GL_SGIX_tag_sample_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTagSampleBufferSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTAGSAMPLEBUFFERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_polynomial_ffd -#define GL_SGIX_polynomial_ffd 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeformationMap3dSGIX (GLenum, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, GLdouble, GLdouble, GLint, GLint, const GLdouble *); -GLAPI void APIENTRY glDeformationMap3fSGIX (GLenum, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, GLfloat, GLfloat, GLint, GLint, const GLfloat *); -GLAPI void APIENTRY glDeformSGIX (GLbitfield); -GLAPI void APIENTRY glLoadIdentityDeformationMapSGIX (GLbitfield); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3DSGIXPROC) (GLenum target, GLdouble u1, GLdouble u2, GLint ustride, GLint uorder, GLdouble v1, GLdouble v2, GLint vstride, GLint vorder, GLdouble w1, GLdouble w2, GLint wstride, GLint worder, const GLdouble *points); -typedef void (APIENTRYP PFNGLDEFORMATIONMAP3FSGIXPROC) (GLenum target, GLfloat u1, GLfloat u2, GLint ustride, GLint uorder, GLfloat v1, GLfloat v2, GLint vstride, GLint vorder, GLfloat w1, GLfloat w2, GLint wstride, GLint worder, const GLfloat *points); -typedef void (APIENTRYP PFNGLDEFORMSGIXPROC) (GLbitfield mask); -typedef void (APIENTRYP PFNGLLOADIDENTITYDEFORMATIONMAPSGIXPROC) (GLbitfield mask); -#endif - -#ifndef GL_SGIX_reference_plane -#define GL_SGIX_reference_plane 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReferencePlaneSGIX (const GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREFERENCEPLANESGIXPROC) (const GLdouble *equation); -#endif - -#ifndef GL_SGIX_flush_raster -#define GL_SGIX_flush_raster 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushRasterSGIX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHRASTERSGIXPROC) (void); -#endif - -#ifndef GL_SGIX_depth_texture -#define GL_SGIX_depth_texture 1 -#endif - -#ifndef GL_SGIS_fog_function -#define GL_SGIS_fog_function 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogFuncSGIS (GLsizei, const GLfloat *); -GLAPI void APIENTRY glGetFogFuncSGIS (GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGFUNCSGISPROC) (GLsizei n, const GLfloat *points); -typedef void (APIENTRYP PFNGLGETFOGFUNCSGISPROC) (GLfloat *points); -#endif - -#ifndef GL_SGIX_fog_offset -#define GL_SGIX_fog_offset 1 -#endif - -#ifndef GL_HP_image_transform -#define GL_HP_image_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glImageTransformParameteriHP (GLenum, GLenum, GLint); -GLAPI void APIENTRY glImageTransformParameterfHP (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glImageTransformParameterivHP (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glImageTransformParameterfvHP (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetImageTransformParameterivHP (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetImageTransformParameterfvHP (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIHPPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFHPPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERIVHPPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETIMAGETRANSFORMPARAMETERFVHPPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_HP_convolution_border_modes -#define GL_HP_convolution_border_modes 1 -#endif - -#ifndef GL_SGIX_texture_add_env -#define GL_SGIX_texture_add_env 1 -#endif - -#ifndef GL_EXT_color_subtable -#define GL_EXT_color_subtable 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorSubTableEXT (GLenum, GLsizei, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glCopyColorSubTableEXT (GLenum, GLsizei, GLint, GLint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLsizei count, GLenum format, GLenum type, const GLvoid *data); -typedef void (APIENTRYP PFNGLCOPYCOLORSUBTABLEEXTPROC) (GLenum target, GLsizei start, GLint x, GLint y, GLsizei width); -#endif - -#ifndef GL_PGI_vertex_hints -#define GL_PGI_vertex_hints 1 -#endif - -#ifndef GL_PGI_misc_hints -#define GL_PGI_misc_hints 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glHintPGI (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLHINTPGIPROC) (GLenum target, GLint mode); -#endif - -#ifndef GL_EXT_paletted_texture -#define GL_EXT_paletted_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorTableEXT (GLenum, GLenum, GLsizei, GLenum, GLenum, const GLvoid *); -GLAPI void APIENTRY glGetColorTableEXT (GLenum, GLenum, GLenum, GLvoid *); -GLAPI void APIENTRY glGetColorTableParameterivEXT (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetColorTableParameterfvEXT (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORTABLEEXTPROC) (GLenum target, GLenum internalFormat, GLsizei width, GLenum format, GLenum type, const GLvoid *table); -typedef void (APIENTRYP PFNGLGETCOLORTABLEEXTPROC) (GLenum target, GLenum format, GLenum type, GLvoid *data); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOLORTABLEPARAMETERFVEXTPROC) (GLenum target, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_EXT_clip_volume_hint -#define GL_EXT_clip_volume_hint 1 -#endif - -#ifndef GL_SGIX_list_priority -#define GL_SGIX_list_priority 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGetListParameterfvSGIX (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetListParameterivSGIX (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glListParameterfSGIX (GLuint, GLenum, GLfloat); -GLAPI void APIENTRY glListParameterfvSGIX (GLuint, GLenum, const GLfloat *); -GLAPI void APIENTRY glListParameteriSGIX (GLuint, GLenum, GLint); -GLAPI void APIENTRY glListParameterivSGIX (GLuint, GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGETLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERFSGIXPROC) (GLuint list, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLLISTPARAMETERFVSGIXPROC) (GLuint list, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLLISTPARAMETERISGIXPROC) (GLuint list, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLLISTPARAMETERIVSGIXPROC) (GLuint list, GLenum pname, const GLint *params); -#endif - -#ifndef GL_SGIX_ir_instrument1 -#define GL_SGIX_ir_instrument1 1 -#endif - -#ifndef GL_SGIX_calligraphic_fragment -#define GL_SGIX_calligraphic_fragment 1 -#endif - -#ifndef GL_SGIX_texture_lod_bias -#define GL_SGIX_texture_lod_bias 1 -#endif - -#ifndef GL_SGIX_shadow_ambient -#define GL_SGIX_shadow_ambient 1 -#endif - -#ifndef GL_EXT_index_texture -#define GL_EXT_index_texture 1 -#endif - -#ifndef GL_EXT_index_material -#define GL_EXT_index_material 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_EXT_index_func -#define GL_EXT_index_func 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIndexFuncEXT (GLenum, GLclampf); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLINDEXFUNCEXTPROC) (GLenum func, GLclampf ref); -#endif - -#ifndef GL_EXT_index_array_formats -#define GL_EXT_index_array_formats 1 -#endif - -#ifndef GL_EXT_compiled_vertex_array -#define GL_EXT_compiled_vertex_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glLockArraysEXT (GLint, GLsizei); -GLAPI void APIENTRY glUnlockArraysEXT (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLLOCKARRAYSEXTPROC) (GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLUNLOCKARRAYSEXTPROC) (void); -#endif - -#ifndef GL_EXT_cull_vertex -#define GL_EXT_cull_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCullParameterdvEXT (GLenum, GLdouble *); -GLAPI void APIENTRY glCullParameterfvEXT (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCULLPARAMETERDVEXTPROC) (GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLCULLPARAMETERFVEXTPROC) (GLenum pname, GLfloat *params); -#endif - -#ifndef GL_SGIX_ycrcb -#define GL_SGIX_ycrcb 1 -#endif - -#ifndef GL_SGIX_fragment_lighting -#define GL_SGIX_fragment_lighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFragmentColorMaterialSGIX (GLenum, GLenum); -GLAPI void APIENTRY glFragmentLightfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentLightivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glFragmentLightModelfSGIX (GLenum, GLfloat); -GLAPI void APIENTRY glFragmentLightModelfvSGIX (GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentLightModeliSGIX (GLenum, GLint); -GLAPI void APIENTRY glFragmentLightModelivSGIX (GLenum, const GLint *); -GLAPI void APIENTRY glFragmentMaterialfSGIX (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glFragmentMaterialfvSGIX (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glFragmentMaterialiSGIX (GLenum, GLenum, GLint); -GLAPI void APIENTRY glFragmentMaterialivSGIX (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glGetFragmentLightfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentLightivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFragmentMaterialfvSGIX (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFragmentMaterialivSGIX (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glLightEnviSGIX (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFRAGMENTCOLORMATERIALSGIXPROC) (GLenum face, GLenum mode); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFSGIXPROC) (GLenum light, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTISGIXPROC) (GLenum light, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFSGIXPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELFVSGIXPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELISGIXPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTLIGHTMODELIVSGIXPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFSGIXPROC) (GLenum face, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALISGIXPROC) (GLenum face, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTFVSGIXPROC) (GLenum light, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTLIGHTIVSGIXPROC) (GLenum light, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALFVSGIXPROC) (GLenum face, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFRAGMENTMATERIALIVSGIXPROC) (GLenum face, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLLIGHTENVISGIXPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_IBM_rasterpos_clip -#define GL_IBM_rasterpos_clip 1 -#endif - -#ifndef GL_HP_texture_lighting -#define GL_HP_texture_lighting 1 -#endif - -#ifndef GL_EXT_draw_range_elements -#define GL_EXT_draw_range_elements 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawRangeElementsEXT (GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTSEXTPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices); -#endif - -#ifndef GL_WIN_phong_shading -#define GL_WIN_phong_shading 1 -#endif - -#ifndef GL_WIN_specular_fog -#define GL_WIN_specular_fog 1 -#endif - -#ifndef GL_EXT_light_texture -#define GL_EXT_light_texture 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glApplyTextureEXT (GLenum); -GLAPI void APIENTRY glTextureLightEXT (GLenum); -GLAPI void APIENTRY glTextureMaterialEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLAPPLYTEXTUREEXTPROC) (GLenum mode); -typedef void (APIENTRYP PFNGLTEXTURELIGHTEXTPROC) (GLenum pname); -typedef void (APIENTRYP PFNGLTEXTUREMATERIALEXTPROC) (GLenum face, GLenum mode); -#endif - -#ifndef GL_SGIX_blend_alpha_minmax -#define GL_SGIX_blend_alpha_minmax 1 -#endif - -#ifndef GL_EXT_bgra -#define GL_EXT_bgra 1 -#endif - -#ifndef GL_SGIX_async -#define GL_SGIX_async 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glAsyncMarkerSGIX (GLuint); -GLAPI GLint APIENTRY glFinishAsyncSGIX (GLuint *); -GLAPI GLint APIENTRY glPollAsyncSGIX (GLuint *); -GLAPI GLuint APIENTRY glGenAsyncMarkersSGIX (GLsizei); -GLAPI void APIENTRY glDeleteAsyncMarkersSGIX (GLuint, GLsizei); -GLAPI GLboolean APIENTRY glIsAsyncMarkerSGIX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLASYNCMARKERSGIXPROC) (GLuint marker); -typedef GLint (APIENTRYP PFNGLFINISHASYNCSGIXPROC) (GLuint *markerp); -typedef GLint (APIENTRYP PFNGLPOLLASYNCSGIXPROC) (GLuint *markerp); -typedef GLuint (APIENTRYP PFNGLGENASYNCMARKERSSGIXPROC) (GLsizei range); -typedef void (APIENTRYP PFNGLDELETEASYNCMARKERSSGIXPROC) (GLuint marker, GLsizei range); -typedef GLboolean (APIENTRYP PFNGLISASYNCMARKERSGIXPROC) (GLuint marker); -#endif - -#ifndef GL_SGIX_async_pixel -#define GL_SGIX_async_pixel 1 -#endif - -#ifndef GL_SGIX_async_histogram -#define GL_SGIX_async_histogram 1 -#endif - -#ifndef GL_INTEL_parallel_arrays -#define GL_INTEL_parallel_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glNormalPointervINTEL (GLenum, const GLvoid* *); -GLAPI void APIENTRY glColorPointervINTEL (GLint, GLenum, const GLvoid* *); -GLAPI void APIENTRY glTexCoordPointervINTEL (GLint, GLenum, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLNORMALPOINTERVINTELPROC) (GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLCOLORPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERVINTELPROC) (GLint size, GLenum type, const GLvoid* *pointer); -#endif - -#ifndef GL_HP_occlusion_test -#define GL_HP_occlusion_test 1 -#endif - -#ifndef GL_EXT_pixel_transform -#define GL_EXT_pixel_transform 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelTransformParameteriEXT (GLenum, GLenum, GLint); -GLAPI void APIENTRY glPixelTransformParameterfEXT (GLenum, GLenum, GLfloat); -GLAPI void APIENTRY glPixelTransformParameterivEXT (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glPixelTransformParameterfvEXT (GLenum, GLenum, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIEXTPROC) (GLenum target, GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFEXTPROC) (GLenum target, GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERIVEXTPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLPIXELTRANSFORMPARAMETERFVEXTPROC) (GLenum target, GLenum pname, const GLfloat *params); -#endif - -#ifndef GL_EXT_pixel_transform_color_table -#define GL_EXT_pixel_transform_color_table 1 -#endif - -#ifndef GL_EXT_shared_texture_palette -#define GL_EXT_shared_texture_palette 1 -#endif - -#ifndef GL_EXT_separate_specular_color -#define GL_EXT_separate_specular_color 1 -#endif - -#ifndef GL_EXT_secondary_color -#define GL_EXT_secondary_color 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSecondaryColor3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glSecondaryColor3bvEXT (const GLbyte *); -GLAPI void APIENTRY glSecondaryColor3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glSecondaryColor3dvEXT (const GLdouble *); -GLAPI void APIENTRY glSecondaryColor3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glSecondaryColor3fvEXT (const GLfloat *); -GLAPI void APIENTRY glSecondaryColor3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glSecondaryColor3ivEXT (const GLint *); -GLAPI void APIENTRY glSecondaryColor3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glSecondaryColor3svEXT (const GLshort *); -GLAPI void APIENTRY glSecondaryColor3ubEXT (GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glSecondaryColor3ubvEXT (const GLubyte *); -GLAPI void APIENTRY glSecondaryColor3uiEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSecondaryColor3uivEXT (const GLuint *); -GLAPI void APIENTRY glSecondaryColor3usEXT (GLushort, GLushort, GLushort); -GLAPI void APIENTRY glSecondaryColor3usvEXT (const GLushort *); -GLAPI void APIENTRY glSecondaryColorPointerEXT (GLint, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BEXTPROC) (GLbyte red, GLbyte green, GLbyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DEXTPROC) (GLdouble red, GLdouble green, GLdouble blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FEXTPROC) (GLfloat red, GLfloat green, GLfloat blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IEXTPROC) (GLint red, GLint green, GLint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SEXTPROC) (GLshort red, GLshort green, GLshort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBEXTPROC) (GLubyte red, GLubyte green, GLubyte blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UBVEXTPROC) (const GLubyte *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIEXTPROC) (GLuint red, GLuint green, GLuint blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3UIVEXTPROC) (const GLuint *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USEXTPROC) (GLushort red, GLushort green, GLushort blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3USVEXTPROC) (const GLushort *v); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTEREXTPROC) (GLint size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_perturb_normal -#define GL_EXT_texture_perturb_normal 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureNormalEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURENORMALEXTPROC) (GLenum mode); -#endif - -#ifndef GL_EXT_multi_draw_arrays -#define GL_EXT_multi_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiDrawArraysEXT (GLenum, GLint *, GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawElementsEXT (GLenum, const GLsizei *, GLenum, const GLvoid* *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSEXTPROC) (GLenum mode, GLint *first, GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSEXTPROC) (GLenum mode, const GLsizei *count, GLenum type, const GLvoid* *indices, GLsizei primcount); -#endif - -#ifndef GL_EXT_fog_coord -#define GL_EXT_fog_coord 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFogCoordfEXT (GLfloat); -GLAPI void APIENTRY glFogCoordfvEXT (const GLfloat *); -GLAPI void APIENTRY glFogCoorddEXT (GLdouble); -GLAPI void APIENTRY glFogCoorddvEXT (const GLdouble *); -GLAPI void APIENTRY glFogCoordPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFOGCOORDFEXTPROC) (GLfloat coord); -typedef void (APIENTRYP PFNGLFOGCOORDFVEXTPROC) (const GLfloat *coord); -typedef void (APIENTRYP PFNGLFOGCOORDDEXTPROC) (GLdouble coord); -typedef void (APIENTRYP PFNGLFOGCOORDDVEXTPROC) (const GLdouble *coord); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_REND_screen_coordinates -#define GL_REND_screen_coordinates 1 -#endif - -#ifndef GL_EXT_coordinate_frame -#define GL_EXT_coordinate_frame 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTangent3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glTangent3bvEXT (const GLbyte *); -GLAPI void APIENTRY glTangent3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glTangent3dvEXT (const GLdouble *); -GLAPI void APIENTRY glTangent3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTangent3fvEXT (const GLfloat *); -GLAPI void APIENTRY glTangent3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glTangent3ivEXT (const GLint *); -GLAPI void APIENTRY glTangent3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glTangent3svEXT (const GLshort *); -GLAPI void APIENTRY glBinormal3bEXT (GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glBinormal3bvEXT (const GLbyte *); -GLAPI void APIENTRY glBinormal3dEXT (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glBinormal3dvEXT (const GLdouble *); -GLAPI void APIENTRY glBinormal3fEXT (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glBinormal3fvEXT (const GLfloat *); -GLAPI void APIENTRY glBinormal3iEXT (GLint, GLint, GLint); -GLAPI void APIENTRY glBinormal3ivEXT (const GLint *); -GLAPI void APIENTRY glBinormal3sEXT (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glBinormal3svEXT (const GLshort *); -GLAPI void APIENTRY glTangentPointerEXT (GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glBinormalPointerEXT (GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTANGENT3BEXTPROC) (GLbyte tx, GLbyte ty, GLbyte tz); -typedef void (APIENTRYP PFNGLTANGENT3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLTANGENT3DEXTPROC) (GLdouble tx, GLdouble ty, GLdouble tz); -typedef void (APIENTRYP PFNGLTANGENT3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLTANGENT3FEXTPROC) (GLfloat tx, GLfloat ty, GLfloat tz); -typedef void (APIENTRYP PFNGLTANGENT3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLTANGENT3IEXTPROC) (GLint tx, GLint ty, GLint tz); -typedef void (APIENTRYP PFNGLTANGENT3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLTANGENT3SEXTPROC) (GLshort tx, GLshort ty, GLshort tz); -typedef void (APIENTRYP PFNGLTANGENT3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLBINORMAL3BEXTPROC) (GLbyte bx, GLbyte by, GLbyte bz); -typedef void (APIENTRYP PFNGLBINORMAL3BVEXTPROC) (const GLbyte *v); -typedef void (APIENTRYP PFNGLBINORMAL3DEXTPROC) (GLdouble bx, GLdouble by, GLdouble bz); -typedef void (APIENTRYP PFNGLBINORMAL3DVEXTPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLBINORMAL3FEXTPROC) (GLfloat bx, GLfloat by, GLfloat bz); -typedef void (APIENTRYP PFNGLBINORMAL3FVEXTPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLBINORMAL3IEXTPROC) (GLint bx, GLint by, GLint bz); -typedef void (APIENTRYP PFNGLBINORMAL3IVEXTPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLBINORMAL3SEXTPROC) (GLshort bx, GLshort by, GLshort bz); -typedef void (APIENTRYP PFNGLBINORMAL3SVEXTPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLTANGENTPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLBINORMALPOINTEREXTPROC) (GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_EXT_texture_env_combine -#define GL_EXT_texture_env_combine 1 -#endif - -#ifndef GL_APPLE_specular_vector -#define GL_APPLE_specular_vector 1 -#endif - -#ifndef GL_APPLE_transform_hint -#define GL_APPLE_transform_hint 1 -#endif - -#ifndef GL_SGIX_fog_scale -#define GL_SGIX_fog_scale 1 -#endif - -#ifndef GL_SUNX_constant_data -#define GL_SUNX_constant_data 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFinishTextureSUNX (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFINISHTEXTURESUNXPROC) (void); -#endif - -#ifndef GL_SUN_global_alpha -#define GL_SUN_global_alpha 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGlobalAlphaFactorbSUN (GLbyte); -GLAPI void APIENTRY glGlobalAlphaFactorsSUN (GLshort); -GLAPI void APIENTRY glGlobalAlphaFactoriSUN (GLint); -GLAPI void APIENTRY glGlobalAlphaFactorfSUN (GLfloat); -GLAPI void APIENTRY glGlobalAlphaFactordSUN (GLdouble); -GLAPI void APIENTRY glGlobalAlphaFactorubSUN (GLubyte); -GLAPI void APIENTRY glGlobalAlphaFactorusSUN (GLushort); -GLAPI void APIENTRY glGlobalAlphaFactoruiSUN (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORBSUNPROC) (GLbyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORSSUNPROC) (GLshort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORISUNPROC) (GLint factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORFSUNPROC) (GLfloat factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORDSUNPROC) (GLdouble factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUBSUNPROC) (GLubyte factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUSSUNPROC) (GLushort factor); -typedef void (APIENTRYP PFNGLGLOBALALPHAFACTORUISUNPROC) (GLuint factor); -#endif - -#ifndef GL_SUN_triangle_list -#define GL_SUN_triangle_list 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glReplacementCodeuiSUN (GLuint); -GLAPI void APIENTRY glReplacementCodeusSUN (GLushort); -GLAPI void APIENTRY glReplacementCodeubSUN (GLubyte); -GLAPI void APIENTRY glReplacementCodeuivSUN (const GLuint *); -GLAPI void APIENTRY glReplacementCodeusvSUN (const GLushort *); -GLAPI void APIENTRY glReplacementCodeubvSUN (const GLubyte *); -GLAPI void APIENTRY glReplacementCodePointerSUN (GLenum, GLsizei, const GLvoid* *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUISUNPROC) (GLuint code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSSUNPROC) (GLushort code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBSUNPROC) (GLubyte code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVSUNPROC) (const GLuint *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUSVSUNPROC) (const GLushort *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUBVSUNPROC) (const GLubyte *code); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEPOINTERSUNPROC) (GLenum type, GLsizei stride, const GLvoid* *pointer); -#endif - -#ifndef GL_SUN_vertex -#define GL_SUN_vertex 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColor4ubVertex2fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex2fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor4ubVertex3fSUN (GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4ubVertex3fvSUN (const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fVertex3fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fVertex4fvSUN (const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fSUN (GLfloat, GLfloat, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4ubVertex3fvSUN (const GLfloat *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord2fColor4fNormal3fVertex3fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fSUN (GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glTexCoord4fColor4fNormal3fVertex4fvSUN (const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiVertex3fvSUN (const GLuint *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fSUN (GLuint, GLubyte, GLubyte, GLubyte, GLubyte, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4ubVertex3fvSUN (const GLuint *, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fSUN (GLuint, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glReplacementCodeuiTexCoord2fColor4fNormal3fVertex3fvSUN (const GLuint *, const GLfloat *, const GLfloat *, const GLfloat *, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX2FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FSUNPROC) (GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4UBVERTEX3FVSUNPROC) (const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FSUNPROC) (GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4UBVERTEX3FVSUNPROC) (const GLfloat *tc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLTEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FSUNPROC) (GLfloat s, GLfloat t, GLfloat p, GLfloat q, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLTEXCOORD4FCOLOR4FNORMAL3FVERTEX4FVSUNPROC) (const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FSUNPROC) (GLuint rc, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUIVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FSUNPROC) (GLuint rc, GLubyte r, GLubyte g, GLubyte b, GLubyte a, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4UBVERTEX3FVSUNPROC) (const GLuint *rc, const GLubyte *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUINORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUICOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *n, const GLfloat *v); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FSUNPROC) (GLuint rc, GLfloat s, GLfloat t, GLfloat r, GLfloat g, GLfloat b, GLfloat a, GLfloat nx, GLfloat ny, GLfloat nz, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLREPLACEMENTCODEUITEXCOORD2FCOLOR4FNORMAL3FVERTEX3FVSUNPROC) (const GLuint *rc, const GLfloat *tc, const GLfloat *c, const GLfloat *n, const GLfloat *v); -#endif - -#ifndef GL_EXT_blend_func_separate -#define GL_EXT_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateEXT (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEEXTPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_blend_func_separate -#define GL_INGR_blend_func_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendFuncSeparateINGR (GLenum, GLenum, GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEINGRPROC) (GLenum sfactorRGB, GLenum dfactorRGB, GLenum sfactorAlpha, GLenum dfactorAlpha); -#endif - -#ifndef GL_INGR_color_clamp -#define GL_INGR_color_clamp 1 -#endif - -#ifndef GL_INGR_interlace_read -#define GL_INGR_interlace_read 1 -#endif - -#ifndef GL_EXT_stencil_wrap -#define GL_EXT_stencil_wrap 1 -#endif - -#ifndef GL_EXT_422_pixels -#define GL_EXT_422_pixels 1 -#endif - -#ifndef GL_NV_texgen_reflection -#define GL_NV_texgen_reflection 1 -#endif - -#ifndef GL_SUN_convolution_border_modes -#define GL_SUN_convolution_border_modes 1 -#endif - -#ifndef GL_EXT_texture_env_add -#define GL_EXT_texture_env_add 1 -#endif - -#ifndef GL_EXT_texture_lod_bias -#define GL_EXT_texture_lod_bias 1 -#endif - -#ifndef GL_EXT_texture_filter_anisotropic -#define GL_EXT_texture_filter_anisotropic 1 -#endif - -#ifndef GL_EXT_vertex_weighting -#define GL_EXT_vertex_weighting 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexWeightfEXT (GLfloat); -GLAPI void APIENTRY glVertexWeightfvEXT (const GLfloat *); -GLAPI void APIENTRY glVertexWeightPointerEXT (GLsizei, GLenum, GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFEXTPROC) (GLfloat weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTFVEXTPROC) (const GLfloat *weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTPOINTEREXTPROC) (GLsizei size, GLenum type, GLsizei stride, const GLvoid *pointer); -#endif - -#ifndef GL_NV_light_max_exponent -#define GL_NV_light_max_exponent 1 -#endif - -#ifndef GL_NV_vertex_array_range -#define GL_NV_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glFlushVertexArrayRangeNV (void); -GLAPI void APIENTRY glVertexArrayRangeNV (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGENVPROC) (void); -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGENVPROC) (GLsizei length, const GLvoid *pointer); -#endif - -#ifndef GL_NV_register_combiners -#define GL_NV_register_combiners 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerParameterfvNV (GLenum, const GLfloat *); -GLAPI void APIENTRY glCombinerParameterfNV (GLenum, GLfloat); -GLAPI void APIENTRY glCombinerParameterivNV (GLenum, const GLint *); -GLAPI void APIENTRY glCombinerParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glCombinerInputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glCombinerOutputNV (GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLenum, GLboolean, GLboolean, GLboolean); -GLAPI void APIENTRY glFinalCombinerInputNV (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glGetCombinerInputParameterfvNV (GLenum, GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerInputParameterivNV (GLenum, GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetCombinerOutputParameterfvNV (GLenum, GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetCombinerOutputParameterivNV (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetFinalCombinerInputParameterivNV (GLenum, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFVNVPROC) (GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERFNVPROC) (GLenum pname, GLfloat param); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLCOMBINERPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLCOMBINERINPUTNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLCOMBINEROUTPUTNVPROC) (GLenum stage, GLenum portion, GLenum abOutput, GLenum cdOutput, GLenum sumOutput, GLenum scale, GLenum bias, GLboolean abDotProduct, GLboolean cdDotProduct, GLboolean muxSum); -typedef void (APIENTRYP PFNGLFINALCOMBINERINPUTNVPROC) (GLenum variable, GLenum input, GLenum mapping, GLenum componentUsage); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERINPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum variable, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERFVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINEROUTPUTPARAMETERIVNVPROC) (GLenum stage, GLenum portion, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERFVNVPROC) (GLenum variable, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETFINALCOMBINERINPUTPARAMETERIVNVPROC) (GLenum variable, GLenum pname, GLint *params); -#endif - -#ifndef GL_NV_fog_distance -#define GL_NV_fog_distance 1 -#endif - -#ifndef GL_NV_texgen_emboss -#define GL_NV_texgen_emboss 1 -#endif - -#ifndef GL_NV_blend_square -#define GL_NV_blend_square 1 -#endif - -#ifndef GL_NV_texture_env_combine4 -#define GL_NV_texture_env_combine4 1 -#endif - -#ifndef GL_MESA_resize_buffers -#define GL_MESA_resize_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glResizeBuffersMESA (void); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLRESIZEBUFFERSMESAPROC) (void); -#endif - -#ifndef GL_MESA_window_pos -#define GL_MESA_window_pos 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glWindowPos2dMESA (GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos2dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos2fMESA (GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos2fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos2iMESA (GLint, GLint); -GLAPI void APIENTRY glWindowPos2ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos2sMESA (GLshort, GLshort); -GLAPI void APIENTRY glWindowPos2svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos3dMESA (GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos3dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos3fMESA (GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos3fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos3iMESA (GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos3ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos3sMESA (GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos3svMESA (const GLshort *); -GLAPI void APIENTRY glWindowPos4dMESA (GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glWindowPos4dvMESA (const GLdouble *); -GLAPI void APIENTRY glWindowPos4fMESA (GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glWindowPos4fvMESA (const GLfloat *); -GLAPI void APIENTRY glWindowPos4iMESA (GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glWindowPos4ivMESA (const GLint *); -GLAPI void APIENTRY glWindowPos4sMESA (GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glWindowPos4svMESA (const GLshort *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLWINDOWPOS2DMESAPROC) (GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLWINDOWPOS2DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2FMESAPROC) (GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLWINDOWPOS2FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2IMESAPROC) (GLint x, GLint y); -typedef void (APIENTRYP PFNGLWINDOWPOS2IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS2SMESAPROC) (GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLWINDOWPOS2SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3DMESAPROC) (GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLWINDOWPOS3DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3FMESAPROC) (GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLWINDOWPOS3FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3IMESAPROC) (GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLWINDOWPOS3IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS3SMESAPROC) (GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLWINDOWPOS3SVMESAPROC) (const GLshort *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4DMESAPROC) (GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLWINDOWPOS4DVMESAPROC) (const GLdouble *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4FMESAPROC) (GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLWINDOWPOS4FVMESAPROC) (const GLfloat *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4IMESAPROC) (GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLWINDOWPOS4IVMESAPROC) (const GLint *v); -typedef void (APIENTRYP PFNGLWINDOWPOS4SMESAPROC) (GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLWINDOWPOS4SVMESAPROC) (const GLshort *v); -#endif - -#ifndef GL_IBM_cull_vertex -#define GL_IBM_cull_vertex 1 -#endif - -#ifndef GL_IBM_multimode_draw_arrays -#define GL_IBM_multimode_draw_arrays 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMultiModeDrawArraysIBM (const GLenum *, const GLint *, const GLsizei *, GLsizei, GLint); -GLAPI void APIENTRY glMultiModeDrawElementsIBM (const GLenum *, const GLsizei *, GLenum, const GLvoid* const *, GLsizei, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMULTIMODEDRAWARRAYSIBMPROC) (const GLenum *mode, const GLint *first, const GLsizei *count, GLsizei primcount, GLint modestride); -typedef void (APIENTRYP PFNGLMULTIMODEDRAWELEMENTSIBMPROC) (const GLenum *mode, const GLsizei *count, GLenum type, const GLvoid* const *indices, GLsizei primcount, GLint modestride); -#endif - -#ifndef GL_IBM_vertex_array_lists -#define GL_IBM_vertex_array_lists 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glSecondaryColorPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glEdgeFlagPointerListIBM (GLint, const GLboolean* *, GLint); -GLAPI void APIENTRY glFogCoordPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glIndexPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glNormalPointerListIBM (GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glTexCoordPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -GLAPI void APIENTRY glVertexPointerListIBM (GLint, GLenum, GLint, const GLvoid* *, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLSECONDARYCOLORPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLEDGEFLAGPOINTERLISTIBMPROC) (GLint stride, const GLboolean* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLFOGCOORDPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLINDEXPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLNORMALPOINTERLISTIBMPROC) (GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLTEXCOORDPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -typedef void (APIENTRYP PFNGLVERTEXPOINTERLISTIBMPROC) (GLint size, GLenum type, GLint stride, const GLvoid* *pointer, GLint ptrstride); -#endif - -#ifndef GL_SGIX_subsample -#define GL_SGIX_subsample 1 -#endif - -#ifndef GL_SGIX_ycrcba -#define GL_SGIX_ycrcba 1 -#endif - -#ifndef GL_SGIX_ycrcb_subsample -#define GL_SGIX_ycrcb_subsample 1 -#endif - -#ifndef GL_SGIX_depth_pass_instrument -#define GL_SGIX_depth_pass_instrument 1 -#endif - -#ifndef GL_3DFX_texture_compression_FXT1 -#define GL_3DFX_texture_compression_FXT1 1 -#endif - -#ifndef GL_3DFX_multisample -#define GL_3DFX_multisample 1 -#endif - -#ifndef GL_3DFX_tbuffer -#define GL_3DFX_tbuffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTbufferMask3DFX (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTBUFFERMASK3DFXPROC) (GLuint mask); -#endif - -#ifndef GL_EXT_multisample -#define GL_EXT_multisample 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glSampleMaskEXT (GLclampf, GLboolean); -GLAPI void APIENTRY glSamplePatternEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSAMPLEMASKEXTPROC) (GLclampf value, GLboolean invert); -typedef void (APIENTRYP PFNGLSAMPLEPATTERNEXTPROC) (GLenum pattern); -#endif - -#ifndef GL_SGIX_vertex_preclip -#define GL_SGIX_vertex_preclip 1 -#endif - -#ifndef GL_SGIX_convolution_accuracy -#define GL_SGIX_convolution_accuracy 1 -#endif - -#ifndef GL_SGIX_resample -#define GL_SGIX_resample 1 -#endif - -#ifndef GL_SGIS_point_line_texgen -#define GL_SGIS_point_line_texgen 1 -#endif - -#ifndef GL_SGIS_texture_color_mask -#define GL_SGIS_texture_color_mask 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTextureColorMaskSGIS (GLboolean, GLboolean, GLboolean, GLboolean); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXTURECOLORMASKSGISPROC) (GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha); -#endif - -#ifndef GL_SGIX_igloo_interface -#define GL_SGIX_igloo_interface 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glIglooInterfaceSGIX (GLenum, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLIGLOOINTERFACESGIXPROC) (GLenum pname, const GLvoid *params); -#endif - -#ifndef GL_EXT_texture_env_dot3 -#define GL_EXT_texture_env_dot3 1 -#endif - -#ifndef GL_ATI_texture_mirror_once -#define GL_ATI_texture_mirror_once 1 -#endif - -#ifndef GL_NV_fence -#define GL_NV_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDeleteFencesNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFencesNV (GLsizei, GLuint *); -GLAPI GLboolean APIENTRY glIsFenceNV (GLuint); -GLAPI GLboolean APIENTRY glTestFenceNV (GLuint); -GLAPI void APIENTRY glGetFenceivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFinishFenceNV (GLuint); -GLAPI void APIENTRY glSetFenceNV (GLuint, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDELETEFENCESNVPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLGENFENCESNVPROC) (GLsizei n, GLuint *fences); -typedef GLboolean (APIENTRYP PFNGLISFENCENVPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLGETFENCEIVNVPROC) (GLuint fence, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFINISHFENCENVPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLSETFENCENVPROC) (GLuint fence, GLenum condition); -#endif - -#ifndef GL_NV_evaluators -#define GL_NV_evaluators 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLint, GLint, GLboolean, const GLvoid *); -GLAPI void APIENTRY glMapParameterivNV (GLenum, GLenum, const GLint *); -GLAPI void APIENTRY glMapParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetMapControlPointsNV (GLenum, GLuint, GLenum, GLsizei, GLsizei, GLboolean, GLvoid *); -GLAPI void APIENTRY glGetMapParameterivNV (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGetMapParameterfvNV (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetMapAttribParameterivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetMapAttribParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glEvalMapsNV (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLint uorder, GLint vorder, GLboolean packed, const GLvoid *points); -typedef void (APIENTRYP PFNGLMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, const GLint *params); -typedef void (APIENTRYP PFNGLMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPCONTROLPOINTSNVPROC) (GLenum target, GLuint index, GLenum type, GLsizei ustride, GLsizei vstride, GLboolean packed, GLvoid *points); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERIVNVPROC) (GLenum target, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPPARAMETERFVNVPROC) (GLenum target, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERIVNVPROC) (GLenum target, GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETMAPATTRIBPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLEVALMAPSNVPROC) (GLenum target, GLenum mode); -#endif - -#ifndef GL_NV_packed_depth_stencil -#define GL_NV_packed_depth_stencil 1 -#endif - -#ifndef GL_NV_register_combiners2 -#define GL_NV_register_combiners2 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glCombinerStageParameterfvNV (GLenum, GLenum, const GLfloat *); -GLAPI void APIENTRY glGetCombinerStageParameterfvNV (GLenum, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, const GLfloat *params); -typedef void (APIENTRYP PFNGLGETCOMBINERSTAGEPARAMETERFVNVPROC) (GLenum stage, GLenum pname, GLfloat *params); -#endif - -#ifndef GL_NV_texture_compression_vtc -#define GL_NV_texture_compression_vtc 1 -#endif - -#ifndef GL_NV_texture_rectangle -#define GL_NV_texture_rectangle 1 -#endif - -#ifndef GL_NV_texture_shader -#define GL_NV_texture_shader 1 -#endif - -#ifndef GL_NV_texture_shader2 -#define GL_NV_texture_shader2 1 -#endif - -#ifndef GL_NV_vertex_array_range2 -#define GL_NV_vertex_array_range2 1 -#endif - -#ifndef GL_NV_vertex_program -#define GL_NV_vertex_program 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glAreProgramsResidentNV (GLsizei, const GLuint *, GLboolean *); -GLAPI void APIENTRY glBindProgramNV (GLenum, GLuint); -GLAPI void APIENTRY glDeleteProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glExecuteProgramNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glGenProgramsNV (GLsizei, GLuint *); -GLAPI void APIENTRY glGetProgramParameterdvNV (GLenum, GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetProgramParameterfvNV (GLenum, GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetProgramivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetProgramStringNV (GLuint, GLenum, GLubyte *); -GLAPI void APIENTRY glGetTrackMatrixivNV (GLenum, GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribdvNV (GLuint, GLenum, GLdouble *); -GLAPI void APIENTRY glGetVertexAttribfvNV (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVertexAttribPointervNV (GLuint, GLenum, GLvoid* *); -GLAPI GLboolean APIENTRY glIsProgramNV (GLuint); -GLAPI void APIENTRY glLoadProgramNV (GLenum, GLuint, GLsizei, const GLubyte *); -GLAPI void APIENTRY glProgramParameter4dNV (GLenum, GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramParameter4dvNV (GLenum, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameter4fNV (GLenum, GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramParameter4fvNV (GLenum, GLuint, const GLfloat *); -GLAPI void APIENTRY glProgramParameters4dvNV (GLenum, GLuint, GLuint, const GLdouble *); -GLAPI void APIENTRY glProgramParameters4fvNV (GLenum, GLuint, GLuint, const GLfloat *); -GLAPI void APIENTRY glRequestResidentProgramsNV (GLsizei, const GLuint *); -GLAPI void APIENTRY glTrackMatrixNV (GLenum, GLuint, GLenum, GLenum); -GLAPI void APIENTRY glVertexAttribPointerNV (GLuint, GLint, GLenum, GLsizei, const GLvoid *); -GLAPI void APIENTRY glVertexAttrib1dNV (GLuint, GLdouble); -GLAPI void APIENTRY glVertexAttrib1dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib1fNV (GLuint, GLfloat); -GLAPI void APIENTRY glVertexAttrib1fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib1sNV (GLuint, GLshort); -GLAPI void APIENTRY glVertexAttrib1svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib2dNV (GLuint, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib2dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib2fNV (GLuint, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib2fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib2sNV (GLuint, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib2svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib3dNV (GLuint, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib3dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib3fNV (GLuint, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib3fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib3sNV (GLuint, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib3svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4dNV (GLuint, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexAttrib4dvNV (GLuint, const GLdouble *); -GLAPI void APIENTRY glVertexAttrib4fNV (GLuint, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexAttrib4fvNV (GLuint, const GLfloat *); -GLAPI void APIENTRY glVertexAttrib4sNV (GLuint, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexAttrib4svNV (GLuint, const GLshort *); -GLAPI void APIENTRY glVertexAttrib4ubNV (GLuint, GLubyte, GLubyte, GLubyte, GLubyte); -GLAPI void APIENTRY glVertexAttrib4ubvNV (GLuint, const GLubyte *); -GLAPI void APIENTRY glVertexAttribs1dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs1fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs1svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs2dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs2fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs2svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs3dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs3fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs3svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4dvNV (GLuint, GLsizei, const GLdouble *); -GLAPI void APIENTRY glVertexAttribs4fvNV (GLuint, GLsizei, const GLfloat *); -GLAPI void APIENTRY glVertexAttribs4svNV (GLuint, GLsizei, const GLshort *); -GLAPI void APIENTRY glVertexAttribs4ubvNV (GLuint, GLsizei, const GLubyte *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLAREPROGRAMSRESIDENTNVPROC) (GLsizei n, const GLuint *programs, GLboolean *residences); -typedef void (APIENTRYP PFNGLBINDPROGRAMNVPROC) (GLenum target, GLuint id); -typedef void (APIENTRYP PFNGLDELETEPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLEXECUTEPROGRAMNVPROC) (GLenum target, GLuint id, const GLfloat *params); -typedef void (APIENTRYP PFNGLGENPROGRAMSNVPROC) (GLsizei n, GLuint *programs); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERDVNVPROC) (GLenum target, GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETPROGRAMPARAMETERFVNVPROC) (GLenum target, GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETPROGRAMSTRINGNVPROC) (GLuint id, GLenum pname, GLubyte *program); -typedef void (APIENTRYP PFNGLGETTRACKMATRIXIVNVPROC) (GLenum target, GLuint address, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBDVNVPROC) (GLuint index, GLenum pname, GLdouble *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBFVNVPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBIVNVPROC) (GLuint index, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBPOINTERVNVPROC) (GLuint index, GLenum pname, GLvoid* *pointer); -typedef GLboolean (APIENTRYP PFNGLISPROGRAMNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLLOADPROGRAMNVPROC) (GLenum target, GLuint id, GLsizei len, const GLubyte *program); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DNVPROC) (GLenum target, GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4DVNVPROC) (GLenum target, GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FNVPROC) (GLenum target, GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETER4FVNVPROC) (GLenum target, GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4DVNVPROC) (GLenum target, GLuint index, GLuint count, const GLdouble *v); -typedef void (APIENTRYP PFNGLPROGRAMPARAMETERS4FVNVPROC) (GLenum target, GLuint index, GLuint count, const GLfloat *v); -typedef void (APIENTRYP PFNGLREQUESTRESIDENTPROGRAMSNVPROC) (GLsizei n, const GLuint *programs); -typedef void (APIENTRYP PFNGLTRACKMATRIXNVPROC) (GLenum target, GLuint address, GLenum matrix, GLenum transform); -typedef void (APIENTRYP PFNGLVERTEXATTRIBPOINTERNVPROC) (GLuint index, GLint fsize, GLenum type, GLsizei stride, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DNVPROC) (GLuint index, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FNVPROC) (GLuint index, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SNVPROC) (GLuint index, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DNVPROC) (GLuint index, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FNVPROC) (GLuint index, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SNVPROC) (GLuint index, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DNVPROC) (GLuint index, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4DVNVPROC) (GLuint index, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FNVPROC) (GLuint index, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4FVNVPROC) (GLuint index, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SNVPROC) (GLuint index, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4SVNVPROC) (GLuint index, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBNVPROC) (GLuint index, GLubyte x, GLubyte y, GLubyte z, GLubyte w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4UBVNVPROC) (GLuint index, const GLubyte *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4DVNVPROC) (GLuint index, GLsizei count, const GLdouble *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4FVNVPROC) (GLuint index, GLsizei count, const GLfloat *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4SVNVPROC) (GLuint index, GLsizei count, const GLshort *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4UBVNVPROC) (GLuint index, GLsizei count, const GLubyte *v); -#endif - -#ifndef GL_SGIX_texture_coordinate_clamp -#define GL_SGIX_texture_coordinate_clamp 1 -#endif - -#ifndef GL_SGIX_scalebias_hint -#define GL_SGIX_scalebias_hint 1 -#endif - -#ifndef GL_OML_interlace -#define GL_OML_interlace 1 -#endif - -#ifndef GL_OML_subsample -#define GL_OML_subsample 1 -#endif - -#ifndef GL_OML_resample -#define GL_OML_resample 1 -#endif - -#ifndef GL_NV_copy_depth_to_color -#define GL_NV_copy_depth_to_color 1 -#endif - -#ifndef GL_ATI_envmap_bumpmap -#define GL_ATI_envmap_bumpmap 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glTexBumpParameterivATI (GLenum, const GLint *); -GLAPI void APIENTRY glTexBumpParameterfvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glGetTexBumpParameterivATI (GLenum, GLint *); -GLAPI void APIENTRY glGetTexBumpParameterfvATI (GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERIVATIPROC) (GLenum pname, const GLint *param); -typedef void (APIENTRYP PFNGLTEXBUMPPARAMETERFVATIPROC) (GLenum pname, const GLfloat *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERIVATIPROC) (GLenum pname, GLint *param); -typedef void (APIENTRYP PFNGLGETTEXBUMPPARAMETERFVATIPROC) (GLenum pname, GLfloat *param); -#endif - -#ifndef GL_ATI_fragment_shader -#define GL_ATI_fragment_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glGenFragmentShadersATI (GLuint); -GLAPI void APIENTRY glBindFragmentShaderATI (GLuint); -GLAPI void APIENTRY glDeleteFragmentShaderATI (GLuint); -GLAPI void APIENTRY glBeginFragmentShaderATI (void); -GLAPI void APIENTRY glEndFragmentShaderATI (void); -GLAPI void APIENTRY glPassTexCoordATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glSampleMapATI (GLuint, GLuint, GLenum); -GLAPI void APIENTRY glColorFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glColorFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp1ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp2ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glAlphaFragmentOp3ATI (GLenum, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSetFragmentShaderConstantATI (GLuint, const GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLGENFRAGMENTSHADERSATIPROC) (GLuint range); -typedef void (APIENTRYP PFNGLBINDFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDELETEFRAGMENTSHADERATIPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLENDFRAGMENTSHADERATIPROC) (void); -typedef void (APIENTRYP PFNGLPASSTEXCOORDATIPROC) (GLuint dst, GLuint coord, GLenum swizzle); -typedef void (APIENTRYP PFNGLSAMPLEMAPATIPROC) (GLuint dst, GLuint interp, GLenum swizzle); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLCOLORFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMask, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP1ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP2ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod); -typedef void (APIENTRYP PFNGLALPHAFRAGMENTOP3ATIPROC) (GLenum op, GLuint dst, GLuint dstMod, GLuint arg1, GLuint arg1Rep, GLuint arg1Mod, GLuint arg2, GLuint arg2Rep, GLuint arg2Mod, GLuint arg3, GLuint arg3Rep, GLuint arg3Mod); -typedef void (APIENTRYP PFNGLSETFRAGMENTSHADERCONSTANTATIPROC) (GLuint dst, const GLfloat *value); -#endif - -#ifndef GL_ATI_pn_triangles -#define GL_ATI_pn_triangles 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPNTrianglesiATI (GLenum, GLint); -GLAPI void APIENTRY glPNTrianglesfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPNTRIANGLESIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPNTRIANGLESFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_vertex_array_object -#define GL_ATI_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLuint APIENTRY glNewObjectBufferATI (GLsizei, const GLvoid *, GLenum); -GLAPI GLboolean APIENTRY glIsObjectBufferATI (GLuint); -GLAPI void APIENTRY glUpdateObjectBufferATI (GLuint, GLuint, GLsizei, const GLvoid *, GLenum); -GLAPI void APIENTRY glGetObjectBufferfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetObjectBufferivATI (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glFreeObjectBufferATI (GLuint); -GLAPI void APIENTRY glArrayObjectATI (GLenum, GLint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetArrayObjectfvATI (GLenum, GLenum, GLfloat *); -GLAPI void APIENTRY glGetArrayObjectivATI (GLenum, GLenum, GLint *); -GLAPI void APIENTRY glVariantArrayObjectATI (GLuint, GLenum, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVariantArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLuint (APIENTRYP PFNGLNEWOBJECTBUFFERATIPROC) (GLsizei size, const GLvoid *pointer, GLenum usage); -typedef GLboolean (APIENTRYP PFNGLISOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUPDATEOBJECTBUFFERATIPROC) (GLuint buffer, GLuint offset, GLsizei size, const GLvoid *pointer, GLenum preserve); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERFVATIPROC) (GLuint buffer, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETOBJECTBUFFERIVATIPROC) (GLuint buffer, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLFREEOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLARRAYOBJECTATIPROC) (GLenum array, GLint size, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTFVATIPROC) (GLenum array, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETARRAYOBJECTIVATIPROC) (GLenum array, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLVARIANTARRAYOBJECTATIPROC) (GLuint id, GLenum type, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTFVATIPROC) (GLuint id, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVARIANTARRAYOBJECTIVATIPROC) (GLuint id, GLenum pname, GLint *params); -#endif - -#ifndef GL_EXT_vertex_shader -#define GL_EXT_vertex_shader 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBeginVertexShaderEXT (void); -GLAPI void APIENTRY glEndVertexShaderEXT (void); -GLAPI void APIENTRY glBindVertexShaderEXT (GLuint); -GLAPI GLuint APIENTRY glGenVertexShadersEXT (GLuint); -GLAPI void APIENTRY glDeleteVertexShaderEXT (GLuint); -GLAPI void APIENTRY glShaderOp1EXT (GLenum, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp2EXT (GLenum, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glShaderOp3EXT (GLenum, GLuint, GLuint, GLuint, GLuint); -GLAPI void APIENTRY glSwizzleEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glWriteMaskEXT (GLuint, GLuint, GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glInsertComponentEXT (GLuint, GLuint, GLuint); -GLAPI void APIENTRY glExtractComponentEXT (GLuint, GLuint, GLuint); -GLAPI GLuint APIENTRY glGenSymbolsEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glSetInvariantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glSetLocalConstantEXT (GLuint, GLenum, const GLvoid *); -GLAPI void APIENTRY glVariantbvEXT (GLuint, const GLbyte *); -GLAPI void APIENTRY glVariantsvEXT (GLuint, const GLshort *); -GLAPI void APIENTRY glVariantivEXT (GLuint, const GLint *); -GLAPI void APIENTRY glVariantfvEXT (GLuint, const GLfloat *); -GLAPI void APIENTRY glVariantdvEXT (GLuint, const GLdouble *); -GLAPI void APIENTRY glVariantubvEXT (GLuint, const GLubyte *); -GLAPI void APIENTRY glVariantusvEXT (GLuint, const GLushort *); -GLAPI void APIENTRY glVariantuivEXT (GLuint, const GLuint *); -GLAPI void APIENTRY glVariantPointerEXT (GLuint, GLenum, GLuint, const GLvoid *); -GLAPI void APIENTRY glEnableVariantClientStateEXT (GLuint); -GLAPI void APIENTRY glDisableVariantClientStateEXT (GLuint); -GLAPI GLuint APIENTRY glBindLightParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindMaterialParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTexGenParameterEXT (GLenum, GLenum, GLenum); -GLAPI GLuint APIENTRY glBindTextureUnitParameterEXT (GLenum, GLenum); -GLAPI GLuint APIENTRY glBindParameterEXT (GLenum); -GLAPI GLboolean APIENTRY glIsVariantEnabledEXT (GLuint, GLenum); -GLAPI void APIENTRY glGetVariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetVariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetVariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVariantPointervEXT (GLuint, GLenum, GLvoid* *); -GLAPI void APIENTRY glGetInvariantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetInvariantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetInvariantFloatvEXT (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetLocalConstantBooleanvEXT (GLuint, GLenum, GLboolean *); -GLAPI void APIENTRY glGetLocalConstantIntegervEXT (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetLocalConstantFloatvEXT (GLuint, GLenum, GLfloat *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBEGINVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLENDVERTEXSHADEREXTPROC) (void); -typedef void (APIENTRYP PFNGLBINDVERTEXSHADEREXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLGENVERTEXSHADERSEXTPROC) (GLuint range); -typedef void (APIENTRYP PFNGLDELETEVERTEXSHADEREXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLSHADEROP1EXTPROC) (GLenum op, GLuint res, GLuint arg1); -typedef void (APIENTRYP PFNGLSHADEROP2EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2); -typedef void (APIENTRYP PFNGLSHADEROP3EXTPROC) (GLenum op, GLuint res, GLuint arg1, GLuint arg2, GLuint arg3); -typedef void (APIENTRYP PFNGLSWIZZLEEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLWRITEMASKEXTPROC) (GLuint res, GLuint in, GLenum outX, GLenum outY, GLenum outZ, GLenum outW); -typedef void (APIENTRYP PFNGLINSERTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef void (APIENTRYP PFNGLEXTRACTCOMPONENTEXTPROC) (GLuint res, GLuint src, GLuint num); -typedef GLuint (APIENTRYP PFNGLGENSYMBOLSEXTPROC) (GLenum datatype, GLenum storagetype, GLenum range, GLuint components); -typedef void (APIENTRYP PFNGLSETINVARIANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLSETLOCALCONSTANTEXTPROC) (GLuint id, GLenum type, const GLvoid *addr); -typedef void (APIENTRYP PFNGLVARIANTBVEXTPROC) (GLuint id, const GLbyte *addr); -typedef void (APIENTRYP PFNGLVARIANTSVEXTPROC) (GLuint id, const GLshort *addr); -typedef void (APIENTRYP PFNGLVARIANTIVEXTPROC) (GLuint id, const GLint *addr); -typedef void (APIENTRYP PFNGLVARIANTFVEXTPROC) (GLuint id, const GLfloat *addr); -typedef void (APIENTRYP PFNGLVARIANTDVEXTPROC) (GLuint id, const GLdouble *addr); -typedef void (APIENTRYP PFNGLVARIANTUBVEXTPROC) (GLuint id, const GLubyte *addr); -typedef void (APIENTRYP PFNGLVARIANTUSVEXTPROC) (GLuint id, const GLushort *addr); -typedef void (APIENTRYP PFNGLVARIANTUIVEXTPROC) (GLuint id, const GLuint *addr); -typedef void (APIENTRYP PFNGLVARIANTPOINTEREXTPROC) (GLuint id, GLenum type, GLuint stride, const GLvoid *addr); -typedef void (APIENTRYP PFNGLENABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef void (APIENTRYP PFNGLDISABLEVARIANTCLIENTSTATEEXTPROC) (GLuint id); -typedef GLuint (APIENTRYP PFNGLBINDLIGHTPARAMETEREXTPROC) (GLenum light, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDMATERIALPARAMETEREXTPROC) (GLenum face, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXGENPARAMETEREXTPROC) (GLenum unit, GLenum coord, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDTEXTUREUNITPARAMETEREXTPROC) (GLenum unit, GLenum value); -typedef GLuint (APIENTRYP PFNGLBINDPARAMETEREXTPROC) (GLenum value); -typedef GLboolean (APIENTRYP PFNGLISVARIANTENABLEDEXTPROC) (GLuint id, GLenum cap); -typedef void (APIENTRYP PFNGLGETVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETVARIANTPOINTERVEXTPROC) (GLuint id, GLenum value, GLvoid* *data); -typedef void (APIENTRYP PFNGLGETINVARIANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETINVARIANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETINVARIANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTBOOLEANVEXTPROC) (GLuint id, GLenum value, GLboolean *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTINTEGERVEXTPROC) (GLuint id, GLenum value, GLint *data); -typedef void (APIENTRYP PFNGLGETLOCALCONSTANTFLOATVEXTPROC) (GLuint id, GLenum value, GLfloat *data); -#endif - -#ifndef GL_ATI_vertex_streams -#define GL_ATI_vertex_streams 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexStream1sATI (GLenum, GLshort); -GLAPI void APIENTRY glVertexStream1svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream1iATI (GLenum, GLint); -GLAPI void APIENTRY glVertexStream1ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream1fATI (GLenum, GLfloat); -GLAPI void APIENTRY glVertexStream1fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream1dATI (GLenum, GLdouble); -GLAPI void APIENTRY glVertexStream1dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream2sATI (GLenum, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream2svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream2iATI (GLenum, GLint, GLint); -GLAPI void APIENTRY glVertexStream2ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream2fATI (GLenum, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream2fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream2dATI (GLenum, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream2dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glVertexStream4sATI (GLenum, GLshort, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glVertexStream4svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glVertexStream4iATI (GLenum, GLint, GLint, GLint, GLint); -GLAPI void APIENTRY glVertexStream4ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glVertexStream4fATI (GLenum, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glVertexStream4fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glVertexStream4dATI (GLenum, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glVertexStream4dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glNormalStream3bATI (GLenum, GLbyte, GLbyte, GLbyte); -GLAPI void APIENTRY glNormalStream3bvATI (GLenum, const GLbyte *); -GLAPI void APIENTRY glNormalStream3sATI (GLenum, GLshort, GLshort, GLshort); -GLAPI void APIENTRY glNormalStream3svATI (GLenum, const GLshort *); -GLAPI void APIENTRY glNormalStream3iATI (GLenum, GLint, GLint, GLint); -GLAPI void APIENTRY glNormalStream3ivATI (GLenum, const GLint *); -GLAPI void APIENTRY glNormalStream3fATI (GLenum, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glNormalStream3fvATI (GLenum, const GLfloat *); -GLAPI void APIENTRY glNormalStream3dATI (GLenum, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glNormalStream3dvATI (GLenum, const GLdouble *); -GLAPI void APIENTRY glClientActiveVertexStreamATI (GLenum); -GLAPI void APIENTRY glVertexBlendEnviATI (GLenum, GLint); -GLAPI void APIENTRY glVertexBlendEnvfATI (GLenum, GLfloat); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SATIPROC) (GLenum stream, GLshort x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IATIPROC) (GLenum stream, GLint x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FATIPROC) (GLenum stream, GLfloat x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DATIPROC) (GLenum stream, GLdouble x); -typedef void (APIENTRYP PFNGLVERTEXSTREAM1DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SATIPROC) (GLenum stream, GLshort x, GLshort y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IATIPROC) (GLenum stream, GLint x, GLint y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FATIPROC) (GLenum stream, GLfloat x, GLfloat y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DATIPROC) (GLenum stream, GLdouble x, GLdouble y); -typedef void (APIENTRYP PFNGLVERTEXSTREAM2DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IATIPROC) (GLenum stream, GLint x, GLint y, GLint z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z); -typedef void (APIENTRYP PFNGLVERTEXSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SATIPROC) (GLenum stream, GLshort x, GLshort y, GLshort z, GLshort w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IATIPROC) (GLenum stream, GLint x, GLint y, GLint z, GLint w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FATIPROC) (GLenum stream, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DATIPROC) (GLenum stream, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLVERTEXSTREAM4DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BATIPROC) (GLenum stream, GLbyte nx, GLbyte ny, GLbyte nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3BVATIPROC) (GLenum stream, const GLbyte *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SATIPROC) (GLenum stream, GLshort nx, GLshort ny, GLshort nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3SVATIPROC) (GLenum stream, const GLshort *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IATIPROC) (GLenum stream, GLint nx, GLint ny, GLint nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3IVATIPROC) (GLenum stream, const GLint *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FATIPROC) (GLenum stream, GLfloat nx, GLfloat ny, GLfloat nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3FVATIPROC) (GLenum stream, const GLfloat *coords); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DATIPROC) (GLenum stream, GLdouble nx, GLdouble ny, GLdouble nz); -typedef void (APIENTRYP PFNGLNORMALSTREAM3DVATIPROC) (GLenum stream, const GLdouble *coords); -typedef void (APIENTRYP PFNGLCLIENTACTIVEVERTEXSTREAMATIPROC) (GLenum stream); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVIATIPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLVERTEXBLENDENVFATIPROC) (GLenum pname, GLfloat param); -#endif - -#ifndef GL_ATI_element_array -#define GL_ATI_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerATI (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayATI (GLenum, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayATI (GLenum, GLuint, GLuint, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERATIPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYATIPROC) (GLenum mode, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYATIPROC) (GLenum mode, GLuint start, GLuint end, GLsizei count); -#endif - -#ifndef GL_SUN_mesh_array -#define GL_SUN_mesh_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawMeshArraysSUN (GLenum, GLint, GLsizei, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWMESHARRAYSSUNPROC) (GLenum mode, GLint first, GLsizei count, GLsizei width); -#endif - -#ifndef GL_SUN_slice_accum -#define GL_SUN_slice_accum 1 -#endif - -#ifndef GL_NV_multisample_filter_hint -#define GL_NV_multisample_filter_hint 1 -#endif - -#ifndef GL_NV_depth_clamp -#define GL_NV_depth_clamp 1 -#endif - -#ifndef GL_NV_occlusion_query -#define GL_NV_occlusion_query 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenOcclusionQueriesNV (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteOcclusionQueriesNV (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glBeginOcclusionQueryNV (GLuint); -GLAPI void APIENTRY glEndOcclusionQueryNV (void); -GLAPI void APIENTRY glGetOcclusionQueryivNV (GLuint, GLenum, GLint *); -GLAPI void APIENTRY glGetOcclusionQueryuivNV (GLuint, GLenum, GLuint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENOCCLUSIONQUERIESNVPROC) (GLsizei n, GLuint *ids); -typedef void (APIENTRYP PFNGLDELETEOCCLUSIONQUERIESNVPROC) (GLsizei n, const GLuint *ids); -typedef GLboolean (APIENTRYP PFNGLISOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLBEGINOCCLUSIONQUERYNVPROC) (GLuint id); -typedef void (APIENTRYP PFNGLENDOCCLUSIONQUERYNVPROC) (void); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYIVNVPROC) (GLuint id, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGETOCCLUSIONQUERYUIVNVPROC) (GLuint id, GLenum pname, GLuint *params); -#endif - -#ifndef GL_NV_point_sprite -#define GL_NV_point_sprite 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPointParameteriNV (GLenum, GLint); -GLAPI void APIENTRY glPointParameterivNV (GLenum, const GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPOINTPARAMETERINVPROC) (GLenum pname, GLint param); -typedef void (APIENTRYP PFNGLPOINTPARAMETERIVNVPROC) (GLenum pname, const GLint *params); -#endif - -#ifndef GL_NV_texture_shader3 -#define GL_NV_texture_shader3 1 -#endif - -#ifndef GL_NV_vertex_program1_1 -#define GL_NV_vertex_program1_1 1 -#endif - -#ifndef GL_EXT_shadow_funcs -#define GL_EXT_shadow_funcs 1 -#endif - -#ifndef GL_EXT_stencil_two_side -#define GL_EXT_stencil_two_side 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glActiveStencilFaceEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLACTIVESTENCILFACEEXTPROC) (GLenum face); -#endif - -#ifndef GL_ATI_text_fragment_shader -#define GL_ATI_text_fragment_shader 1 -#endif - -#ifndef GL_APPLE_client_storage -#define GL_APPLE_client_storage 1 -#endif - -#ifndef GL_APPLE_element_array -#define GL_APPLE_element_array 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glElementPointerAPPLE (GLenum, const GLvoid *); -GLAPI void APIENTRY glDrawElementArrayAPPLE (GLenum, GLint, GLsizei); -GLAPI void APIENTRY glDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, GLint, GLsizei); -GLAPI void APIENTRY glMultiDrawElementArrayAPPLE (GLenum, const GLint *, const GLsizei *, GLsizei); -GLAPI void APIENTRY glMultiDrawRangeElementArrayAPPLE (GLenum, GLuint, GLuint, const GLint *, const GLsizei *, GLsizei); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLELEMENTPOINTERAPPLEPROC) (GLenum type, const GLvoid *pointer); -typedef void (APIENTRYP PFNGLDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, GLint first, GLsizei count); -typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTARRAYAPPLEPROC) (GLenum mode, const GLint *first, const GLsizei *count, GLsizei primcount); -typedef void (APIENTRYP PFNGLMULTIDRAWRANGEELEMENTARRAYAPPLEPROC) (GLenum mode, GLuint start, GLuint end, const GLint *first, const GLsizei *count, GLsizei primcount); -#endif - -#ifndef GL_APPLE_fence -#define GL_APPLE_fence 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glGenFencesAPPLE (GLsizei, GLuint *); -GLAPI void APIENTRY glDeleteFencesAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glSetFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glIsFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestFenceAPPLE (GLuint); -GLAPI void APIENTRY glFinishFenceAPPLE (GLuint); -GLAPI GLboolean APIENTRY glTestObjectAPPLE (GLenum, GLuint); -GLAPI void APIENTRY glFinishObjectAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLGENFENCESAPPLEPROC) (GLsizei n, GLuint *fences); -typedef void (APIENTRYP PFNGLDELETEFENCESAPPLEPROC) (GLsizei n, const GLuint *fences); -typedef void (APIENTRYP PFNGLSETFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLISFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTFENCEAPPLEPROC) (GLuint fence); -typedef void (APIENTRYP PFNGLFINISHFENCEAPPLEPROC) (GLuint fence); -typedef GLboolean (APIENTRYP PFNGLTESTOBJECTAPPLEPROC) (GLenum object, GLuint name); -typedef void (APIENTRYP PFNGLFINISHOBJECTAPPLEPROC) (GLenum object, GLint name); -#endif - -#ifndef GL_APPLE_vertex_array_object -#define GL_APPLE_vertex_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBindVertexArrayAPPLE (GLuint); -GLAPI void APIENTRY glDeleteVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenVertexArraysAPPLE (GLsizei, const GLuint *); -GLAPI GLboolean APIENTRY glIsVertexArrayAPPLE (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBINDVERTEXARRAYAPPLEPROC) (GLuint array); -typedef void (APIENTRYP PFNGLDELETEVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef void (APIENTRYP PFNGLGENVERTEXARRAYSAPPLEPROC) (GLsizei n, const GLuint *arrays); -typedef GLboolean (APIENTRYP PFNGLISVERTEXARRAYAPPLEPROC) (GLuint array); -#endif - -#ifndef GL_APPLE_vertex_array_range -#define GL_APPLE_vertex_array_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushVertexArrayRangeAPPLE (GLsizei, GLvoid *); -GLAPI void APIENTRY glVertexArrayParameteriAPPLE (GLenum, GLint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHVERTEXARRAYRANGEAPPLEPROC) (GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLVERTEXARRAYPARAMETERIAPPLEPROC) (GLenum pname, GLint param); -#endif - -#ifndef GL_APPLE_ycbcr_422 -#define GL_APPLE_ycbcr_422 1 -#endif - -#ifndef GL_S3_s3tc -#define GL_S3_s3tc 1 -#endif - -#ifndef GL_ATI_draw_buffers -#define GL_ATI_draw_buffers 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDrawBuffersATI (GLsizei, const GLenum *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDRAWBUFFERSATIPROC) (GLsizei n, const GLenum *bufs); -#endif - -#ifndef GL_ATI_pixel_format_float -#define GL_ATI_pixel_format_float 1 -/* This is really a WGL extension, but defines some associated GL enums. - * ATI does not export "GL_ATI_pixel_format_float" in the GL_EXTENSIONS string. - */ -#endif - -#ifndef GL_ATI_texture_env_combine3 -#define GL_ATI_texture_env_combine3 1 -#endif - -#ifndef GL_ATI_texture_float -#define GL_ATI_texture_float 1 -#endif - -#ifndef GL_NV_float_buffer -#define GL_NV_float_buffer 1 -#endif - -#ifndef GL_NV_fragment_program -#define GL_NV_fragment_program 1 -/* Some NV_fragment_program entry points are shared with ARB_vertex_program. */ -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glProgramNamedParameter4fNV (GLuint, GLsizei, const GLubyte *, GLfloat, GLfloat, GLfloat, GLfloat); -GLAPI void APIENTRY glProgramNamedParameter4dNV (GLuint, GLsizei, const GLubyte *, GLdouble, GLdouble, GLdouble, GLdouble); -GLAPI void APIENTRY glProgramNamedParameter4fvNV (GLuint, GLsizei, const GLubyte *, const GLfloat *); -GLAPI void APIENTRY glProgramNamedParameter4dvNV (GLuint, GLsizei, const GLubyte *, const GLdouble *); -GLAPI void APIENTRY glGetProgramNamedParameterfvNV (GLuint, GLsizei, const GLubyte *, GLfloat *); -GLAPI void APIENTRY glGetProgramNamedParameterdvNV (GLuint, GLsizei, const GLubyte *, GLdouble *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat x, GLfloat y, GLfloat z, GLfloat w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble x, GLdouble y, GLdouble z, GLdouble w); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4FVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLfloat *v); -typedef void (APIENTRYP PFNGLPROGRAMNAMEDPARAMETER4DVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, const GLdouble *v); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERFVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLfloat *params); -typedef void (APIENTRYP PFNGLGETPROGRAMNAMEDPARAMETERDVNVPROC) (GLuint id, GLsizei len, const GLubyte *name, GLdouble *params); -#endif - -#ifndef GL_NV_half_float -#define GL_NV_half_float 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertex2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertex4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertex4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glNormal3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glNormal3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glColor4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glColor4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord1hNV (GLhalfNV); -GLAPI void APIENTRY glTexCoord1hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord2hNV (GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord2hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glTexCoord4hNV (GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glTexCoord4hvNV (const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord1hNV (GLenum, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord1hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord2hNV (GLenum, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord2hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord3hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord3hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glMultiTexCoord4hNV (GLenum, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glMultiTexCoord4hvNV (GLenum, const GLhalfNV *); -GLAPI void APIENTRY glFogCoordhNV (GLhalfNV); -GLAPI void APIENTRY glFogCoordhvNV (const GLhalfNV *); -GLAPI void APIENTRY glSecondaryColor3hNV (GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glSecondaryColor3hvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexWeighthNV (GLhalfNV); -GLAPI void APIENTRY glVertexWeighthvNV (const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib1hNV (GLuint, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib1hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib2hNV (GLuint, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib2hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib3hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib3hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttrib4hNV (GLuint, GLhalfNV, GLhalfNV, GLhalfNV, GLhalfNV); -GLAPI void APIENTRY glVertexAttrib4hvNV (GLuint, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs1hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs2hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs3hvNV (GLuint, GLsizei, const GLhalfNV *); -GLAPI void APIENTRY glVertexAttribs4hvNV (GLuint, GLsizei, const GLhalfNV *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEX2HNVPROC) (GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEX2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX3HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEX3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEX4HNVPROC) (GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEX4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLNORMAL3HNVPROC) (GLhalfNV nx, GLhalfNV ny, GLhalfNV nz); -typedef void (APIENTRYP PFNGLNORMAL3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLCOLOR4HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue, GLhalfNV alpha); -typedef void (APIENTRYP PFNGLCOLOR4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD1HNVPROC) (GLhalfNV s); -typedef void (APIENTRYP PFNGLTEXCOORD1HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD2HNVPROC) (GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLTEXCOORD2HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD3HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLTEXCOORD3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLTEXCOORD4HNVPROC) (GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLTEXCOORD4HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HNVPROC) (GLenum target, GLhalfNV s); -typedef void (APIENTRYP PFNGLMULTITEXCOORD1HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t); -typedef void (APIENTRYP PFNGLMULTITEXCOORD2HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r); -typedef void (APIENTRYP PFNGLMULTITEXCOORD3HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HNVPROC) (GLenum target, GLhalfNV s, GLhalfNV t, GLhalfNV r, GLhalfNV q); -typedef void (APIENTRYP PFNGLMULTITEXCOORD4HVNVPROC) (GLenum target, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLFOGCOORDHNVPROC) (GLhalfNV fog); -typedef void (APIENTRYP PFNGLFOGCOORDHVNVPROC) (const GLhalfNV *fog); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HNVPROC) (GLhalfNV red, GLhalfNV green, GLhalfNV blue); -typedef void (APIENTRYP PFNGLSECONDARYCOLOR3HVNVPROC) (const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHNVPROC) (GLhalfNV weight); -typedef void (APIENTRYP PFNGLVERTEXWEIGHTHVNVPROC) (const GLhalfNV *weight); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HNVPROC) (GLuint index, GLhalfNV x); -typedef void (APIENTRYP PFNGLVERTEXATTRIB1HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y); -typedef void (APIENTRYP PFNGLVERTEXATTRIB2HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z); -typedef void (APIENTRYP PFNGLVERTEXATTRIB3HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HNVPROC) (GLuint index, GLhalfNV x, GLhalfNV y, GLhalfNV z, GLhalfNV w); -typedef void (APIENTRYP PFNGLVERTEXATTRIB4HVNVPROC) (GLuint index, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS1HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS2HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS3HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -typedef void (APIENTRYP PFNGLVERTEXATTRIBS4HVNVPROC) (GLuint index, GLsizei n, const GLhalfNV *v); -#endif - -#ifndef GL_NV_pixel_data_range -#define GL_NV_pixel_data_range 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPixelDataRangeNV (GLenum, GLsizei, GLvoid *); -GLAPI void APIENTRY glFlushPixelDataRangeNV (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPIXELDATARANGENVPROC) (GLenum target, GLsizei length, GLvoid *pointer); -typedef void (APIENTRYP PFNGLFLUSHPIXELDATARANGENVPROC) (GLenum target); -#endif - -#ifndef GL_NV_primitive_restart -#define GL_NV_primitive_restart 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glPrimitiveRestartNV (void); -GLAPI void APIENTRY glPrimitiveRestartIndexNV (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTNVPROC) (void); -typedef void (APIENTRYP PFNGLPRIMITIVERESTARTINDEXNVPROC) (GLuint index); -#endif - -#ifndef GL_NV_texture_expand_normal -#define GL_NV_texture_expand_normal 1 -#endif - -#ifndef GL_NV_vertex_program2 -#define GL_NV_vertex_program2 1 -#endif - -#ifndef GL_ATI_map_object_buffer -#define GL_ATI_map_object_buffer 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLvoid* APIENTRY glMapObjectBufferATI (GLuint); -GLAPI void APIENTRY glUnmapObjectBufferATI (GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLvoid* (APIENTRYP PFNGLMAPOBJECTBUFFERATIPROC) (GLuint buffer); -typedef void (APIENTRYP PFNGLUNMAPOBJECTBUFFERATIPROC) (GLuint buffer); -#endif - -#ifndef GL_ATI_separate_stencil -#define GL_ATI_separate_stencil 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStencilOpSeparateATI (GLenum, GLenum, GLenum, GLenum); -GLAPI void APIENTRY glStencilFuncSeparateATI (GLenum, GLenum, GLint, GLuint); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTENCILOPSEPARATEATIPROC) (GLenum face, GLenum sfail, GLenum dpfail, GLenum dppass); -typedef void (APIENTRYP PFNGLSTENCILFUNCSEPARATEATIPROC) (GLenum frontfunc, GLenum backfunc, GLint ref, GLuint mask); -#endif - -#ifndef GL_ATI_vertex_attrib_array_object -#define GL_ATI_vertex_attrib_array_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glVertexAttribArrayObjectATI (GLuint, GLint, GLenum, GLboolean, GLsizei, GLuint, GLuint); -GLAPI void APIENTRY glGetVertexAttribArrayObjectfvATI (GLuint, GLenum, GLfloat *); -GLAPI void APIENTRY glGetVertexAttribArrayObjectivATI (GLuint, GLenum, GLint *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLVERTEXATTRIBARRAYOBJECTATIPROC) (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLuint buffer, GLuint offset); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTFVATIPROC) (GLuint index, GLenum pname, GLfloat *params); -typedef void (APIENTRYP PFNGLGETVERTEXATTRIBARRAYOBJECTIVATIPROC) (GLuint index, GLenum pname, GLint *params); -#endif - -#ifndef GL_OES_read_format -#define GL_OES_read_format 1 -#endif - -#ifndef GL_EXT_depth_bounds_test -#define GL_EXT_depth_bounds_test 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glDepthBoundsEXT (GLclampd, GLclampd); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLDEPTHBOUNDSEXTPROC) (GLclampd zmin, GLclampd zmax); -#endif - -#ifndef GL_EXT_texture_mirror_clamp -#define GL_EXT_texture_mirror_clamp 1 -#endif - -#ifndef GL_EXT_blend_equation_separate -#define GL_EXT_blend_equation_separate 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glBlendEquationSeparateEXT (GLenum, GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLBLENDEQUATIONSEPARATEEXTPROC) (GLenum modeRGB, GLenum modeAlpha); -#endif - -#ifndef GL_MESA_pack_invert -#define GL_MESA_pack_invert 1 -#endif - -#ifndef GL_MESA_ycbcr_texture -#define GL_MESA_ycbcr_texture 1 -#endif - -#ifndef GL_EXT_pixel_buffer_object -#define GL_EXT_pixel_buffer_object 1 -#endif - -#ifndef GL_NV_fragment_program_option -#define GL_NV_fragment_program_option 1 -#endif - -#ifndef GL_NV_fragment_program2 -#define GL_NV_fragment_program2 1 -#endif - -#ifndef GL_NV_vertex_program2_option -#define GL_NV_vertex_program2_option 1 -#endif - -#ifndef GL_NV_vertex_program3 -#define GL_NV_vertex_program3 1 -#endif - -#ifndef GL_EXT_framebuffer_object -#define GL_EXT_framebuffer_object 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI GLboolean APIENTRY glIsRenderbufferEXT (GLuint); -GLAPI void APIENTRY glBindRenderbufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteRenderbuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenRenderbuffersEXT (GLsizei, GLuint *); -GLAPI void APIENTRY glRenderbufferStorageEXT (GLenum, GLenum, GLsizei, GLsizei); -GLAPI void APIENTRY glGetRenderbufferParameterivEXT (GLenum, GLenum, GLint *); -GLAPI GLboolean APIENTRY glIsFramebufferEXT (GLuint); -GLAPI void APIENTRY glBindFramebufferEXT (GLenum, GLuint); -GLAPI void APIENTRY glDeleteFramebuffersEXT (GLsizei, const GLuint *); -GLAPI void APIENTRY glGenFramebuffersEXT (GLsizei, GLuint *); -GLAPI GLenum APIENTRY glCheckFramebufferStatusEXT (GLenum); -GLAPI void APIENTRY glFramebufferTexture1DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture2DEXT (GLenum, GLenum, GLenum, GLuint, GLint); -GLAPI void APIENTRY glFramebufferTexture3DEXT (GLenum, GLenum, GLenum, GLuint, GLint, GLint); -GLAPI void APIENTRY glFramebufferRenderbufferEXT (GLenum, GLenum, GLenum, GLuint); -GLAPI void APIENTRY glGetFramebufferAttachmentParameterivEXT (GLenum, GLenum, GLenum, GLint *); -GLAPI void APIENTRY glGenerateMipmapEXT (GLenum); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef GLboolean (APIENTRYP PFNGLISRENDERBUFFEREXTPROC) (GLuint renderbuffer); -typedef void (APIENTRYP PFNGLBINDRENDERBUFFEREXTPROC) (GLenum target, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLDELETERENDERBUFFERSEXTPROC) (GLsizei n, const GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLGENRENDERBUFFERSEXTPROC) (GLsizei n, GLuint *renderbuffers); -typedef void (APIENTRYP PFNGLRENDERBUFFERSTORAGEEXTPROC) (GLenum target, GLenum internalformat, GLsizei width, GLsizei height); -typedef void (APIENTRYP PFNGLGETRENDERBUFFERPARAMETERIVEXTPROC) (GLenum target, GLenum pname, GLint *params); -typedef GLboolean (APIENTRYP PFNGLISFRAMEBUFFEREXTPROC) (GLuint framebuffer); -typedef void (APIENTRYP PFNGLBINDFRAMEBUFFEREXTPROC) (GLenum target, GLuint framebuffer); -typedef void (APIENTRYP PFNGLDELETEFRAMEBUFFERSEXTPROC) (GLsizei n, const GLuint *framebuffers); -typedef void (APIENTRYP PFNGLGENFRAMEBUFFERSEXTPROC) (GLsizei n, GLuint *framebuffers); -typedef GLenum (APIENTRYP PFNGLCHECKFRAMEBUFFERSTATUSEXTPROC) (GLenum target); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE1DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE2DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level); -typedef void (APIENTRYP PFNGLFRAMEBUFFERTEXTURE3DEXTPROC) (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset); -typedef void (APIENTRYP PFNGLFRAMEBUFFERRENDERBUFFEREXTPROC) (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer); -typedef void (APIENTRYP PFNGLGETFRAMEBUFFERATTACHMENTPARAMETERIVEXTPROC) (GLenum target, GLenum attachment, GLenum pname, GLint *params); -typedef void (APIENTRYP PFNGLGENERATEMIPMAPEXTPROC) (GLenum target); -#endif - -#ifndef GL_GREMEDY_string_marker -#define GL_GREMEDY_string_marker 1 -#ifdef GL_GLEXT_PROTOTYPES -GLAPI void APIENTRY glStringMarkerGREMEDY (GLsizei, const GLvoid *); -#endif /* GL_GLEXT_PROTOTYPES */ -typedef void (APIENTRYP PFNGLSTRINGMARKERGREMEDYPROC) (GLsizei len, const GLvoid *string); -#endif - - -#ifdef __cplusplus -} -#endif - -#endif diff --git a/src/win32/dependencies/info.txt b/src/win32/dependencies/info.txt deleted file mode 100644 index 45827b3b..00000000 --- a/src/win32/dependencies/info.txt +++ /dev/null @@ -1 +0,0 @@ -All those libraries use the Static Multi-Threaded C/C++ [Release / Debug] libraries. \ No newline at end of file