CamCap  v0.0.1-2786
C++ camera capture library and tool
CC Namespace Reference

Namespace for CamCap. More...

Classes

struct  BufferDetail
 Structure used to keep some information on the memory mapped buffers, and the corresponding mmap() address. More...
 
struct  CaptureAndBuffer
 Structure used when capturing multiple images. More...
 
class  Device
 Class to represent a single camera device. More...
 
struct  Dimension
 

Typedefs

typedef std::map< uint32_t, std::string > MU32Str
 Map a numerical ID to a text string. More...
 
typedef std::map< uint32_t, v4l2_input > MInputs
 Map of indexes to inputs. More...
 
typedef std::map< uint32_t, v4l2_fmtdesc > MFormats
 Map of image formats. More...
 
typedef std::vector< uint8_t > Bytes
 Vector of bytes, used as a data buffer. For example, to return the bytes read from the camera. More...
 
typedef std::vector< v4l2_queryctrl > VCtrls
 Vector of controls. More...
 
typedef std::map< uint32_t, BufferDetailMIdxBufferDetail
 Map of buffer indexes to BufferDetail structures. More...
 
typedef std::vector< CaptureAndBufferImages
 Vector of structures used when capturing multiple images. More...
 
typedef std::vector< std::string > VStr
 Vector of strings. More...
 
typedef std::set< DimensionDimensions
 A sorted set of dimensions. More...
 

Enumerations

enum  ETransferMethod {
  ETransferMethod::kRead,
  ETransferMethod::kMmap
}
 Different transfer methods. More...
 

Functions

std::string fourcc_to_string (uint32_t fcc)
 Simple function to convert a FourCC value to a text string. More...
 
uint32_t gcd (uint32_t u, uint32_t v)
 Find the greatest common denominator. More...
 
std::string get_version (void)
 Obtain the CamCap version number. More...
 

Detailed Description

Namespace for CamCap.

See also
CC::Device

Typedef Documentation

◆ MU32Str

typedef std::map<uint32_t, std::string> CC::MU32Str

Map a numerical ID to a text string.

◆ MInputs

◆ MFormats

◆ Bytes

typedef std::vector<uint8_t> CC::Bytes

Vector of bytes, used as a data buffer. For example, to return the bytes read from the camera.

◆ VCtrls

typedef std::vector<v4l2_queryctrl> CC::VCtrls

Vector of controls.

◆ MIdxBufferDetail

typedef std::map< uint32_t, BufferDetail > CC::MIdxBufferDetail

Map of buffer indexes to BufferDetail structures.

See also
CC::Device::buffer_details

◆ Images

typedef std::vector<CaptureAndBuffer> CC::Images

Vector of structures used when capturing multiple images.

See also
CC::Device::capture_many()

◆ VStr

typedef std::vector<std::string> CC::VStr

Vector of strings.

◆ Dimensions

typedef std::set<Dimension> CC::Dimensions

A sorted set of dimensions.

Enumeration Type Documentation

◆ ETransferMethod

enum CC::ETransferMethod
strong

Different transfer methods.

See also
CC::Device::set_transfer_method()
Enumerator
kRead 

Use the read() method to transfer images.

See also
https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/rw.html
kMmap 

Use the mmap() method to transfer images.

See also
https://linuxtv.org/downloads/v4l-dvb-apis/uapi/v4l/mmap.html

Function Documentation

◆ fourcc_to_string()

std::string CC::fourcc_to_string ( uint32_t  fcc)

Simple function to convert a FourCC value to a text string.

For example:

CC::Device camera_device;
camera_device.initialize();
v4l2_format format = camera_device.get_format();
std::cout << "current image format is " << CC::fourcc_to_string(format.fmt.pix.pixelformat) << std::endl;
See also
https://www.fourcc.org/

Referenced by CC::Device::describe(), and main().

Here is the caller graph for this function:

◆ gcd()

uint32_t CC::gcd ( uint32_t  u,
uint32_t  v 
)

Find the greatest common denominator.

Used to calculate the image aspect ratio.

For example:

uint32_t w = 640;
uint32_t h = 480;
uint32_t d = gcd(640, 480);
std::cout << "aspect ratio is " << (w/d) << ":" << (h/d) << std::endl;
See also
https://en.wikipedia.org/wiki/Binary_GCD_algorithm

Referenced by CC::Device::describe().

Here is the caller graph for this function:

◆ get_version()

std::string CC::get_version ( void  )

Obtain the CamCap version number.

For example:

std::cout << "CamCap library version " << CC::get_version() << std::endl;

Referenced by CC::Device::describe(), and main().

Here is the caller graph for this function: