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

Method BytesPerPixel

vgpu/image.go:287–294  ·  view source on GitHub ↗

BytesPerPixel returns number of bytes required to represent one Pixel (in Host memory at least). TODO only works for known formats -- need to add more as needed.

()

Source from the content-addressed store, hash-verified

285// one Pixel (in Host memory at least). TODO only works
286// for known formats -- need to add more as needed.
287func (im *ImageFormat) BytesPerPixel() int {
288 bpp := FormatSizes[im.Format]
289 if bpp > 0 {
290 return bpp
291 }
292 log.Println("vgpu.ImageFormat:BytesPerPixel() -- format not yet supported!")
293 return 0
294}
295
296// LayerByteSize returns number of bytes required to represent one layer of
297// image in Host memory. TODO only works

Callers 2

LayerByteSizeMethod · 0.95
StrideMethod · 0.95

Calls 1

PrintlnMethod · 0.80

Tested by

no test coverage detected