imCopy

  1. void imCopy(ref Image dst, in Vector!(A, T) paste_pos, in Image src, in Region!(B, E) copy_reg, ImRepack repack = ImRepack.NONE, size_t[2] repack_dim = [0, 1])
  2. void imCopy(ref Image dst, in Vector!(A, T) paste_pos, in Image src, ImRepack repack = ImRepack.NONE, size_t[2] repack_dim = [0, 1])
    void
    imCopy
    (
    string file = __FILE__
    size_t line = __LINE__
    size_t A
    T
    )
    (
    ,
    in Vector!(A, T) paste_pos
    ,,,
    size_t[2] repack_dim = [0, 1]
    )
    if (
    isIntegral!T
    )

Examples

1 auto etype = ElemInfo( 1, DataType.INT );
2 auto dst = Image( ivec2(4,4), etype );
3 auto src = Image( ivec2(3,2), etype, [ 1,2,4, 5,6,8 ] );
4 
5 imCopy( dst, ivec2(-1,-1), src, ImRepack.ROT90 );
6 assertEq( dst.mapAs!int, [ 6,0,0,0,
7                            5,0,0,0,
8                            0,0,0,0,
9                            0,0,0,0 ] );
10 imCopy( dst, ivec2(2,1), src, ImRepack.ROT180 );
11 assertEq( dst.mapAs!int, [ 6,0,0,0,
12                            5,0,8,6,
13                            0,0,4,2,
14                            0,0,0,0 ] );
15 imCopy( dst, ivec2(-1,3), src, ImRepack.MIRVER );
16 assertEq( dst.mapAs!int, [ 6,0,0,0,
17                            5,0,8,6,
18                            0,0,4,2,
19                            6,8,0,0 ] );
1 auto etype = ElemInfo( 1, DataType.INT );
2 auto dst = Image( ivec2(2,2), etype );
3 auto src = Image( ivec2(3,3), etype, [ 1,2,4, 5,6,8, 9,7,3 ] );
4 
5 imCopy( dst, ivec2(-1,-1), src, CrdRegionD(0,0,3,3) );
6 assertEq( dst.mapAs!int, [ 6,8,
7                            7,3 ] );
1 auto etype = ElemInfo( 1, DataType.INT );
2 auto dst = Image( ivec3(2,2,2), etype );
3 auto src = Image( ivec!1(2), etype, [ 1,2 ] );
4 
5 imCopy( dst, ivec3(0,0,0), src, ImRepack.NONE );
6 assertEq( dst.mapAs!int, [1,2, 0,0,  0,0, 0,0] );
7 
8 imCopy( dst, ivec3(0,0,0), src, ImRepack.ROT270 );
9 assertEq( dst.mapAs!int, [1,2, 2,0,  0,0, 0,0] );
10 
11 dst.clear();
12 imCopy( dst, ivec3(0,0,0), src, ImRepack.ROT90, [0,2] );
13 assertEq( dst.mapAs!int, [2,0, 0,0,  1,0, 0,0] );

Meta