Inexor
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Macros
macros.hpp File Reference

Go to the source code of this file.

Macros

#define writetex(t, body)
 
#define readwritetex(t, s, body)
 
#define read2writetex(t, s1, src1, s2, src2, body)
 
#define readwritergbtex(t, s, body)
 
#define readwritergbatex(t, s, body)
 

Macro Definition Documentation

#define read2writetex (   t,
  s1,
  src1,
  s2,
  src2,
  body 
)
Value:
{ \
uchar *dstrow = t.data, *src1row = s1.data, *src2row = s2.data; \
loop(y, t.h) \
{ \
for(uchar *dst = dstrow, *end = &dstrow[t.w*t.bpp], *src1 = src1row, *src2 = src2row; dst < end; dst += t.bpp, src1 += s1.bpp, src2 += s2.bpp) \
{ \
body; \
} \
dstrow += t.pitch; \
src1row += s1.pitch; \
src2row += s2.pitch; \
} \
}
#define loop(v, m)
Legacy file defining loops.
Definition: cube_loops.hpp:7
void t(T x, const char *cmp)
Definition: utilTest.cpp:52
unsigned char uchar
Basic type definitions.
Definition: cube_types.hpp:7
int end()
Definition: glemu.cpp:256

Referenced by mergenormalmaps().

#define readwritergbatex (   t,
  s,
  body 
)
Value:
{ \
if(t.bpp >= 4) { readwritetex(t, s, body); } \
else \
{ \
ImageData rgba(t.w, t.h, 4); \
read2writetex(rgba, t, orig, s, src, \
{ \
switch(t.bpp) \
{ \
case 1: dst[0] = orig[0]; dst[1] = orig[0]; dst[2] = orig[0]; break; \
case 2: dst[0] = orig[0]; dst[1] = orig[1]; dst[2] = orig[1]; break; \
case 3: dst[0] = orig[0]; dst[1] = orig[1]; dst[2] = orig[2]; break; \
} \
body; \
}); \
t.replace(rgba); \
} \
}
#define readwritetex(t, s, body)
Definition: macros.hpp:15
#define read2writetex(t, s1, src1, s2, src2, body)
Definition: macros.hpp:29
if(NOT DEFINED PROJECT_ARCH) message(FATAL_ERROR"You are generating from the wrong folder! \"Where is the Source
Definition: CMakeLists.txt:2
void t(T x, const char *cmp)
Definition: utilTest.cpp:52

Referenced by mergedepth(), and mergespec().

#define readwritergbtex (   t,
  s,
  body 
)
Value:
{ \
if(t.bpp >= 3) { readwritetex(t, s, body); } \
else \
{ \
ImageData rgb(t.w, t.h, 3); \
read2writetex(rgb, t, orig, s, src, \
{ \
switch(t.bpp) \
{ \
case 1: dst[0] = orig[0]; dst[1] = orig[0]; dst[2] = orig[0]; break; \
case 2: dst[0] = orig[0]; dst[1] = orig[1]; dst[2] = orig[1]; break; \
} \
body; \
}); \
t.replace(rgb); \
} \
}
#define readwritetex(t, s, body)
Definition: macros.hpp:15
#define read2writetex(t, s1, src1, s2, src2, body)
Definition: macros.hpp:29
if(NOT DEFINED PROJECT_ARCH) message(FATAL_ERROR"You are generating from the wrong folder! \"Where is the Source
Definition: CMakeLists.txt:2
void t(T x, const char *cmp)
Definition: utilTest.cpp:52

Referenced by addglow().

#define readwritetex (   t,
  s,
  body 
)
Value:
{ \
uchar *dstrow = t.data, *srcrow = s.data; \
loop(y, t.h) \
{ \
for(uchar *dst = dstrow, *src = srcrow, *end = &srcrow[s.w*s.bpp]; src < end; dst += t.bpp, src += s.bpp) \
{ \
body; \
} \
dstrow += t.pitch; \
srcrow += s.pitch; \
} \
}
#define loop(v, m)
Legacy file defining loops.
Definition: cube_loops.hpp:7
void t(T x, const char *cmp)
Definition: utilTest.cpp:52
unsigned char uchar
Basic type definitions.
Definition: cube_types.hpp:7
int end()
Definition: glemu.cpp:256

Referenced by flipnormalmapy(), forcergbimage(), texcolormask(), texgrey(), and texmix().

#define writetex (   t,
  body 
)
Value:
{ \
uchar *dstrow = t.data; \
loop(y, t.h) \
{ \
for(uchar *dst = dstrow, *end = &dstrow[t.w*t.bpp]; dst < end; dst += t.bpp) \
{ \
body; \
} \
dstrow += t.pitch; \
} \
}
#define loop(v, m)
Legacy file defining loops.
Definition: cube_loops.hpp:7
void t(T x, const char *cmp)
Definition: utilTest.cpp:52
unsigned char uchar
Basic type definitions.
Definition: cube_types.hpp:7
int end()
Definition: glemu.cpp:256

Referenced by texcolorify(), texdup(), texmad(), and texpremul().