python_vali.Surface¶
- class python_vali.Surface¶
Image stored in vRAM. Consists of 1+ SurfacePlane(s).
- __init__(*args, **kwargs)¶
Methods
Clone
(self)CUDA mem alloc + deep copy.
Make
(*args, **kwargs)Overloaded function.
__init__
(*args, **kwargs)from_cai
(dict, format)DLPack: Make Surface from CAI, don not own memory.
from_dlpack
(capsule, format)DLPack: Make Surface from dlpack, don not own memory.
Attributes
Get pixel format
Height in pixels of plane 0.
Amount of memory in bytes which is needed for DtoH memcopy.
Tell if Surface plane has memory allocated or it's empty inside.
Return True if Surface owns memory, False if it only references actual memory allocation but doesn't own it.
Number of SurfacePlanes
Pitch in bytes of plane 0.
Get SurfacePlane reference
Width in pixels of plane 0.
- Clone(self: python_vali._python_vali.Surface) python_vali._python_vali.Surface ¶
CUDA mem alloc + deep copy. Object returned is manager by Python interpreter.
- property Format¶
Get pixel format
- property Height¶
Height in pixels of plane 0.
- property HostSize¶
Amount of memory in bytes which is needed for DtoH memcopy.
- property IsEmpty¶
Tell if Surface plane has memory allocated or it’s empty inside.
- property IsOwnMemory¶
Return True if Surface owns memory, False if it only references actual memory allocation but doesn’t own it.
- static Make(*args, **kwargs)¶
Overloaded function.
Make(format: python_vali._python_vali.PixelFormat, width: int, height: int, gpu_id: int) -> python_vali._python_vali.Surface
Constructor method.
- param format:
target pixel format
- param width:
width in pixels
- param height:
height in pixels
- param gpu_id:
GPU to use
Make(format: python_vali._python_vali.PixelFormat, width: int, height: int, context: int) -> python_vali._python_vali.Surface
Constructor method.
- param format:
target pixel format
- param width:
width in pixels
- param height:
height in pixels
- param context:
CUDA contet to use
- property NumPlanes¶
Number of SurfacePlanes
- property Pitch¶
Pitch in bytes of plane 0.
- property Planes¶
Get SurfacePlane reference
- Parameters:
plane – SurfacePlane index
- property Width¶
Width in pixels of plane 0.
- static from_cai(dict: object, format: python_vali._python_vali.PixelFormat = <PixelFormat.RGB: 2>) python_vali._python_vali.Surface ¶
DLPack: Make Surface from CAI, don not own memory.
- Parameters:
dict – dictionary which corresponds to CUDA Array Interface specs.
fmt – pixel format, by default python_vali.PixelFormat.RGB
- Returns:
Surface
- Return type:
- static from_dlpack(capsule: capsule, format: python_vali._python_vali.PixelFormat = <PixelFormat.RGB: 2>) python_vali._python_vali.Surface ¶
DLPack: Make Surface from dlpack, don not own memory.
- Parameters:
capsule – capsule object with manager dltensor inside
fmt – pixel format, by default python_vali.PixelFormat.RGB
- Returns:
Surface
- Return type: