This repository has been archived by the owner on Oct 11, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 82cf65f
Showing
13 changed files
with
888 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,190 @@ | ||
# https://clang.llvm.org/docs/ClangFormatStyleOptions.html | ||
# for clang-format 17.0.1 | ||
Language: Cpp | ||
BasedOnStyle: "WebKit" | ||
# AccessModifierOffset: 2 | ||
AlignAfterOpenBracket: "AlwaysBreak" | ||
AlignArrayOfStructures: None | ||
AlignConsecutiveAssignments: None | ||
AlignConsecutiveBitFields: None | ||
AlignConsecutiveDeclarations: None | ||
AlignConsecutiveMacros: None | ||
# AlignConsecutiveShortCaseStatements: None | ||
AlignEscapedNewlines: Left | ||
AlignOperands: Align | ||
AlignTrailingComments: | ||
Kind: Always | ||
OverEmptyLines: 1 | ||
AllowAllArgumentsOnNextLine: false | ||
AllowAllParametersOfDeclarationOnNextLine: false | ||
AllowShortBlocksOnASingleLine: Never | ||
AllowShortCaseLabelsOnASingleLine: false | ||
# AllowShortCompoundRequirementOnASingleLine: true | ||
AllowShortEnumsOnASingleLine: false | ||
AllowShortFunctionsOnASingleLine: InlineOnly | ||
AllowShortIfStatementsOnASingleLine: Never | ||
AllowShortLambdasOnASingleLine: Inline | ||
AllowShortLoopsOnASingleLine: false | ||
AlwaysBreakAfterDefinitionReturnType: None | ||
AlwaysBreakAfterReturnType: None | ||
AlwaysBreakBeforeMultilineStrings: true | ||
AlwaysBreakTemplateDeclarations: Yes | ||
# AttributeMacros: | ||
# - __pragma | ||
# - _Pragma | ||
# - __attribute__ | ||
# - __declspec | ||
BinPackArguments: false | ||
BinPackParameters: false | ||
BitFieldColonSpacing: After | ||
BraceWrapping: | ||
AfterCaseLabel: false | ||
AfterClass: true | ||
AfterControlStatement: Never | ||
AfterEnum: true | ||
AfterFunction: true | ||
AfterNamespace: true | ||
# AfterObjCDeclaration: true | ||
AfterStruct: true | ||
AfterUnion: true | ||
AfterExternBlock: true | ||
BeforeCatch: true | ||
BeforeElse: true | ||
BeforeLambdaBody: false | ||
BeforeWhile: false | ||
IndentBraces: false | ||
SplitEmptyFunction: true | ||
SplitEmptyRecord: true | ||
SplitEmptyNamespace: true | ||
# BracedInitializerIndentWidth: 4 | ||
BreakAfterAttributes: Never | ||
BreakAfterJavaFieldAnnotations: true | ||
BreakArrays: true | ||
BreakBeforeBinaryOperators: NonAssignment | ||
BreakBeforeBraces: Attach | ||
BreakBeforeConceptDeclarations: Always | ||
BreakBeforeInlineASMColon: OnlyMultiline | ||
BreakBeforeTernaryOperators: true | ||
BreakConstructorInitializers: BeforeComma | ||
BreakInheritanceList: BeforeComma | ||
BreakStringLiterals: true | ||
ColumnLimit: 100 | ||
# CommentPragmas: '^ MEO pragma:' | ||
CompactNamespaces: false | ||
ConstructorInitializerIndentWidth: 4 | ||
ContinuationIndentWidth: 4 | ||
Cpp11BracedListStyle: false | ||
DerivePointerAlignment: false | ||
DisableFormat: false | ||
EmptyLineAfterAccessModifier: Never | ||
EmptyLineBeforeAccessModifier: LogicalBlock | ||
# ExperimentalAutoDetectBinPacking: true | ||
FixNamespaceComments: true | ||
# ForEachMacros: | ||
# - foreach | ||
# - Q_FOREACH | ||
# - BOOST_FOREACH | ||
# IfMacros: | ||
# - 'KJ_IF_MAYBE' | ||
IncludeBlocks: Preserve | ||
# IncludeCategories: | ||
# IncludeIsMainRegex: | ||
# IncludeIsMainSourceRegex: | ||
IndentAccessModifiers: false | ||
IndentCaseBlocks: false | ||
IndentCaseLabels: false | ||
IndentExternBlock: AfterExternBlock | ||
IndentGotoLabels: false | ||
IndentPPDirectives: None | ||
IndentRequiresClause: false | ||
IndentWidth: 4 | ||
IndentWrappedFunctionNames: true | ||
InsertBraces: true | ||
InsertNewlineAtEOF: true | ||
InsertTrailingCommas: Wrapped | ||
IntegerLiteralSeparator: | ||
Binary: 4 | ||
BinaryMinDigits: 9 | ||
Decimal: 3 | ||
DecimalMinDigits: 7 | ||
Hex: -1 | ||
# JavaImportGroups: | ||
# JavaScriptQuotes: | ||
# JavaScriptWrapImports: | ||
KeepEmptyLinesAtEOF: true | ||
KeepEmptyLinesAtTheStartOfBlocks: false | ||
LambdaBodyIndentation: Signature | ||
# LineEnding: LF | ||
# MacroBlockBegin: "MAA.*_NS_BEGIN$" | ||
# MacroBlockEnd: "MAA.*_NS_END$" | ||
# Macros: | ||
MaxEmptyLinesToKeep: 1 | ||
NamespaceIndentation: None | ||
# NamespaceMacros: | ||
# ObjCBinPackProtocolList: | ||
# ObjCBlockIndentWidth: | ||
# ObjCBreakBeforeNestedBlockParam: | ||
# ObjCSpaceAfterProperty: | ||
# ObjCSpaceBeforeProtocolList: | ||
PackConstructorInitializers: Never | ||
# PenaltyBreakAssignment: | ||
# PenaltyBreakBeforeFirstCallParameter: | ||
# PenaltyBreakComment: | ||
# PenaltyBreakFirstLessLess: | ||
# PenaltyBreakOpenParenthesis: | ||
# PenaltyBreakTemplateDeclaration: | ||
# PenaltyExcessCharacter: | ||
# PenaltyIndentedWhitespace: | ||
# PenaltyReturnTypeOnItsOwnLine: | ||
PointerAlignment: Left | ||
# QualifierAlignment: Custom | ||
# QualifierOrder: | ||
# - inline | ||
# - static | ||
# - const | ||
# - constexpr | ||
# - type | ||
ReferenceAlignment: Left | ||
ReflowComments: true | ||
RemoveBracesLLVM: false | ||
RemoveParentheses: Leave | ||
RemoveSemicolon: false | ||
RequiresClausePosition: OwnLine | ||
RequiresExpressionIndentation: OuterScope | ||
SeparateDefinitionBlocks: Always | ||
ShortNamespaceLines: 1000 | ||
SortIncludes: CaseSensitive | ||
# SortJavaStaticImport: | ||
SortUsingDeclarations: Lexicographic | ||
SpaceAfterCStyleCast: false | ||
SpaceAfterLogicalNot: false | ||
SpaceAfterTemplateKeyword: true | ||
SpaceAroundPointerQualifiers: Default | ||
SpaceBeforeAssignmentOperators: true | ||
SpaceBeforeCaseColon: false | ||
SpaceBeforeCpp11BracedList: true | ||
SpaceBeforeCtorInitializerColon: true | ||
SpaceBeforeJsonColon: false | ||
SpaceBeforeParens: ControlStatements | ||
# SpaceBeforeParensOptions: | ||
SpaceBeforeRangeBasedForLoopColon: true | ||
SpaceBeforeSquareBrackets: false | ||
SpaceInEmptyBlock: false | ||
SpaceInEmptyParentheses: false | ||
SpacesBeforeTrailingComments: 1 | ||
SpacesInAngles: Never | ||
SpacesInContainerLiterals: true | ||
SpacesInLineCommentPrefix: | ||
Minimum: 1 | ||
Maximum: -1 | ||
SpacesInParens: Never | ||
SpacesInSquareBrackets: false | ||
Standard: c++20 | ||
# StatementAttributeLikeMacros: | ||
# StatementMacros: | ||
TabWidth: 4 | ||
# TypeNames: | ||
# TypenameMacros: | ||
UseTab: Never | ||
# VerilogBreakBetweenInstancePorts: | ||
# WhitespaceSensitiveMacros: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
build | ||
.vs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
cmake_minimum_required(VERSION 3.16) | ||
project(ImageCropper LANGUAGES CXX) | ||
|
||
include(qt.cmake) | ||
|
||
set(CMAKE_CXX_STANDARD 17) | ||
set(CMAKE_CXX_STANDARD_REQUIRED ON) | ||
|
||
find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Core) | ||
find_package(Qt${QT_VERSION_MAJOR} | ||
COMPONENTS | ||
Core | ||
Gui | ||
Widgets | ||
) | ||
qt_standard_project_setup() | ||
|
||
set(SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/source) | ||
|
||
file(GLOB PROJECT_SOURCES ${SOURCE_DIR}/*) | ||
|
||
set(GLOB FORMS ${SOURCE_DIR}/*.ui) | ||
|
||
source_group(FORMS FILES ${FORMS}) | ||
|
||
qt_add_executable(ImageCropper ${PROJECT_SOURCES}) | ||
|
||
### OpenCV | ||
|
||
find_package(OpenCV REQUIRED) | ||
target_include_directories(ImageCropper | ||
PRIVATE | ||
${OpenCV_INCLUDE_DIRS} | ||
) | ||
target_link_directories(ImageCropper | ||
PRIVATE | ||
${OpenCV_LIB_DIR} | ||
) | ||
target_link_libraries(ImageCropper | ||
PRIVATE | ||
${OpenCV_LIBS} | ||
) | ||
|
||
target_include_directories(ImageCropper | ||
PRIVATE | ||
${CMAKE_CURRENT_SOURCE_DIR}/include | ||
) | ||
|
||
set_target_properties(ImageCropper | ||
PROPERTIES | ||
WIN32_EXECUTABLE TRUE | ||
) | ||
|
||
target_link_libraries(ImageCropper | ||
PUBLIC | ||
Qt::Core | ||
Qt::Gui | ||
Qt::Widgets | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
{ | ||
"version": 3, | ||
"configurePresets": [ | ||
{ | ||
"hidden": true, | ||
"name": "Qt", | ||
"cacheVariables": { | ||
"CMAKE_PREFIX_PATH": "$env{QTDIR}" | ||
} | ||
}, | ||
{ | ||
"hidden": true, | ||
"name": "MSVC", | ||
"inherits": "Qt", | ||
"binaryDir": "build", | ||
"cacheVariables": { | ||
"CMAKE_GENERATOR": "Visual Studio 17 2022" | ||
} | ||
}, | ||
{ | ||
"name": "MSVC-Release", | ||
"inherits": "MSVC", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Release" | ||
} | ||
}, | ||
{ | ||
"name": "MSVC-Debug", | ||
"inherits": "MSVC", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "Debug" | ||
} | ||
}, | ||
{ | ||
"name": "MSVC-RelWithDebInfo", | ||
"inherits": "MSVC", | ||
"cacheVariables": { | ||
"CMAKE_BUILD_TYPE": "RelWithDebInfo" | ||
} | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include <QProcess> | ||
#include <opencv2/opencv.hpp> | ||
|
||
namespace adb { | ||
bool is_connected(); | ||
cv::Mat screenshot(); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
if(QT_VERSION VERSION_LESS 6.3) | ||
macro(qt_standard_project_setup) | ||
set(CMAKE_AUTOMOC ON) | ||
set(CMAKE_AUTORCC ON) | ||
set(CMAKE_AUTOUIC ON) | ||
endmacro() | ||
endif() | ||
|
||
if(QT_VERSION VERSION_LESS 6.0) | ||
macro(qt_add_executable name) | ||
if(ANDROID) | ||
add_library(name SHARED ${ARGN}) | ||
else() | ||
add_executable(${ARGV}) | ||
endif() | ||
endmacro() | ||
endif() |
Oops, something went wrong.