im.capture

\file \brief Video Capture

See Copyright Notice in im_lib.d

Members

Aliases

imVideoCapture
alias imVideoCapture = _imVideoCapture
Undocumented in source but is binding to C. You might be able to learn more by searching the web for its name.

Functions

imVideoCaptureConnect
int imVideoCaptureConnect(imVideoCapture* vc, int device)

Connects to a capture device. * More than one imVideoCapture object can be created * but they must be connected to different devices. \n * If the object is conected it will disconnect first. \n * Use -1 to return the current connected device, * in this case returns -1 if not connected. \n * Returns zero if failed. * * \verbatim vc:Connect([device: number]) -> ret: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureCreate
imVideoCapture* imVideoCaptureCreate()

Creates a new imVideoCapture object. \n * Returns NULL if there is no capture device available. \n * In Windows returns NULL if DirectX version is older than 8. \n * In Lua the IM videocapture metatable name is "imVideoCapture". * When converted to a string will return "imVideoCapture(%p)" where %p is replaced by the userdata address. * If the videocapture is already destroyed by im.VideoCaptureDestroy, then it will return also the suffix "-destroyed". * * \verbatim im.VideoCaptureCreate() -> vc: imVideoCapture [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDestroy
void imVideoCaptureDestroy(imVideoCapture* vc)

Destroys a imVideoCapture object. \n * In Lua if this function is not called, the videocapture is destroyed by the garbage collector. * * \verbatim im.VideoCaptureDestroy(vc: imVideoCapture) [in Lua 5] \endverbatim * \verbatim vc:Destroy() [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDeviceCount
int imVideoCaptureDeviceCount()

Returns the number of available devices. * * \verbatim im.VideoCaptureDeviceCount() -> count: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDeviceDesc
const(char)* imVideoCaptureDeviceDesc(int device)

Returns the device description. Returns NULL only if it is an invalid device. * * \verbatim im.VideoCaptureDeviceDesc(device: number) -> desc: string [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDeviceExDesc
const(char)* imVideoCaptureDeviceExDesc(int device)

Returns the extendend device description. May return NULL. * * \verbatim im.VideoCaptureDeviceExDesc(device: number) -> desc: string [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDevicePath
const(char)* imVideoCaptureDevicePath(int device)

Returns the device path configuration. This is a unique string. * * \verbatim im.VideoCaptureDevicePath(device: number) -> desc: string [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDeviceVendorInfo
const(char)* imVideoCaptureDeviceVendorInfo(int device)

Returns the vendor information. May return NULL. * * \verbatim im.VideoCaptureDeviceVendorInfo(device: number) -> desc: string [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDialogCount
int imVideoCaptureDialogCount(imVideoCapture* vc)

Returns the number of available configuration dialogs. * * \verbatim vc:DialogCount() -> count: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDialogDesc
const(char)* imVideoCaptureDialogDesc(imVideoCapture* vc, int dialog)

Returns the description of a configuration dialog. * dialog can be from 0 to \ref imVideoCaptureDialogCount. \n * * \verbatim vc:DialogDesc(dialog: number) -> desc: string [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureDisconnect
void imVideoCaptureDisconnect(imVideoCapture* vc)

Disconnect from a capture device. * * \verbatim vc:Disconnect() [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureFormatCount
int imVideoCaptureFormatCount(imVideoCapture* vc)

Returns the number of available video formats. \n * Returns zero if failed. * * \verbatim vc:FormatCount() -> count: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureFrame
int imVideoCaptureFrame(imVideoCapture* vc, ubyte* data, int color_mode, int timeout)

Returns a new captured frame. Use -1 for infinite timeout. \n * Color space can be IM_RGB or IM_GRAY, and mode can be packed (IM_PACKED) or not. \n * Data type is always IM_BYTE. \n * It can not have an alpha channel and orientation is always bottom up. \n * Returns zero if failed or timeout expired, the buffer is not changed. * * \verbatim vc:Frame(image: imImage, timeout: number) -> error: boolean [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureGetAttribute
int imVideoCaptureGetAttribute(imVideoCapture* vc, const(char)* attrib, float* percent)

Returns a camera or video attribute in percentage of the valid range value. \n * Returns zero if failed or attribute not supported. * * \verbatim vc:GetAttribute(attrib: string) -> error: boolean, percent: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureGetAttributeList
const(char)** imVideoCaptureGetAttributeList(imVideoCapture* vc, int* num_attrib)

Returns a list of the description of the valid attributes for the device class. \n * But each device may still not support some of the returned attributes. \n * Use the return value of \ref imVideoCaptureGetAttribute to check if the attribute is supported. * * \verbatim vc:GetAttributeList() -> attrib_list: table of strings [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureGetFormat
int imVideoCaptureGetFormat(imVideoCapture* vc, int format, int* width, int* height, char* desc)

Returns information about the video format. \n * format can be from 0 to \ref imVideoCaptureFormatCount. \n * desc should be of size 10. \n * The image size is usually the maximum size for that format. * Other sizes can be available using \ref imVideoCaptureSetImageSize. \n * Returns zero if failed. * * \verbatim vc:GetFormat(format: number) -> error: boolean, width: number, height: number, desc: string [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureGetImageSize
void imVideoCaptureGetImageSize(imVideoCapture* vc, int* width, int* height)

Returns the current image size of the connected device. \n * width and height returns 0 if not connected. * * \verbatim vc:GetImageSize() -> width: number, height: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureLive
int imVideoCaptureLive(imVideoCapture* vc, int live)

Start capturing. \n * Use -1 to return the current state. \n * Returns zero if failed. * * \verbatim vc:Live([live: number]) -> error: boolean | live: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureOneFrame
int imVideoCaptureOneFrame(imVideoCapture* vc, ubyte* data, int color_mode)

Start capturing, returns the new captured frame and stop capturing. \n * This is more usefull if you are switching between devices. \n * Data format is the same as imVideoCaptureFrame. \n * Returns zero if failed. * * \verbatim vc:OneFrame(image: imImage) -> error: boolean [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureReleaseDevices
void imVideoCaptureReleaseDevices()

Release the device list. Usefull is you need to track leak erros in your application. * * \verbatim im.imVideoCaptureReleaseDevices() [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureReloadDevices
int imVideoCaptureReloadDevices()

Reload the device list. The devices can be dynamically removed or added to the system. * Returns the number of available devices. * * \verbatim im.imVideoCaptureReloadDevices() -> count: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureResetAttribute
int imVideoCaptureResetAttribute(imVideoCapture* vc, const(char)* attrib, int fauto)

Resets a camera or video attribute to the default value or * to the automatic setting. \n * Not all attributes support automatic modes. \n * Returns zero if failed. * * \verbatim vc:ResetAttribute(attrib: string, fauto: boolean) -> error: boolean [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureSetAttribute
int imVideoCaptureSetAttribute(imVideoCapture* vc, const(char)* attrib, float percent)

Changes a camera or video attribute in percentage of the valid range value. \n * Returns zero if failed or attribute not supported. * * \verbatim vc:SetAttribute(attrib: string, percent: number) -> error: boolean [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureSetFormat
int imVideoCaptureSetFormat(imVideoCapture* vc, int format)

Changes the video format of the connected device. \n * Should NOT work for DV devices. Use \ref imVideoCaptureSetImageSize only. \n * Use -1 to return the current format, in this case returns -1 if failed. \n * When the format is changed in the dialog, for some formats * the returned format is the preferred format, not the current format. \n * This will not affect color_mode of the capture image. \n * Returns zero if failed. * * \verbatim vc:SetFormat([format: number]) -> error: boolean | format: number [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureSetImageSize
int imVideoCaptureSetImageSize(imVideoCapture* vc, int width, int height)

Changes the image size of the connected device. \n * Similar to \ref imVideoCaptureSetFormat, but changes only the size. \n * Valid sizes can be obtained with \ref imVideoCaptureGetFormat. \n * Returns zero if failed. * * \verbatim vc:SetImageSize(width: number, height: number) -> error: boolean [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureSetInOut
int imVideoCaptureSetInOut(imVideoCapture* vc, int input, int output, int cross)

Allows to control the input and output of devices that have multiple input and outputs. * The cross index controls in which stage the input/output will be set. Usually use 1, but some capture boards * has a second stage. In Direct X it controls the crossbars. * * \verbatim vc:SetInOut(input, output, cross: number) -> error: boolean [in Lua 5] \endverbatim * \ingroup capture

imVideoCaptureShowDialog
int imVideoCaptureShowDialog(imVideoCapture* vc, int dialog, void* parent)

Displays a configuration modal dialog of the connected device. \n * In Windows, the capturing will be stopped in some cases. \n * In Windows parent is a HWND of a parent window, it can be NULL. \n * dialog can be from 0 to \ref imVideoCaptureDialogCount. \n * Returns zero if failed. * * \verbatim vc:ShowDialog(dialog: number, parent: userdata) -> error: boolean [in Lua 5] \endverbatim * \ingroup capture

Structs

_imVideoCapture
struct _imVideoCapture

\brief Video Capture Structure (Private). * \ingroup capture

Meta