Function libvnc_sys::rfb::rfbGetClient
source · pub unsafe extern "C" fn rfbGetClient(
bitsPerSample: c_int,
samplesPerPixel: c_int,
bytesPerPixel: c_int
) -> *mut rfbClientExpand description
Allocates and returns a pointer to an rfbClient structure. This will probably be the first LibVNCClient function your client code calls. Most libVNCClient functions operate on an rfbClient structure, and this function allocates memory for that structure. When you’re done with the rfbClient structure pointer this function returns, you should free the memory rfbGetClient() allocated by calling rfbClientCleanup().
A pixel is one dot on the screen. The number of bytes in a pixel will depend on the number of samples in that pixel and the number of bits in each sample. A sample represents one of the primary colors in a color model. The RGB color model uses red, green, and blue samples respectively. Suppose you wanted to use 16-bit RGB color: You would have three samples per pixel (one for each primary color), five bits per sample (the quotient of 16 RGB bits divided by three samples), and two bytes per pixel (the smallest multiple of eight bits in which the 16-bit pixel will fit). If you wanted 32-bit RGB color, you would have three samples per pixel again, eight bits per sample (since that’s how 32-bit color is defined), and four bytes per pixel (the smallest multiple of eight bits in which the 32-bit pixel will fit. @param bitsPerSample The number of bits in a sample @param samplesPerPixel The number of samples in a pixel @param bytesPerPixel The number of bytes in a pixel @return a pointer to the allocated rfbClient structure