maix::display
maix.display module, control display device and show image on it
This is
maix::display
module of MaixCDK.
All of these elements are in namespacemaix::display
.For MaixCDK developer: DO NOT edit this doc file manually, this doc is auto generated!
Module
No module
Enum
Variable
Function
send_to_maixvision
Send image to MaixVision work station if connected.\nIf you want to debug your program an don't want to initialize display, use this method.
item | description |
---|---|
param | img: image to send, image.Image object |
C++ defination code:
void send_to_maixvision(image::Image &img)
set_trans_image_quality
Set image transport quality(only for JPEG)
item | description |
---|---|
param | quality: default 95, value from 51 ~ 100 |
C++ defination code:
void set_trans_image_quality(const int value)
Class
Display
Display class
C++ defination code:
class Display
Display
Construct a new Display object
item | description |
---|---|
type | func |
param | width: display width, by default(value is -1) means auto detect, if width > max device supported width, will auto set to max device supported width height: display height, by default(value is -1) means auto detect, if height > max device supported height, will auto set to max device supported height device: display device name, you can get devices by list_devices method, by default(value is NULL(None in MaixPy)) means the first device open: If true, display will automatically call open() after creation. default is true. |
static | False |
C++ defination code:
Display(int width = -1, int height = -1, image::Format format = image::FMT_RGB888, const std::string &device = "", bool open = true)
Display (overload 1)
Construct a new Display object.
item | description |
---|---|
type | func |
attention | DisplayBase * parameter need to be set manually, otherwise the operation of this object will be invalid. |
param | device: display device path, you can get devices by list_devices method, by default(value is NULL(None in MaixPy)) means the first device base: basic operation objects. width: display width, default is -1, means auto, mostly means max width of display support height: display height, default is -1, means auto, mostly means max height of display support format: display output format open: If true, display will automatically call open() after creation. default is true. |
static | False |
C++ defination code:
Display(const std::string &device, DisplayBase *base, int width = -1, int height = -1, image::Format format = image::FMT_INVALID, bool open = true)
width
Get display width
item | description |
---|---|
type | func |
return | width |
static | False |
C++ defination code:
int width()
height
Get display height
item | description |
---|---|
type | func |
param | ch: channel to get, by default(value is 0) means the first channel |
return | height |
static | False |
C++ defination code:
int height()
size
Get display size
item | description |
---|---|
type | func |
param | ch: channel to get, by default(value is 0) means the first channel |
return | size A list type in MaixPy, [width, height] |
static | False |
C++ defination code:
std::vector<int> size()
format
Get display format
item | description |
---|---|
type | func |
return | format |
static | False |
C++ defination code:
image::Format format()
open
open display device, if already opened, will return err.ERR_NONE.
item | description |
---|---|
type | func |
param | width: display width, default is -1, means auto, mostly means max width of display support height: display height, default is -1, means auto, mostly means max height of display support format: display output format, default is RGB888 |
return | error code |
static | False |
C++ defination code:
err::Err open(int width = -1, int height = -1, image::Format format = image::FMT_INVALID)
close
close display device
item | description |
---|---|
type | func |
return | error code |
static | False |
C++ defination code:
err::Err close()
add_channel
Add a new channel and return a new Display object, you can use close() to close this channel.
item | description |
---|---|
type | func |
attention | If a new disp channel is created, it is recommended to set fit=image::FIT_COVER or fit=image::FIT_FILL when running show for the main channel, otherwise the display of the new disp channel may be abnormal. |
param | width: display width, default is -1, means auto, mostly means max width of display support. Maximum width must not exceed the main channel. height: display height, default is -1, means auto, mostly means max height of display support. Maximum height must not exceed the main channel. format: display output format, default is FMT_BGRA8888 open: If true, display will automatically call open() after creation. default is true. |
return | new Display object |
static | False |
C++ defination code:
display::Display *add_channel(int width = -1, int height = -1, image::Format format = image::FMT_BGRA8888, bool open = true)
is_opened
check display device is opened or not
item | description |
---|---|
type | func |
return | opened or not, bool type |
static | False |
C++ defination code:
bool is_opened()
is_closed
check display device is closed or not
item | description |
---|---|
type | func |
return | closed or not, bool type |
static | False |
C++ defination code:
bool is_closed()
show
show image on display device, and will also send to MaixVision work station if connected.
item | description |
---|---|
type | func |
param | img: image to show, image.Image object, if the size of image smaller than display size, will show in the center of display; if the size of image bigger than display size, will auto resize to display size and keep ratio, fill blank with black color. fit: image in screen fit mode, by default(value is image.FIT_CONTAIN), @see image.Fit for more details e.g. image.FIT_CONTAIN means resize image to fit display size and keep ratio, fill blank with black color. |
return | error code |
static | False |
C++ defination code:
err::Err show(image::Image &img, image::Fit fit = image::FIT_CONTAIN)
device
Get display device path
item | description |
---|---|
type | func |
return | display device path |
static | False |
C++ defination code:
std::string device()
set_backlight
Set display backlight
item | description |
---|---|
type | func |
param | value: backlight value, float type, range is [0, 100] |
static | False |
C++ defination code:
void set_backlight(float value)
get_backlight
Get display backlight
item | description |
---|---|
type | func |
return | value backlight value, float type, range is [0, 100] |
static | False |
C++ defination code:
float get_backlight()
set_hmirror
Set display mirror
item | description |
---|---|
type | func |
param | en: enable/disable mirror |
static | False |
C++ defination code:
err::Err set_hmirror(bool en)
set_vflip
Set display flip
item | description |
---|---|
type | func |
param | en: enable/disable flip |
static | False |
C++ defination code:
err::Err set_vflip(bool en)