AKTIVE

split.tcl at trunk
Login

split.tcl at trunk

File etc/transformer/structure/split.tcl artifact f680569b97 on branch trunk


     1
     2
     3
     4
     5
     6
     7
     8
     9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
## -*- mode: tcl ; fill-column: 90 -*-
# # ## ### ##### ######## ############# #####################
## Transformers -- Structural changes (data re-arrangements)

# # ## ### ##### ######## ############# #####################
## Highlevel operations implemented on top of the C core
#
## - Split into rows, columns, or bands

operator {coordinate dimension thing} {
    op::split::x  x width  column
    op::split::y  y height row
    op::split::z  z depth  band
} {
    section transform structure

    note Returns list containing each $thing of the input as separate image.

    input

    body {
	set end [aktive query @@dimension@@ $src]
	set r {}
	for {set k 0} {$k < $end} {incr k} {
	    lappend r [aktive op select @@coordinate@@ $src from $k]
	}
	return $r
    }
}

##
# # ## ### ##### ######## ############# #####################
::return