utDataOp

binary operation between untyped buffers

logicaly equals opAssign ( a op= b )

void
utDataOp
pure
(
string op
)
(
,
void* dst
,
void* utb
)
if (
(
op == "+" ||
op == "-"
||
op == "*"
||
op == "/"
)
)
in { assert (dst !is null); assert (utb !is null); }

Parameters

elem
Type: ElemInfo

common to all buffers information

dst
Type: void*

result buffer ptr

utb
Type: void*

buffer ptr B

Examples

1 ubyte[] a = [ 10, 20, 30, 40 ];
2 ubyte[] b = [ 60, 70, 40, 20 ];
3 
4 utDataOp!"+"( ElemInfo( 4, DataType.UNORM_QUART ), a.ptr, b.ptr );
5 
6 assertEq( a, [70,90,70,60] );
7 
8 utDataOp!"+"( ElemInfo( 2, DataType.UBYTE ), a.ptr, a.ptr + 2 );
9 
10 assert( eq( a, [140,150,70,60] ) );

Meta