func NewList2DFrom2DSlice[T any](src [][]T) *List2D[T] {
	if len(src) < 1 {
		return NewList2D[T](0, 0)
	}
	h := len(src)
	if len(src[0]) < 1 {
		return NewList2D[T](0, h)
	}
	w := len(src[0])
	l := NewList2D[T](w, h)
	for y := range src {
		copy(l.data[y*w:], src[y][:w])
	}
	return l
}
// NewList2DFrom2DSlice creates a new list from a [y][x] slice.
NewList2DFrom2DSlice creates a new list from a [y][x] slice.
// NewList2DFrom2DSlice creates a new list from a [ y ] [ x ] slice .
func NewList2DFrom2DSlice[T any](src [][]T) *List2D[T] {
	if len(src) < 1 {
		return NewList2D[T](0, 0)
	}
	h := len(src)
	if len(src[0]) < 1 {
		return NewList2D[T](0, h)
	}
	w := len(src[0])
	l := NewList2D[T](w, h)
	for y := range src {
		copy(l.data[y*w:], src[y][:w])
	}
	return l
}
func NewList2DFrom2DSlice [ T any ] ( src [ ] [ ] T ) * List2D [ T ] { if len ( src ) < 1 { return NewList2D [ T ] ( 0 , 0 ) } h := len ( src ) if len ( src [ 0 ] ) < 1 { return NewList2D [ T ] ( 0 , h ) } w := len ( src [ 0 ] ) l := NewList2D [ T ] ( w , h ) for y := range src { copy ( l . data [ y * w : ] , src [ y ] [ : w ] ) } return l }
NewList2DFrom2DSlice creates a new list from a [y][x] slice.
NewList2DFrom2DSlice creates a new list from a [ y ] [ x ] slice .