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.
()
| 285 | // one Pixel (in Host memory at least). TODO only works |
| 286 | // for known formats -- need to add more as needed. |
| 287 | func (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 |
no test coverage detected