MHS.
This isn’t a plug; it literally is the most useful non-standard tool I use while programming, thanks to its script feature and hotkeys.
When I want to make a new class I hit Ctrl-1 and type the name of the class and the macro guard name and it spits out the whole class template, complete with namespace, comment header/copyright, class body, constructor/destructor, public and protected sections, etc.
Ctrl-3 to create a Doxygen comment for a method or member.
/**
* DESCRIPTION
*
* \param PARM DESC
* \param PARM DESC
* \return RETURN
*/
I Ctrl-Click the capital words to fully select them and fill them appropriately.
I set a hotkey on Ctrl-8 and wrote a script to add
static_cast<TYPE>() around variables for me (where
TYPE is replaced with whatever I have in the clipboard, and the parentheses are surrounding the thing that needs to be cast).
Spitting out predefined text is not its only use.
I often use it to generate tables, such as this one which parameterizes a template function and makes a function-pointer table for some texel-converting routine for images:
LSE_INLINE const LSUINT32 LSE_FCALL CImageLib::ConvComponent( LSI_PIXEL_FORMAT _pfSrcFormat, LSI_PIXEL_FORMAT _pfDstFormat,
LSI_PIXEL_COMPONENTS _ppComp, LSUINT32 _ui32Component ) {
typedef LSUINT32 (LSE_FCALL * PfConverterFunc)( LSUINT32 _ui32Src );
static const PfConverterFunc pfTable[LSI_PF_TOTAL_INT][LSI_PF_TOTAL_INT][4] = {
{ // LSI_PF_A8
{ // LSI_PF_A8 -> LSI_PF_A8
CImageLib::ConvComp<0, 0, false>, // LSI_PP_R
CImageLib::ConvComp<0, 0, false>, // LSI_PP_G
CImageLib::ConvComp<0, 0, false>, // LSI_PP_B
CImageLib::ConvComp<8, 8, true>, // LSI_PP_A
},
{ // LSI_PF_A8 -> LSI_PF_R3G3B2
CImageLib::ConvComp<0, 3, false>, // LSI_PP_R
CImageLib::ConvComp<0, 3, false>, // LSI_PP_G
CImageLib::ConvComp<0, 2, false>, // LSI_PP_B
CImageLib::ConvComp<8, 0, true>, // LSI_PP_A
},
{ // LSI_PF_A8 -> LSI_PF_R5G6B5
CImageLib::ConvComp<0, 5, false>, // LSI_PP_R
CImageLib::ConvComp<0, 6, false>, // LSI_PP_G
CImageLib::ConvComp<0, 5, false>, // LSI_PP_B
CImageLib::ConvComp<8, 0, true>, // LSI_PP_A
},
{ // LSI_PF_A8 -> LSI_PF_R4G4B4A4
CImageLib::ConvComp<0, 4, false>, // LSI_PP_R
CImageLib::ConvComp<0, 4, false>, // LSI_PP_G
CImageLib::ConvComp<0, 4, false>, // LSI_PP_B
CImageLib::ConvComp<8, 4, true>, // LSI_PP_A
},
{ // LSI_PF_A8 -> LSI_PF_R5G5B5A1
CImageLib::ConvComp<0, 5, false>, // LSI_PP_R
CImageLib::ConvComp<0, 5, false>, // LSI_PP_G
CImageLib::ConvComp<0, 5, false>, // LSI_PP_B
CImageLib::ConvComp<8, 1, true>, // LSI_PP_A
},
{ // LSI_PF_A8 -> LSI_PF_R8G8B8
CImageLib::ConvComp<0, 8, false>, // LSI_PP_R
CImageLib::ConvComp<0, 8, false>, // LSI_PP_G
CImageLib::ConvComp<0, 8, false>, // LSI_PP_B
CImageLib::ConvComp<8, 0, true>, // LSI_PP_A
},
{ // LSI_PF_A8 -> LSI_PF_R8G8B8A8
CImageLib::ConvComp<0, 8, false>, // LSI_PP_R
CImageLib::ConvComp<0, 8, false>, // LSI_PP_G
CImageLib::ConvComp<0, 8, false>, // LSI_PP_B
CImageLib::ConvComp<8, 8, true>, // LSI_PP_A
},
{ // LSI_PF_A8 -> LSI_PF_R16G16B16A16
CImageLib::ConvComp<0, 16, false>, // LSI_PP_R
CImageLib::ConvComp<0, 16, false>, // LSI_PP_G
CImageLib::ConvComp<0, 16, false>, // LSI_PP_B
CImageLib::ConvComp<8, 16, true>, // LSI_PP_A
},
},
{ // LSI_PF_R3G3B2
{ // LSI_PF_R3G3B2 -> LSI_PF_A8
CImageLib::ConvComp<3, 0, false>, // LSI_PP_R
CImageLib::ConvComp<3, 0, false>, // LSI_PP_G
CImageLib::ConvComp<2, 0, false>, // LSI_PP_B
CImageLib::ConvComp<0, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R3G3B2 -> LSI_PF_R3G3B2
CImageLib::ConvComp<3, 3, false>, // LSI_PP_R
CImageLib::ConvComp<3, 3, false>, // LSI_PP_G
CImageLib::ConvComp<2, 2, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R3G3B2 -> LSI_PF_R5G6B5
CImageLib::ConvComp<3, 5, false>, // LSI_PP_R
CImageLib::ConvComp<3, 6, false>, // LSI_PP_G
CImageLib::ConvComp<2, 5, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R3G3B2 -> LSI_PF_R4G4B4A4
CImageLib::ConvComp<3, 4, false>, // LSI_PP_R
CImageLib::ConvComp<3, 4, false>, // LSI_PP_G
CImageLib::ConvComp<2, 4, false>, // LSI_PP_B
CImageLib::ConvComp<0, 4, true>, // LSI_PP_A
},
{ // LSI_PF_R3G3B2 -> LSI_PF_R5G5B5A1
CImageLib::ConvComp<3, 5, false>, // LSI_PP_R
CImageLib::ConvComp<3, 5, false>, // LSI_PP_G
CImageLib::ConvComp<2, 5, false>, // LSI_PP_B
CImageLib::ConvComp<0, 1, true>, // LSI_PP_A
},
{ // LSI_PF_R3G3B2 -> LSI_PF_R8G8B8
CImageLib::ConvComp<3, 8, false>, // LSI_PP_R
CImageLib::ConvComp<3, 8, false>, // LSI_PP_G
CImageLib::ConvComp<2, 8, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R3G3B2 -> LSI_PF_R8G8B8A8
CImageLib::ConvComp<3, 8, false>, // LSI_PP_R
CImageLib::ConvComp<3, 8, false>, // LSI_PP_G
CImageLib::ConvComp<2, 8, false>, // LSI_PP_B
CImageLib::ConvComp<0, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R3G3B2 -> LSI_PF_R16G16B16A16
CImageLib::ConvComp<3, 16, false>, // LSI_PP_R
CImageLib::ConvComp<3, 16, false>, // LSI_PP_G
CImageLib::ConvComp<2, 16, false>, // LSI_PP_B
CImageLib::ConvComp<0, 16, true>, // LSI_PP_A
},
},
{ // LSI_PF_R5G6B5
{ // LSI_PF_R5G6B5 -> LSI_PF_A8
CImageLib::ConvComp<5, 0, false>, // LSI_PP_R
CImageLib::ConvComp<6, 0, false>, // LSI_PP_G
CImageLib::ConvComp<5, 0, false>, // LSI_PP_B
CImageLib::ConvComp<0, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R5G6B5 -> LSI_PF_R3G3B2
CImageLib::ConvComp<5, 3, false>, // LSI_PP_R
CImageLib::ConvComp<6, 3, false>, // LSI_PP_G
CImageLib::ConvComp<5, 2, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R5G6B5 -> LSI_PF_R5G6B5
CImageLib::ConvComp<5, 5, false>, // LSI_PP_R
CImageLib::ConvComp<6, 6, false>, // LSI_PP_G
CImageLib::ConvComp<5, 5, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R5G6B5 -> LSI_PF_R4G4B4A4
CImageLib::ConvComp<5, 4, false>, // LSI_PP_R
CImageLib::ConvComp<6, 4, false>, // LSI_PP_G
CImageLib::ConvComp<5, 4, false>, // LSI_PP_B
CImageLib::ConvComp<0, 4, true>, // LSI_PP_A
},
{ // LSI_PF_R5G6B5 -> LSI_PF_R5G5B5A1
CImageLib::ConvComp<5, 5, false>, // LSI_PP_R
CImageLib::ConvComp<6, 5, false>, // LSI_PP_G
CImageLib::ConvComp<5, 5, false>, // LSI_PP_B
CImageLib::ConvComp<0, 1, true>, // LSI_PP_A
},
{ // LSI_PF_R5G6B5 -> LSI_PF_R8G8B8
CImageLib::ConvComp<5, 8, false>, // LSI_PP_R
CImageLib::ConvComp<6, 8, false>, // LSI_PP_G
CImageLib::ConvComp<5, 8, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R5G6B5 -> LSI_PF_R8G8B8A8
CImageLib::ConvComp<5, 8, false>, // LSI_PP_R
CImageLib::ConvComp<6, 8, false>, // LSI_PP_G
CImageLib::ConvComp<5, 8, false>, // LSI_PP_B
CImageLib::ConvComp<0, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R5G6B5 -> LSI_PF_R16G16B16A16
CImageLib::ConvComp<5, 16, false>, // LSI_PP_R
CImageLib::ConvComp<6, 16, false>, // LSI_PP_G
CImageLib::ConvComp<5, 16, false>, // LSI_PP_B
CImageLib::ConvComp<0, 16, true>, // LSI_PP_A
},
},
{ // LSI_PF_R4G4B4A4
{ // LSI_PF_R4G4B4A4 -> LSI_PF_A8
CImageLib::ConvComp<4, 0, false>, // LSI_PP_R
CImageLib::ConvComp<4, 0, false>, // LSI_PP_G
CImageLib::ConvComp<4, 0, false>, // LSI_PP_B
CImageLib::ConvComp<4, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R4G4B4A4 -> LSI_PF_R3G3B2
CImageLib::ConvComp<4, 3, false>, // LSI_PP_R
CImageLib::ConvComp<4, 3, false>, // LSI_PP_G
CImageLib::ConvComp<4, 2, false>, // LSI_PP_B
CImageLib::ConvComp<4, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R4G4B4A4 -> LSI_PF_R5G6B5
CImageLib::ConvComp<4, 5, false>, // LSI_PP_R
CImageLib::ConvComp<4, 6, false>, // LSI_PP_G
CImageLib::ConvComp<4, 5, false>, // LSI_PP_B
CImageLib::ConvComp<4, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R4G4B4A4 -> LSI_PF_R4G4B4A4
CImageLib::ConvComp<4, 4, false>, // LSI_PP_R
CImageLib::ConvComp<4, 4, false>, // LSI_PP_G
CImageLib::ConvComp<4, 4, false>, // LSI_PP_B
CImageLib::ConvComp<4, 4, true>, // LSI_PP_A
},
{ // LSI_PF_R4G4B4A4 -> LSI_PF_R5G5B5A1
CImageLib::ConvComp<4, 5, false>, // LSI_PP_R
CImageLib::ConvComp<4, 5, false>, // LSI_PP_G
CImageLib::ConvComp<4, 5, false>, // LSI_PP_B
CImageLib::ConvComp<4, 1, true>, // LSI_PP_A
},
{ // LSI_PF_R4G4B4A4 -> LSI_PF_R8G8B8
CImageLib::ConvComp<4, 8, false>, // LSI_PP_R
CImageLib::ConvComp<4, 8, false>, // LSI_PP_G
CImageLib::ConvComp<4, 8, false>, // LSI_PP_B
CImageLib::ConvComp<4, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R4G4B4A4 -> LSI_PF_R8G8B8A8
CImageLib::ConvComp<4, 8, false>, // LSI_PP_R
CImageLib::ConvComp<4, 8, false>, // LSI_PP_G
CImageLib::ConvComp<4, 8, false>, // LSI_PP_B
CImageLib::ConvComp<4, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R4G4B4A4 -> LSI_PF_R16G16B16A16
CImageLib::ConvComp<4, 16, false>, // LSI_PP_R
CImageLib::ConvComp<4, 16, false>, // LSI_PP_G
CImageLib::ConvComp<4, 16, false>, // LSI_PP_B
CImageLib::ConvComp<4, 16, true>, // LSI_PP_A
},
},
{ // LSI_PF_R5G5B5A1
{ // LSI_PF_R5G5B5A1 -> LSI_PF_A8
CImageLib::ConvComp<5, 0, false>, // LSI_PP_R
CImageLib::ConvComp<5, 0, false>, // LSI_PP_G
CImageLib::ConvComp<5, 0, false>, // LSI_PP_B
CImageLib::ConvComp<1, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R5G5B5A1 -> LSI_PF_R3G3B2
CImageLib::ConvComp<5, 3, false>, // LSI_PP_R
CImageLib::ConvComp<5, 3, false>, // LSI_PP_G
CImageLib::ConvComp<5, 2, false>, // LSI_PP_B
CImageLib::ConvComp<1, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R5G5B5A1 -> LSI_PF_R5G6B5
CImageLib::ConvComp<5, 5, false>, // LSI_PP_R
CImageLib::ConvComp<5, 6, false>, // LSI_PP_G
CImageLib::ConvComp<5, 5, false>, // LSI_PP_B
CImageLib::ConvComp<1, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R5G5B5A1 -> LSI_PF_R4G4B4A4
CImageLib::ConvComp<5, 4, false>, // LSI_PP_R
CImageLib::ConvComp<5, 4, false>, // LSI_PP_G
CImageLib::ConvComp<5, 4, false>, // LSI_PP_B
CImageLib::ConvComp<1, 4, true>, // LSI_PP_A
},
{ // LSI_PF_R5G5B5A1 -> LSI_PF_R5G5B5A1
CImageLib::ConvComp<5, 5, false>, // LSI_PP_R
CImageLib::ConvComp<5, 5, false>, // LSI_PP_G
CImageLib::ConvComp<5, 5, false>, // LSI_PP_B
CImageLib::ConvComp<1, 1, true>, // LSI_PP_A
},
{ // LSI_PF_R5G5B5A1 -> LSI_PF_R8G8B8
CImageLib::ConvComp<5, 8, false>, // LSI_PP_R
CImageLib::ConvComp<5, 8, false>, // LSI_PP_G
CImageLib::ConvComp<5, 8, false>, // LSI_PP_B
CImageLib::ConvComp<1, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R5G5B5A1 -> LSI_PF_R8G8B8A8
CImageLib::ConvComp<5, 8, false>, // LSI_PP_R
CImageLib::ConvComp<5, 8, false>, // LSI_PP_G
CImageLib::ConvComp<5, 8, false>, // LSI_PP_B
CImageLib::ConvComp<1, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R5G5B5A1 -> LSI_PF_R16G16B16A16
CImageLib::ConvComp<5, 16, false>, // LSI_PP_R
CImageLib::ConvComp<5, 16, false>, // LSI_PP_G
CImageLib::ConvComp<5, 16, false>, // LSI_PP_B
CImageLib::ConvComp<1, 16, true>, // LSI_PP_A
},
},
{ // LSI_PF_R8G8B8
{ // LSI_PF_R8G8B8 -> LSI_PF_A8
CImageLib::ConvComp<8, 0, false>, // LSI_PP_R
CImageLib::ConvComp<8, 0, false>, // LSI_PP_G
CImageLib::ConvComp<8, 0, false>, // LSI_PP_B
CImageLib::ConvComp<0, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8 -> LSI_PF_R3G3B2
CImageLib::ConvComp<8, 3, false>, // LSI_PP_R
CImageLib::ConvComp<8, 3, false>, // LSI_PP_G
CImageLib::ConvComp<8, 2, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8 -> LSI_PF_R5G6B5
CImageLib::ConvComp<8, 5, false>, // LSI_PP_R
CImageLib::ConvComp<8, 6, false>, // LSI_PP_G
CImageLib::ConvComp<8, 5, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8 -> LSI_PF_R4G4B4A4
CImageLib::ConvComp<8, 4, false>, // LSI_PP_R
CImageLib::ConvComp<8, 4, false>, // LSI_PP_G
CImageLib::ConvComp<8, 4, false>, // LSI_PP_B
CImageLib::ConvComp<0, 4, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8 -> LSI_PF_R5G5B5A1
CImageLib::ConvComp<8, 5, false>, // LSI_PP_R
CImageLib::ConvComp<8, 5, false>, // LSI_PP_G
CImageLib::ConvComp<8, 5, false>, // LSI_PP_B
CImageLib::ConvComp<0, 1, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8 -> LSI_PF_R8G8B8
CImageLib::ConvComp<8, 8, false>, // LSI_PP_R
CImageLib::ConvComp<8, 8, false>, // LSI_PP_G
CImageLib::ConvComp<8, 8, false>, // LSI_PP_B
CImageLib::ConvComp<0, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8 -> LSI_PF_R8G8B8A8
CImageLib::ConvComp<8, 8, false>, // LSI_PP_R
CImageLib::ConvComp<8, 8, false>, // LSI_PP_G
CImageLib::ConvComp<8, 8, false>, // LSI_PP_B
CImageLib::ConvComp<0, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8 -> LSI_PF_R16G16B16A16
CImageLib::ConvComp<8, 16, false>, // LSI_PP_R
CImageLib::ConvComp<8, 16, false>, // LSI_PP_G
CImageLib::ConvComp<8, 16, false>, // LSI_PP_B
CImageLib::ConvComp<0, 16, true>, // LSI_PP_A
},
},
{ // LSI_PF_R8G8B8A8
{ // LSI_PF_R8G8B8A8 -> LSI_PF_A8
CImageLib::ConvComp<8, 0, false>, // LSI_PP_R
CImageLib::ConvComp<8, 0, false>, // LSI_PP_G
CImageLib::ConvComp<8, 0, false>, // LSI_PP_B
CImageLib::ConvComp<8, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8A8 -> LSI_PF_R3G3B2
CImageLib::ConvComp<8, 3, false>, // LSI_PP_R
CImageLib::ConvComp<8, 3, false>, // LSI_PP_G
CImageLib::ConvComp<8, 2, false>, // LSI_PP_B
CImageLib::ConvComp<8, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8A8 -> LSI_PF_R5G6B5
CImageLib::ConvComp<8, 5, false>, // LSI_PP_R
CImageLib::ConvComp<8, 6, false>, // LSI_PP_G
CImageLib::ConvComp<8, 5, false>, // LSI_PP_B
CImageLib::ConvComp<8, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8A8 -> LSI_PF_R4G4B4A4
CImageLib::ConvComp<8, 4, false>, // LSI_PP_R
CImageLib::ConvComp<8, 4, false>, // LSI_PP_G
CImageLib::ConvComp<8, 4, false>, // LSI_PP_B
CImageLib::ConvComp<8, 4, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8A8 -> LSI_PF_R5G5B5A1
CImageLib::ConvComp<8, 5, false>, // LSI_PP_R
CImageLib::ConvComp<8, 5, false>, // LSI_PP_G
CImageLib::ConvComp<8, 5, false>, // LSI_PP_B
CImageLib::ConvComp<8, 1, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8A8 -> LSI_PF_R8G8B8
CImageLib::ConvComp<8, 8, false>, // LSI_PP_R
CImageLib::ConvComp<8, 8, false>, // LSI_PP_G
CImageLib::ConvComp<8, 8, false>, // LSI_PP_B
CImageLib::ConvComp<8, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8A8 -> LSI_PF_R8G8B8A8
CImageLib::ConvComp<8, 8, false>, // LSI_PP_R
CImageLib::ConvComp<8, 8, false>, // LSI_PP_G
CImageLib::ConvComp<8, 8, false>, // LSI_PP_B
CImageLib::ConvComp<8, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R8G8B8A8 -> LSI_PF_R16G16B16A16
CImageLib::ConvComp<8, 16, false>, // LSI_PP_R
CImageLib::ConvComp<8, 16, false>, // LSI_PP_G
CImageLib::ConvComp<8, 16, false>, // LSI_PP_B
CImageLib::ConvComp<8, 16, true>, // LSI_PP_A
},
},
{ // LSI_PF_R16G16B16A16
{ // LSI_PF_R16G16B16A16 -> LSI_PF_A8
CImageLib::ConvComp<16, 0, false>, // LSI_PP_R
CImageLib::ConvComp<16, 0, false>, // LSI_PP_G
CImageLib::ConvComp<16, 0, false>, // LSI_PP_B
CImageLib::ConvComp<16, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R16G16B16A16 -> LSI_PF_R3G3B2
CImageLib::ConvComp<16, 3, false>, // LSI_PP_R
CImageLib::ConvComp<16, 3, false>, // LSI_PP_G
CImageLib::ConvComp<16, 2, false>, // LSI_PP_B
CImageLib::ConvComp<16, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R16G16B16A16 -> LSI_PF_R5G6B5
CImageLib::ConvComp<16, 5, false>, // LSI_PP_R
CImageLib::ConvComp<16, 6, false>, // LSI_PP_G
CImageLib::ConvComp<16, 5, false>, // LSI_PP_B
CImageLib::ConvComp<16, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R16G16B16A16 -> LSI_PF_R4G4B4A4
CImageLib::ConvComp<16, 4, false>, // LSI_PP_R
CImageLib::ConvComp<16, 4, false>, // LSI_PP_G
CImageLib::ConvComp<16, 4, false>, // LSI_PP_B
CImageLib::ConvComp<16, 4, true>, // LSI_PP_A
},
{ // LSI_PF_R16G16B16A16 -> LSI_PF_R5G5B5A1
CImageLib::ConvComp<16, 5, false>, // LSI_PP_R
CImageLib::ConvComp<16, 5, false>, // LSI_PP_G
CImageLib::ConvComp<16, 5, false>, // LSI_PP_B
CImageLib::ConvComp<16, 1, true>, // LSI_PP_A
},
{ // LSI_PF_R16G16B16A16 -> LSI_PF_R8G8B8
CImageLib::ConvComp<16, 8, false>, // LSI_PP_R
CImageLib::ConvComp<16, 8, false>, // LSI_PP_G
CImageLib::ConvComp<16, 8, false>, // LSI_PP_B
CImageLib::ConvComp<16, 0, true>, // LSI_PP_A
},
{ // LSI_PF_R16G16B16A16 -> LSI_PF_R8G8B8A8
CImageLib::ConvComp<16, 8, false>, // LSI_PP_R
CImageLib::ConvComp<16, 8, false>, // LSI_PP_G
CImageLib::ConvComp<16, 8, false>, // LSI_PP_B
CImageLib::ConvComp<16, 8, true>, // LSI_PP_A
},
{ // LSI_PF_R16G16B16A16 -> LSI_PF_R16G16B16A16
CImageLib::ConvComp<16, 16, false>, // LSI_PP_R
CImageLib::ConvComp<16, 16, false>, // LSI_PP_G
CImageLib::ConvComp<16, 16, false>, // LSI_PP_B
CImageLib::ConvComp<16, 16, true>, // LSI_PP_A
},
},
};
return pfTable[_pfSrcFormat][_pfDstFormat][_ppComp]( _ui32Component );
}
It has an expression evaluator to allow me to type complex C expressions and see their results, such as:
Expression: 1000 / 24.94651031 - 1000 / 37.14330261230
Result: 13.163013
Expression: ((5600000000) + (((1024 * 4) - (5600000000) & ((1024 * 4) - 1)) & ((1024 * 4) - 1)))
Result: 5600002048 (14DC94000)
It has a useful data converter (here are all the values for 2047.999f reinterpreted as different types):
[attachment=22467:Converter.png]
Mainly, its scripts are useful for anything of which you can think. You can write any type of script you want (the script language is L. Spiro C) to generate any type of data you want or to perform find/replace operations (useful for porting), run simulations and check results, etc.
For example, in a physics simulation, which update code is correct?
void Update( float _fDelta ) {
m_fVel += m_fAcceleration * _fDelta;
m_fPos += m_fVel * fDelta.
}
/* OR */
void Update( float _fDelta ) {
m_fPos += m_fVel * fDelta.
m_fVel += m_fAcceleration * _fDelta;
}
An MHS script to simulate both and compare against ½gt² (simulation starting from P and V = 0) reveals the correct answer.
It is a good way in general to test any type of algorithm you have in your mind and overall a tool without which programming is both a pain and inefficient. The reason my code is so consistent (spacing, style, comments, etc.) is because MHS is writing half of my code for me.
L. Spiro