Skip to content

Commit

Permalink
[*] 窗口
Browse files Browse the repository at this point in the history
  • Loading branch information
acgist committed Feb 28, 2024
1 parent efa8146 commit 00efdb8
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 10 deletions.
22 changes: 17 additions & 5 deletions boot/main/src/header/Window.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
Fl_Button* modelTypeLower##GcPtr = nullptr; \
Fl_Button* modelTypeLower##TsPtr = nullptr; \
modelTypeUpper##GCWindow* modelTypeLower##GcWindowPtr = nullptr; \
modelTypeUpper##GCWindow* modelTypeLower##TsWindowPtr = nullptr;
modelTypeUpper##TSWindow* modelTypeLower##TsWindowPtr = nullptr;
#endif

#ifndef LFR_INPUT_DIRECTORY_CHOOSER_CALLBACK
Expand Down Expand Up @@ -118,6 +118,8 @@ class MainWindow : public LFRWindow {
public:
// ImageGC
void imageGc();
// ImageTS
void imageTs();
// 关于
void about();

Expand Down Expand Up @@ -262,13 +264,10 @@ class ImageGCWindow : public ModelGCWindow {
* @param height 窗口高度
* @param title 窗口名称
*/
ImageGCWindow(int width, int height, const char* title = "图片生成");
ImageGCWindow(int width, int height, const char* title = "图片内容生成");
virtual ~ImageGCWindow();

protected:
/**
* 加载组件
*/
virtual void drawElement() override;

};
Expand All @@ -277,6 +276,19 @@ class ImageGCWindow : public ModelGCWindow {
* @see ImageTS
*/
class ImageTSWindow : public ModelTSWindow {

public:
/**
* @param width 窗口宽度
* @param height 窗口高度
* @param title 窗口名称
*/
ImageTSWindow(int width, int height, const char* title = "图片风格迁移");
~ImageTSWindow();

protected:
virtual void drawElement() override;

};

/**
Expand Down
2 changes: 2 additions & 0 deletions boot/main/src/source/MainWindow.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@ void lifuren::MainWindow::drawElement() {
this->imageGcPtr = new Fl_Button(20, 50, (this->w() - 60) / 2, 30, "图片内容生成");
this->imageTsPtr = new Fl_Button((this->w() - 60) / 2 + 40, 50, (this->w() - 60) / 2, 30, "图片风格转换");
LFR_CALLBACK_FUNCTION_BINDER(imageGcPtr, imageGc);
LFR_CALLBACK_FUNCTION_BINDER(imageTsPtr, imageTs);
// 视频
this->videoGcPtr = new Fl_Button(20, 90, (this->w() - 60) / 2, 30, "视频内容生成");
this->videoTsPtr = new Fl_Button((this->w() - 60) / 2 + 40, 90, (this->w() - 60) / 2, 30, "视频风格转换");
Expand All @@ -93,4 +94,5 @@ void lifuren::MainWindow::drawElement() {
}

LFR_CALLBACK_FUNCTION(imageGc, ImageGCWindow, imageGcWindowPtr, 1200, 800);
LFR_CALLBACK_FUNCTION(imageTs, ImageTSWindow, imageTsWindowPtr, 1200, 800);
LFR_CALLBACK_FUNCTION(about, AboutWindow, aboutWindowPtr, 512, 256);
16 changes: 11 additions & 5 deletions boot/main/src/source/application/ImageTSWindow.cpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
/**
* 图片风格迁移
*
* @author acgist
*/
#include "../../header/Window.hpp"

lifuren::ImageTSWindow::ImageTSWindow(int width, int height, const char* title) :ModelTSWindow(width, height, title) {

}

lifuren::ImageTSWindow::~ImageTSWindow() {
}

void lifuren::ImageTSWindow::drawElement() {
}

0 comments on commit 00efdb8

Please sign in to comment.