MCPcopy Create free account
hub / github.com/cogentcore/core / SetGoImage

Method SetGoImage

vgpu/vals.go:467–476  ·  view source on GitHub ↗

SetGoImage calls SetGoImage on the proper Texture value for given index. if TexSzAlloc.On via AllocTexBySize then this is routed to the actual allocated image array, otherwise it goes directly to the standard Value. SetGoImage sets staging image data from a standard Go image at given layer. This is

(idx int, img image.Image, flipy bool)

Source from the content-addressed store, hash-verified

465// Must still call AllocImage to have image allocated on the device,
466// and copy from this host staging data to the device.
467func (vs *Values) SetGoImage(idx int, img image.Image, flipy bool) {
468 if !vs.TexSzAlloc.On || vs.GpTexValues == nil {
469 vl := vs.Values[idx]
470 vl.SetGoImage(img, 0, flipy)
471 return
472 }
473 idxs := vs.TexSzAlloc.ItemIndexes[idx]
474 vl := vs.GpTexValues[idxs.GpIndex]
475 vl.SetGoImage(img, idxs.ItemIndex, flipy)
476}
477
478////////////////////////////////////////////////////////////////
479// Texture val functions

Callers

nothing calls this directly

Calls 1

SetGoImageMethod · 0.65

Tested by

no test coverage detected