mxcubecore.HardwareObjects.abstract.AbstractVideoDevice#

[Name] GenericVideo

[Description] This module declares class GenericVideo.

This class is not meant to be instanced directly but as the base class for classes providing access to Video in MXCuBE

Functions

test_hwo(hwo)

Classes

class mxcubecore.HardwareObjects.abstract.AbstractVideoDevice.AbstractVideoDevice(name)[source]#

Bases: HardwareObject

bayer_rg16_2_rgb(raw_buffer)[source]#

Convert BAYER RG16 to RGB. :param raw_buffer: Image

Returns:

Converted image.

Return type:

()

change_owner()[source]#

LIMA specific, because it has to be root at startup move this to Qt4_LimaVideo

connect_notify(signal)[source]#

Descript. :

do_image_polling(sleep_time)[source]#

Descript. :

get_brightness()[source]#

Get the brightness

get_cam_type()[source]#

Get the camera type :returns: Camera type. :rtype: ()

get_camera_name()[source]#

Get the camera name. :returns: The name :rtype: (str)

get_contrast()[source]#

Get the contrast

abstract get_exposure_time()[source]#

Get the camera exposure time [s]

abstract get_gain()[source]#

Get the camera gain

get_gamma()[source]#

Get the gamma

get_height()[source]#

Get the image height. :returns: Image height [pixels]. :rtype: (int)

abstract get_image()[source]#

The implementing class should return here the latest_image in raw_format, followed by the width and height of the image

get_image_dimensions()[source]#

Get the scaled width and the height of the image: :returns: Width [mm], height [mm] list. :rtype: (list)

get_image_zoom()#

Get the Scaling factor. :returns: Scaling factor or None if does not exists :rtype: (float)

get_jpg_image()[source]#

Reads`raw_data` image [1D numpy array of np.uint16] from self.get_image() and convert it to .jpg image. For now this function allows to deal with any RGB encoded video data. Emit imageReceived signal with the jpeg image.

Returns:

Coverted to jpeg image.

Return type:

(bytes)

get_new_image()[source]#

Descript. :

get_raw_image_size()[source]#

Must return a two-value list necessary to avoid breaking e.g. ViideoMockup

get_scaling_factor()[source]#

Get the Scaling factor. :returns: Scaling factor or None if does not exists :rtype: (float)

get_snapshot(bw=None, return_as_array=True)[source]#

Get the snapshot. :param bs: Return grayscale image (True) :type bs: bool :param return_as_array: Return the image as array. Default is True. :type return_as_array: bool

Returns:

Snapshot image.

Return type:

()

abstract get_video_live()[source]#

Get the video live mode. :returns: Live mode. :rtype: flag(bool)

get_width()[source]#

Get the image width. :returns: Image width [pixels]. :rtype: (int)

imageType()[source]#

Descript. : returns image type (not used)

init()[source]#

Initialise the values from config and set default values, when appropriate

refresh_video()[source]#

Descript. :

save_snapshot(filename, image_type='PNG')[source]#

Save snapshot image

set_brightness(brightness_value)[source]#

Set the brightness

set_cam_encoding(cam_encoding)[source]#

Set the image encoding. :param cam_encoding: set the encoding type. :type cam_encoding: str

set_contrast(contrast_value)[source]#

Set the contrast

abstract set_exposure_time(exposure_time_value)[source]#

Set the camera exposure time [s]

abstract set_gain(gain_value)[source]#

Set the camera gain

set_gamma(gamma_value)[source]#

Set the gamma

set_live(mode)[source]#

Set the live mode. :param mode: Live mode. :type mode: bool

self.set_video_live(mode)

abstract set_video_live(flag)[source]#

Set the video live mode. :param flag: Live mode. :type flag: bool

start_camera()[source]#

Start

take_snapshot(bw=None, return_as_array=True)[source]#

Take the snapshot. :param bs: Return grayscale image (True) :type bs: bool :param return_as_array: Return the image as array. Default is True. :type return_as_array: bool

Returns:

Snapshot image.

Return type:

()

y16_2_rgb(raw_buffer)[source]#

Convert Y16 to RGB. :param raw_buffer: Image

Returns:

Converted image.

Return type:

()

y8_2_rgb(raw_buffer)[source]#

Convert Y8 to RGB. :param raw_buffer: Image

Returns:

Converted image.

Return type:

()

yuv_2_rgb(raw_buffer)[source]#

Convert YUV to RGB. :param raw_buffer: Image

Returns:

Converted image.

Return type:

()