utDataOp

binary operation between untyped buffers

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

Parameters

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 assert( eq( 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