Documentation ¶
Overview ¶
Package nvutil are functions that use the other nvidia packages and allows them to be used with each other
Index ¶
- func BatchTileSet(hlprs []*TileHelper, imgs []*jpeg.Image, tilesize npp.Size) (err error)
- func BatchTileTotalElements(helpers []*TileHelper) int32
- func BatchTiles(h *Handle, hlprs []*TileHelper, dest *npp.Uint8, s gocu.Streamer) error
- func Convert(src, dest tensor.Volume, copier MemCopier, streamctx *npp.StreamContext) error
- func FindDims(helpers []*TileHelper) []int32
- func ImageToNppi(img *jpeg.Image) (planar []*npp.Uint8, size npp.Size)
- type BatchBuffer
- func (b *BatchBuffer) FillTensor(h *Handle, t *tensor.Volume) error
- func (b *BatchBuffer) GetProperties() (dims []int32, nchw bool)
- func (b *BatchBuffer) LoadImages(h *Handle, imgs []*jpeg.Image, srcROIs, destROIs []npp.Rect) (err error)
- func (b *BatchBuffer) Mirror(h *Handle, batches []int32, onaxis []npp.Axis) (err error)
- type Handle
- type MemCopier
- type TileHelper
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BatchTileSet ¶
BatchTileSet sets a batch of helpers with a batch of imgs
func BatchTileTotalElements ¶
func BatchTileTotalElements(helpers []*TileHelper) int32
BatchTileTotalElements returns the number of elements that make up the tiled images
func BatchTiles ¶
func Convert ¶
Convert will convert the data of A to the datatype of B and put it into B. A datatype == B datatype memory will be copied from A to B
func FindDims ¶
func FindDims(helpers []*TileHelper) []int32
FindDims will find dims for a tensor. Will return nil if it can't be made. IE the dims of each helper isn't the same
Types ¶
type BatchBuffer ¶
type BatchBuffer struct {
// contains filtered or unexported fields
}
func CreateBatchBuffer ¶
func CreateBatchBuffer(dims []int32, averagepixel float32) *BatchBuffer
CreateBatchBuffer is NCHW. And works for stand alone images
func (*BatchBuffer) FillTensor ¶
func (b *BatchBuffer) FillTensor(h *Handle, t *tensor.Volume) error
func (*BatchBuffer) GetProperties ¶
func (b *BatchBuffer) GetProperties() (dims []int32, nchw bool)
func (*BatchBuffer) LoadImages ¶
func (b *BatchBuffer) LoadImages(h *Handle, imgs []*jpeg.Image, srcROIs, destROIs []npp.Rect) (err error)
LoadImages will take the images and resize them considering the srcROIs,and destROIs to the buffer.
if srcROIS and/or destROIs are nil, then it will make the ROIs that are null the size of the src and dest space.
if src or dest is not nil. Then the length needs to be the same as imgs.
type Handle ¶
type Handle struct {
// contains filtered or unexported fields
}
func CreateHandle ¶
func CreateHandle(ctx *npp.StreamContext, polation npp.InterpolationMode) *Handle
type TileHelper ¶
type TileHelper struct {
// contains filtered or unexported fields
}
TileHelper will help tile an image
func CreateTileHelpers ¶
func CreateTileHelpers(num int) []*TileHelper
CreateTileHelpers creates some tilehelpers
func (*TileHelper) GetDestNumOfElements ¶
func (t *TileHelper) GetDestNumOfElements() (n int32)
GetDestNumOfElements returns the number of elements the dest location will need