| | |
| | | return nil, errors.New("create C images error") |
| | | } |
| | | defer C.free(cImgs) |
| | | for k, v := range imgs { |
| | | var ret C.int |
| | | for _, v := range imgs { |
| | | if v == nil { |
| | | ret = C.fill_images(cImgs, C.int(h.batchSize), C.int(k), nil, 0, 0, 0) |
| | | C.fill_images(cImgs, C.int(h.batchSize), C.int(k), nil, 0, 0, 0) |
| | | } else { |
| | | ret = C.fill_images(cImgs, C.int(h.batchSize), C.int(k), unsafe.Pointer(&v.Data[0]), C.int(v.Width), C.int(v.Height), C.int(v.Channel)) |
| | | C.fill_images(cImgs, C.int(h.batchSize), C.int(k), unsafe.Pointer(&v.Data[0]), C.int(v.Width), C.int(v.Height), C.int(v.Channel)) |
| | | } |
| | | |
| | | } |