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

Method ConfigGoImage

vgpu/image.go:503–512  ·  view source on GitHub ↗

ConfigGoImage configures the image for storing an image of the given size, for images allocated in a shared host buffer. (i.e., not Var.TextureOwns). Image format will be set to default unless format is already set. Layers is number of separate images of given size allocated in a texture array. On

(sz image.Point, layers int)

Source from the content-addressed store, hash-verified

501// Once memory is allocated then SetGoImage can be called in a
502// second pass.
503func (im *Image) ConfigGoImage(sz image.Point, layers int) {
504 if im.Format.Format != vk.FormatR8g8b8a8Srgb {
505 im.Format.Defaults()
506 }
507 im.Format.Size = sz
508 if layers <= 0 {
509 layers = 1
510 }
511 im.Format.Layers = layers
512}
513
514const (
515 // FlipY used as named arg for flipping the Y axis of images, etc

Callers 5

SetGoImageMethod · 0.80
AllocTexBySizeMethod · 0.80
configDummyTextureMethod · 0.80
ConfigTexturesMethod · 0.80
mainFunction · 0.80

Calls 1

DefaultsMethod · 0.65

Tested by

no test coverage detected