Skip to content

Commit

Permalink
Merge pull request #52 from 916BGAI/dev
Browse files Browse the repository at this point in the history
add fb device display support
  • Loading branch information
Neutree authored Nov 19, 2024
2 parents 17f7dcc + fd380b0 commit 2c76546
Show file tree
Hide file tree
Showing 6 changed files with 503 additions and 13 deletions.
4 changes: 4 additions & 0 deletions components/vision/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,10 @@ list(APPEND ADD_INCLUDE "include"
)
if(PLATFORM_LINUX)
list(APPEND ADD_PRIVATE_INCLUDE "port/linux")
list(APPEND ADD_PRIVATE_INCLUDE "port/linux_common")
elseif(PLATFORM_MAIXCAM)
list(APPEND ADD_PRIVATE_INCLUDE "port/maixcam")
list(APPEND ADD_PRIVATE_INCLUDE "port/linux_common")
endif()
list(APPEND ADD_PRIVATE_INCLUDE "include_private")
###############################################
Expand All @@ -22,8 +24,10 @@ append_srcs_dir(ADD_SRCS "src") # append source file in src dir to var ADD_S
append_srcs_dir(ADD_SRCS "src/ByteTrack")
if(PLATFORM_LINUX)
append_srcs_dir(ADD_SRCS "port/linux")
append_srcs_dir(ADD_SRCS "port/linux_common")
elseif(PLATFORM_MAIXCAM)
append_srcs_dir(ADD_SRCS "port/maixcam")
append_srcs_dir(ADD_SRCS "port/linux_common")
endif()
# list(REMOVE_ITEM COMPONENT_SRCS "src/test.c")
# set(ADD_ASM_SRCS "src/asm.S")
Expand Down
4 changes: 2 additions & 2 deletions components/vision/include/maix_display.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ namespace maix::display
* @maixpy maix.display.Display.__init__
* @maixcdk maix.display.Display.Display
*/
Display(int width = -1, int height = -1, image::Format format = image::FMT_RGB888, const char *device = nullptr, bool open = true);
Display(int width = -1, int height = -1, image::Format format = image::FMT_RGB888, const std::string &device = "", bool open = true);

/**
* @brief Construct a new Display object.
Expand All @@ -57,7 +57,7 @@ namespace maix::display
* @param open If true, display will automatically call open() after creation. default is true.
* @maixcdk maix.display.Display.Display
*/
Display(const char *device, DisplayBase *base, int width = -1, int height = -1, image::Format format = image::FMT_INVALID, bool open = true);
Display(const std::string &device, DisplayBase *base, int width = -1, int height = -1, image::Format format = image::FMT_INVALID, bool open = true);

~Display();

Expand Down
2 changes: 1 addition & 1 deletion components/vision/port/linux/maix_display_sdl.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ namespace maix::display
class SDL_Display final : public DisplayBase
{
public:
SDL_Display(const char *device, int width, int height, image::Format format)
SDL_Display(const std::string &device, int width, int height, image::Format format)
{
this->_width = width;
this->_height = height;
Expand Down
Loading

0 comments on commit 2c76546

Please sign in to comment.