├── .clang-format ├── .cproject ├── .github ├── auto-comment.yml └── stale.yml ├── .gitignore ├── .gitmodules ├── .project ├── .settings ├── language.settings.xml ├── org.eclipse.cdt.core.prefs └── org.eclipse.cdt.ui.prefs ├── CMakeLists.txt ├── LICENSE ├── Makefile ├── README.md ├── camera_100ask ├── assets │ └── img_lv_100ask_demo_logo.c ├── camera_100ask.mk ├── camera_100ask_dev.c ├── camera_100ask_dev.h ├── camera_100ask_ui.c ├── camera_100ask_ui.h ├── convert_to_bmp_file.c ├── convert_to_bmp_file.h ├── types.h └── video2lcd │ ├── Makefile │ ├── Makefile.build │ ├── convert │ ├── Makefile │ ├── color.c │ ├── color.h │ ├── convert_manager.c │ ├── jdatasrc-tj.c │ ├── jerror.h │ ├── jinclude.h │ ├── jpeglib.h │ ├── mjpeg2rgb.c │ ├── rgb2rgb.c │ └── yuv2rgb.c │ ├── display │ ├── Makefile │ ├── disp_manager.c │ └── fb.c │ ├── include │ ├── config.h │ ├── convert_manager.h │ ├── disp_manager.h │ ├── pic_operation.h │ ├── picfmt_manager.h │ ├── render.h │ └── video_manager.h │ ├── log.txt │ ├── main.c │ ├── netprint_client.c │ ├── render │ ├── Makefile │ └── operation │ │ ├── Makefile │ │ ├── merge.c │ │ └── zoom.c │ ├── video │ ├── Makefile │ ├── v4l2.c │ └── video_manager.c │ └── 说明.txt ├── lv_conf.h ├── lv_drv_conf.h ├── main.c └── mouse_cursor_icon.c /.clang-format: -------------------------------------------------------------------------------- 1 | --- 2 | Language: Cpp 3 | # BasedOnStyle: LLVM 4 | AccessModifierOffset: -2 5 | AlignAfterOpenBracket: Align 6 | AlignConsecutiveAssignments: true 7 | AlignConsecutiveDeclarations: false 8 | AlignEscapedNewlinesLeft: false 9 | AlignOperands: true 10 | AlignTrailingComments: true 11 | AllowAllParametersOfDeclarationOnNextLine: true 12 | AllowShortBlocksOnASingleLine: false 13 | AllowShortCaseLabelsOnASingleLine: true 14 | AllowShortFunctionsOnASingleLine: None 15 | AllowShortIfStatementsOnASingleLine: true 16 | AllowShortLoopsOnASingleLine: true 17 | AlwaysBreakAfterDefinitionReturnType: None 18 | AlwaysBreakAfterReturnType: None 19 | AlwaysBreakBeforeMultilineStrings: false 20 | AlwaysBreakTemplateDeclarations: false 21 | BinPackArguments: true 22 | BinPackParameters: true 23 | BreakBeforeBraces: Custom 24 | BraceWrapping: 25 | AfterClass: false 26 | AfterControlStatement: false 27 | AfterEnum: false 28 | AfterFunction: true 29 | AfterNamespace: false 30 | AfterObjCDeclaration: false 31 | AfterStruct: true 32 | AfterUnion: true 33 | BeforeCatch: false 34 | BeforeElse: false 35 | IndentBraces: false 36 | SplitEmptyFunction: false 37 | BreakBeforeBinaryOperators: None 38 | BreakBeforeTernaryOperators: true 39 | BreakConstructorInitializersBeforeComma: false 40 | BreakAfterJavaFieldAnnotations: false 41 | BreakStringLiterals: true 42 | ColumnLimit: 120 43 | CommentPragmas: '^ IWYU pragma:' 44 | ConstructorInitializerAllOnOneLineOrOnePerLine: false 45 | ConstructorInitializerIndentWidth: 4 46 | ContinuationIndentWidth: 4 47 | Cpp11BracedListStyle: true 48 | DerivePointerAlignment: false 49 | DisableFormat: false 50 | ExperimentalAutoDetectBinPacking: false 51 | ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH ] 52 | IncludeCategories: 53 | - Regex: '^"(llvm|llvm-c|clang|clang-c)/' 54 | Priority: 2 55 | - Regex: '^(<|"(gtest|isl|json)/)' 56 | Priority: 3 57 | - Regex: '.*' 58 | Priority: 1 59 | IncludeIsMainRegex: '$' 60 | IndentCaseLabels: true 61 | IndentWidth: 4 62 | IndentWrappedFunctionNames: false 63 | JavaScriptQuotes: Leave 64 | JavaScriptWrapImports: true 65 | KeepEmptyLinesAtTheStartOfBlocks: true 66 | MacroBlockBegin: '' 67 | MacroBlockEnd: '' 68 | MaxEmptyLinesToKeep: 1 69 | NamespaceIndentation: None 70 | ObjCBlockIndentWidth: 2 71 | ObjCSpaceAfterProperty: false 72 | ObjCSpaceBeforeProtocolList: true 73 | PenaltyBreakBeforeFirstCallParameter: 19 74 | PenaltyBreakComment: 300 75 | PenaltyBreakFirstLessLess: 120 76 | PenaltyBreakString: 1000 77 | PenaltyExcessCharacter: 1000000 78 | PenaltyReturnTypeOnItsOwnLine: 60 79 | PointerAlignment: Middle 80 | ReflowComments: true 81 | SortIncludes: false 82 | SpaceAfterCStyleCast: false 83 | SpaceAfterTemplateKeyword: true 84 | SpaceBeforeAssignmentOperators: true 85 | SpaceBeforeParens: Never 86 | SpaceInEmptyParentheses: false 87 | SpacesBeforeTrailingComments: 1 88 | SpacesInAngles: false 89 | SpacesInContainerLiterals: false 90 | SpacesInCStyleCastParentheses: false 91 | SpacesInParentheses: false 92 | SpacesInSquareBrackets: false 93 | Standard: Cpp11 94 | TabWidth: 4 95 | UseTab: Never 96 | ... 97 | 98 | -------------------------------------------------------------------------------- /.cproject: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 28 | 29 | 30 | 31 | 34 | 35 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 77 | 78 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | -------------------------------------------------------------------------------- /.github/auto-comment.yml: -------------------------------------------------------------------------------- 1 | # Comment to a new issue. 2 | pullRequestOpened: | 3 | Thank you for raising your pull request. 4 | 5 | To ensure that all licensing criteria is met all repositories of the LVGL project apply a process called DCO (Developer's Certificate of Origin). 6 | 7 | The text of DCO can be read here: https://developercertificate.org/ 8 | For a more detailed description see the [Documentation](https://docs.lvgl.io/latest/en/html/contributing/index.html#developer-certification-of-origin-dco) site. 9 | 10 | By contributing to any repositories of the LVGL project you state that your contribution corresponds with the DCO. 11 | 12 | No further action is required if your contribution fulfills the DCO. If you are not sure about it feel free to ask us in a comment. 13 | -------------------------------------------------------------------------------- /.github/stale.yml: -------------------------------------------------------------------------------- 1 | # Number of days of inactivity before an issue becomes stale 2 | daysUntilStale: 21 3 | # Number of days of inactivity before a stale issue is closed 4 | daysUntilClose: 7 5 | # Issues with these labels will never be considered stale 6 | exemptLabels: 7 | - architecture 8 | - pinned 9 | # Label to use when marking an issue as stale 10 | staleLabel: stale 11 | # Comment to post when marking an issue as stale. Set to `false` to disable 12 | markComment: > 13 | This issue or pull request has been automatically marked as stale because it has not had 14 | recent activity. It will be closed if no further activity occurs. Thank you 15 | for your contributions. 16 | # Comment to post when closing a stale issue. Set to `false` to disable 17 | closeComment: false 18 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Prerequisites 2 | *.d 3 | 4 | # Object files 5 | *.o 6 | *.ko 7 | *.obj 8 | *.elf 9 | 10 | # Linker output 11 | *.ilk 12 | *.map 13 | *.exp 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Libraries 20 | *.lib 21 | *.a 22 | *.la 23 | *.lo 24 | 25 | # Shared objects (inc. Windows DLLs) 26 | *.dll 27 | *.so 28 | *.so.* 29 | *.dylib 30 | 31 | # Executables 32 | *.exe 33 | *.out 34 | *.app 35 | *.i*86 36 | *.x86_64 37 | *.hex 38 | 39 | # Debug files 40 | *.dSYM/ 41 | *.su 42 | *.idb 43 | *.pdb 44 | 45 | # Kernel Module Compile Results 46 | *.mod* 47 | *.cmd 48 | .tmp_versions/ 49 | modules.order 50 | Module.symvers 51 | Mkfile.old 52 | dkms.conf 53 | /Debug/ 54 | .DS_Store 55 | .vscode 56 | *.bak 57 | -------------------------------------------------------------------------------- /.gitmodules: -------------------------------------------------------------------------------- 1 | [submodule "lvgl"] 2 | path = lvgl 3 | url = https://github.com/lvgl/lvgl.git 4 | [submodule "lv_drivers"] 5 | path = lv_drivers 6 | url = https://github.com/lvgl/lv_drivers.git 7 | -------------------------------------------------------------------------------- /.project: -------------------------------------------------------------------------------- 1 | 2 | 3 | linux_frame_buffer 4 | 5 | 6 | 7 | 8 | 9 | org.eclipse.cdt.managedbuilder.core.genmakebuilder 10 | clean,full,incremental, 11 | 12 | 13 | 14 | 15 | org.eclipse.cdt.managedbuilder.core.ScannerConfigBuilder 16 | full,incremental, 17 | 18 | 19 | 20 | 21 | 22 | org.eclipse.cdt.core.cnature 23 | org.eclipse.cdt.managedbuilder.core.managedBuildNature 24 | org.eclipse.cdt.managedbuilder.core.ScannerConfigNature 25 | 26 | 27 | -------------------------------------------------------------------------------- /.settings/language.settings.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | -------------------------------------------------------------------------------- /.settings/org.eclipse.cdt.core.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | org.eclipse.cdt.core.code_formatter=org.wangzw.plugin.cppstyle.CppCodeFormatter 3 | org.eclipse.cdt.core.formatter.alignment_for_arguments_in_method_invocation=16 4 | org.eclipse.cdt.core.formatter.alignment_for_assignment=16 5 | org.eclipse.cdt.core.formatter.alignment_for_base_clause_in_type_declaration=80 6 | org.eclipse.cdt.core.formatter.alignment_for_binary_expression=16 7 | org.eclipse.cdt.core.formatter.alignment_for_compact_if=16 8 | org.eclipse.cdt.core.formatter.alignment_for_conditional_expression=34 9 | org.eclipse.cdt.core.formatter.alignment_for_conditional_expression_chain=18 10 | org.eclipse.cdt.core.formatter.alignment_for_constructor_initializer_list=0 11 | org.eclipse.cdt.core.formatter.alignment_for_declarator_list=16 12 | org.eclipse.cdt.core.formatter.alignment_for_enumerator_list=48 13 | org.eclipse.cdt.core.formatter.alignment_for_expression_list=0 14 | org.eclipse.cdt.core.formatter.alignment_for_expressions_in_array_initializer=16 15 | org.eclipse.cdt.core.formatter.alignment_for_member_access=0 16 | org.eclipse.cdt.core.formatter.alignment_for_overloaded_left_shift_chain=16 17 | org.eclipse.cdt.core.formatter.alignment_for_parameters_in_method_declaration=16 18 | org.eclipse.cdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16 19 | org.eclipse.cdt.core.formatter.brace_position_for_array_initializer=end_of_line 20 | org.eclipse.cdt.core.formatter.brace_position_for_block=end_of_line 21 | org.eclipse.cdt.core.formatter.brace_position_for_block_in_case=end_of_line 22 | org.eclipse.cdt.core.formatter.brace_position_for_method_declaration=end_of_line 23 | org.eclipse.cdt.core.formatter.brace_position_for_namespace_declaration=end_of_line 24 | org.eclipse.cdt.core.formatter.brace_position_for_switch=end_of_line 25 | org.eclipse.cdt.core.formatter.brace_position_for_type_declaration=end_of_line 26 | org.eclipse.cdt.core.formatter.comment.line_up_line_comment_in_blocks_on_first_column=false 27 | org.eclipse.cdt.core.formatter.comment.min_distance_between_code_and_line_comment=1 28 | org.eclipse.cdt.core.formatter.comment.never_indent_line_comments_on_first_column=true 29 | org.eclipse.cdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=true 30 | org.eclipse.cdt.core.formatter.compact_else_if=true 31 | org.eclipse.cdt.core.formatter.continuation_indentation=2 32 | org.eclipse.cdt.core.formatter.continuation_indentation_for_array_initializer=2 33 | org.eclipse.cdt.core.formatter.format_guardian_clause_on_one_line=false 34 | org.eclipse.cdt.core.formatter.indent_access_specifier_compare_to_type_header=false 35 | org.eclipse.cdt.core.formatter.indent_access_specifier_extra_spaces=0 36 | org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_access_specifier=true 37 | org.eclipse.cdt.core.formatter.indent_body_declarations_compare_to_namespace_header=false 38 | org.eclipse.cdt.core.formatter.indent_breaks_compare_to_cases=true 39 | org.eclipse.cdt.core.formatter.indent_declaration_compare_to_template_header=false 40 | org.eclipse.cdt.core.formatter.indent_empty_lines=false 41 | org.eclipse.cdt.core.formatter.indent_statements_compare_to_block=true 42 | org.eclipse.cdt.core.formatter.indent_statements_compare_to_body=true 43 | org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_cases=true 44 | org.eclipse.cdt.core.formatter.indent_switchstatements_compare_to_switch=false 45 | org.eclipse.cdt.core.formatter.indentation.size=4 46 | org.eclipse.cdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert 47 | org.eclipse.cdt.core.formatter.insert_new_line_after_template_declaration=do not insert 48 | org.eclipse.cdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert 49 | org.eclipse.cdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert 50 | org.eclipse.cdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert 51 | org.eclipse.cdt.core.formatter.insert_new_line_before_colon_in_constructor_initializer_list=do not insert 52 | org.eclipse.cdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert 53 | org.eclipse.cdt.core.formatter.insert_new_line_before_identifier_in_function_declaration=do not insert 54 | org.eclipse.cdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert 55 | org.eclipse.cdt.core.formatter.insert_new_line_in_empty_block=insert 56 | org.eclipse.cdt.core.formatter.insert_space_after_assignment_operator=insert 57 | org.eclipse.cdt.core.formatter.insert_space_after_binary_operator=insert 58 | org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_arguments=insert 59 | org.eclipse.cdt.core.formatter.insert_space_after_closing_angle_bracket_in_template_parameters=insert 60 | org.eclipse.cdt.core.formatter.insert_space_after_closing_brace_in_block=insert 61 | org.eclipse.cdt.core.formatter.insert_space_after_closing_paren_in_cast=insert 62 | org.eclipse.cdt.core.formatter.insert_space_after_colon_in_base_clause=insert 63 | org.eclipse.cdt.core.formatter.insert_space_after_colon_in_case=insert 64 | org.eclipse.cdt.core.formatter.insert_space_after_colon_in_conditional=insert 65 | org.eclipse.cdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert 66 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_array_initializer=insert 67 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_base_types=insert 68 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_declarator_list=insert 69 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert 70 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_expression_list=insert 71 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert 72 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert 73 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert 74 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_arguments=insert 75 | org.eclipse.cdt.core.formatter.insert_space_after_comma_in_template_parameters=insert 76 | org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_arguments=do not insert 77 | org.eclipse.cdt.core.formatter.insert_space_after_opening_angle_bracket_in_template_parameters=do not insert 78 | org.eclipse.cdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert 79 | org.eclipse.cdt.core.formatter.insert_space_after_opening_bracket=do not insert 80 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert 81 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert 82 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_exception_specification=do not insert 83 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert 84 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert 85 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert 86 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert 87 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert 88 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert 89 | org.eclipse.cdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert 90 | org.eclipse.cdt.core.formatter.insert_space_after_postfix_operator=do not insert 91 | org.eclipse.cdt.core.formatter.insert_space_after_prefix_operator=do not insert 92 | org.eclipse.cdt.core.formatter.insert_space_after_question_in_conditional=insert 93 | org.eclipse.cdt.core.formatter.insert_space_after_semicolon_in_for=insert 94 | org.eclipse.cdt.core.formatter.insert_space_after_unary_operator=do not insert 95 | org.eclipse.cdt.core.formatter.insert_space_before_assignment_operator=insert 96 | org.eclipse.cdt.core.formatter.insert_space_before_binary_operator=insert 97 | org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_arguments=do not insert 98 | org.eclipse.cdt.core.formatter.insert_space_before_closing_angle_bracket_in_template_parameters=do not insert 99 | org.eclipse.cdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert 100 | org.eclipse.cdt.core.formatter.insert_space_before_closing_bracket=do not insert 101 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert 102 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert 103 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_exception_specification=do not insert 104 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert 105 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert 106 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert 107 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert 108 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert 109 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert 110 | org.eclipse.cdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert 111 | org.eclipse.cdt.core.formatter.insert_space_before_colon_in_base_clause=do not insert 112 | org.eclipse.cdt.core.formatter.insert_space_before_colon_in_case=do not insert 113 | org.eclipse.cdt.core.formatter.insert_space_before_colon_in_conditional=insert 114 | org.eclipse.cdt.core.formatter.insert_space_before_colon_in_default=do not insert 115 | org.eclipse.cdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert 116 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert 117 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_base_types=do not insert 118 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_declarator_list=do not insert 119 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert 120 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_expression_list=do not insert 121 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert 122 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert 123 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert 124 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_arguments=do not insert 125 | org.eclipse.cdt.core.formatter.insert_space_before_comma_in_template_parameters=do not insert 126 | org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_arguments=do not insert 127 | org.eclipse.cdt.core.formatter.insert_space_before_opening_angle_bracket_in_template_parameters=do not insert 128 | org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert 129 | org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_block=insert 130 | org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert 131 | org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_namespace_declaration=insert 132 | org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_switch=insert 133 | org.eclipse.cdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert 134 | org.eclipse.cdt.core.formatter.insert_space_before_opening_bracket=do not insert 135 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_catch=insert 136 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_exception_specification=insert 137 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_for=insert 138 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_if=insert 139 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert 140 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert 141 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert 142 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_switch=insert 143 | org.eclipse.cdt.core.formatter.insert_space_before_opening_paren_in_while=insert 144 | org.eclipse.cdt.core.formatter.insert_space_before_postfix_operator=do not insert 145 | org.eclipse.cdt.core.formatter.insert_space_before_prefix_operator=do not insert 146 | org.eclipse.cdt.core.formatter.insert_space_before_question_in_conditional=insert 147 | org.eclipse.cdt.core.formatter.insert_space_before_semicolon=do not insert 148 | org.eclipse.cdt.core.formatter.insert_space_before_semicolon_in_for=do not insert 149 | org.eclipse.cdt.core.formatter.insert_space_before_unary_operator=do not insert 150 | org.eclipse.cdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert 151 | org.eclipse.cdt.core.formatter.insert_space_between_empty_brackets=do not insert 152 | org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_exception_specification=do not insert 153 | org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert 154 | org.eclipse.cdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert 155 | org.eclipse.cdt.core.formatter.join_wrapped_lines=true 156 | org.eclipse.cdt.core.formatter.keep_else_statement_on_same_line=false 157 | org.eclipse.cdt.core.formatter.keep_empty_array_initializer_on_one_line=false 158 | org.eclipse.cdt.core.formatter.keep_imple_if_on_one_line=false 159 | org.eclipse.cdt.core.formatter.keep_then_statement_on_same_line=false 160 | org.eclipse.cdt.core.formatter.lineSplit=80 161 | org.eclipse.cdt.core.formatter.number_of_empty_lines_to_preserve=1 162 | org.eclipse.cdt.core.formatter.put_empty_statement_on_new_line=true 163 | org.eclipse.cdt.core.formatter.tabulation.char=space 164 | org.eclipse.cdt.core.formatter.tabulation.size=4 165 | org.eclipse.cdt.core.formatter.use_tabs_only_for_leading_indentations=false 166 | -------------------------------------------------------------------------------- /.settings/org.eclipse.cdt.ui.prefs: -------------------------------------------------------------------------------- 1 | eclipse.preferences.version=1 2 | formatter_profile=_K&R_space [built-in] 3 | formatter_settings_version=1 4 | -------------------------------------------------------------------------------- /CMakeLists.txt: -------------------------------------------------------------------------------- 1 | cmake_minimum_required(VERSION 3.1) 2 | 3 | project(lvgl_fb) 4 | 5 | include_directories(.) 6 | add_subdirectory(lvgl) 7 | add_subdirectory(lv_drivers) 8 | 9 | add_executable(${PROJECT_NAME} main.c mouse_cursor_icon.c) 10 | target_link_libraries(${PROJECT_NAME} PRIVATE lvgl lvgl::examples lvgl::demos lvgl::drivers) 11 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 深圳百问网科技有限公司(www.100ask.net) 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. -------------------------------------------------------------------------------- /Makefile: -------------------------------------------------------------------------------- 1 | # 2 | # Makefile 3 | # 4 | #CC ?= gcc 5 | CC := arm-buildroot-linux-gnueabihf-gcc 6 | LVGL_DIR_NAME ?= lvgl 7 | LVGL_DIR ?= ${shell pwd} 8 | CFLAGS ?= -O3 -g0 -I$(LVGL_DIR)/ -Wall -Wshadow -Wundef -Wmissing-prototypes -Wno-discarded-qualifiers -Wall -Wextra -Wno-unused-function -Wno-error=strict-prototypes -Wpointer-arith -fno-strict-aliasing -Wno-error=cpp -Wuninitialized -Wmaybe-uninitialized -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wno-cast-qual -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wformat-security -Wno-ignored-qualifiers -Wno-error=pedantic -Wno-sign-compare -Wno-error=missing-prototypes -Wdouble-promotion -Wclobbered -Wdeprecated -Wempty-body -Wtype-limits -Wshift-negative-value -Wstack-usage=2048 -Wno-unused-value -Wno-unused-parameter -Wno-missing-field-initializers -Wuninitialized -Wmaybe-uninitialized -Wall -Wextra -Wno-unused-parameter -Wno-missing-field-initializers -Wtype-limits -Wsizeof-pointer-memaccess -Wno-format-nonliteral -Wpointer-arith -Wno-cast-qual -Wmissing-prototypes -Wunreachable-code -Wno-switch-default -Wreturn-type -Wmultichar -Wno-discarded-qualifiers -Wformat-security -Wno-ignored-qualifiers -Wno-sign-compare 9 | LDFLAGS ?= -lm -ljpeg -lpthread 10 | BIN = lv_100ask_camera_demo 11 | 12 | 13 | #Collect the files to compile 14 | MAINSRC = ./main.c 15 | 16 | include $(LVGL_DIR)/lvgl/lvgl.mk 17 | include $(LVGL_DIR)/lv_drivers/lv_drivers.mk 18 | include $(LVGL_DIR)/camera_100ask/camera_100ask.mk 19 | 20 | CSRCS +=$(LVGL_DIR)/mouse_cursor_icon.c 21 | 22 | OBJEXT ?= .o 23 | 24 | AOBJS = $(ASRCS:.S=$(OBJEXT)) 25 | COBJS = $(CSRCS:.c=$(OBJEXT)) 26 | 27 | MAINOBJ = $(MAINSRC:.c=$(OBJEXT)) 28 | 29 | SRCS = $(ASRCS) $(CSRCS) $(MAINSRC) 30 | OBJS = $(AOBJS) $(COBJS) 31 | 32 | ## MAINOBJ -> OBJFILES 33 | 34 | all: default 35 | 36 | %.o: %.c 37 | @$(CC) $(CFLAGS) -c $< -o $@ 38 | @echo "CC $<" 39 | 40 | default: $(AOBJS) $(COBJS) $(MAINOBJ) 41 | $(CC) -o $(BIN) $(MAINOBJ) $(AOBJS) $(COBJS) $(LDFLAGS) 42 | 43 | clean: 44 | rm -f $(BIN) $(AOBJS) $(COBJS) $(MAINOBJ) 45 | 46 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Linux camera base on lvgl 2 | 3 | When cloning this repository, also make sure to download submodules (`git submodule update --init --recursive`) otherwise you will be missing key components. 4 | 5 | ## Help 6 | 7 | - [https://forums.100ask.net/](https://forums.100ask.net/) 8 | -------------------------------------------------------------------------------- /camera_100ask/camera_100ask.mk: -------------------------------------------------------------------------------- 1 | CAMERA_100ASK ?= camera_100ask 2 | VIDEO2LCD_DIR_NAME ?= $(CAMERA_100ASK)/video2lcd 3 | 4 | override CFLAGS := -I$(LVGL_DIR)/$(CAMERA_100ASK) -I$(LVGL_DIR)/$(VIDEO2LCD_DIR_NAME)/include -I$(LVGL_DIR)/$(VIDEO2LCD_DIR_NAME)/convert $(CFLAGS) 5 | 6 | CSRCS += $(wildcard $(LVGL_DIR)/$(CAMERA_100ASK)/assets/*.c) 7 | CSRCS += $(wildcard $(LVGL_DIR)/$(CAMERA_100ASK)/*.c) 8 | CSRCS += $(wildcard $(LVGL_DIR)/$(VIDEO2LCD_DIR_NAME)/convert/*.c) 9 | CSRCS += $(wildcard $(LVGL_DIR)/$(VIDEO2LCD_DIR_NAME)/display/*.c) 10 | CSRCS += $(wildcard $(LVGL_DIR)/$(VIDEO2LCD_DIR_NAME)/gtkdrv/*.c) 11 | CSRCS += $(wildcard $(LVGL_DIR)/$(VIDEO2LCD_DIR_NAME)/render/operation/*.c) 12 | CSRCS += $(wildcard $(LVGL_DIR)/$(VIDEO2LCD_DIR_NAME)/video/*.c) 13 | -------------------------------------------------------------------------------- /camera_100ask/camera_100ask_dev.c: -------------------------------------------------------------------------------- 1 | #include "camera_100ask_dev.h" 2 | #include "convert_to_bmp_file.h" 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | static T_VideoDevice tVideoDevice; 9 | static PT_VideoConvert ptVideoConvert; 10 | static int iPixelFormatOfVideo; 11 | static int iPixelFormatOfDisp; 12 | 13 | static PT_VideoBuf ptVideoBufCur; 14 | static T_VideoBuf tVideoBuf; 15 | static T_VideoBuf tConvertBuf; 16 | static T_VideoBuf tZoomBuf; 17 | static T_VideoBuf tFrameBuf; 18 | 19 | static int iLcdWidth; 20 | static int iLcdHeigt; 21 | static int iLcdBpp; 22 | 23 | static int g_brightness_value = 0; 24 | 25 | static camera_100ask_opt_t g_camera_opt = CAMERA_100ASK_OPT_NONE; 26 | 27 | pthread_mutex_t g_camera_100ask_mutex; 28 | 29 | static void *thread_camera_work(void *args); 30 | static void camera_set_brightness(int value); 31 | 32 | int camera_100ask_dev_init(char * dev) 33 | { 34 | int iError; 35 | 36 | pthread_mutex_init(&g_camera_100ask_mutex, NULL); 37 | 38 | /* 注册显示设备 */ 39 | DisplayInit(); 40 | /* 可能可支持多个显示设备: 选择和初始化指定的显示设备 */ 41 | SelectAndInitDefaultDispDev("fb"); 42 | GetDispResolution(&iLcdWidth, &iLcdHeigt, &iLcdBpp); 43 | GetVideoBufForDisplay(&tFrameBuf); 44 | iPixelFormatOfDisp = tFrameBuf.iPixelFormat; 45 | 46 | VideoInit(); 47 | 48 | iError = VideoDeviceInit(dev, &tVideoDevice); 49 | if (iError) 50 | { 51 | DBG_PRINTF("VideoDeviceInit for %s error!\n", dev); 52 | return -1; 53 | } 54 | iPixelFormatOfVideo = tVideoDevice.ptOPr->GetFormat(&tVideoDevice); 55 | 56 | VideoConvertInit(); 57 | ptVideoConvert = GetVideoConvertForFormats(iPixelFormatOfVideo, iPixelFormatOfDisp); 58 | if (NULL == ptVideoConvert) 59 | { 60 | DBG_PRINTF("can not support this format convert\n"); 61 | return -1; 62 | } 63 | 64 | /* 启动摄像头设备 */ 65 | iError = tVideoDevice.ptOPr->StartDevice(&tVideoDevice); 66 | if (iError) 67 | { 68 | DBG_PRINTF("StartDevice for %s error!\n", dev); 69 | return -1; 70 | } 71 | 72 | memset(&tVideoBuf, 0, sizeof(tVideoBuf)); 73 | memset(&tConvertBuf, 0, sizeof(tConvertBuf)); 74 | tConvertBuf.iPixelFormat = iPixelFormatOfDisp; 75 | tConvertBuf.tPixelDatas.iBpp = iLcdBpp; 76 | 77 | memset(&tZoomBuf, 0, sizeof(tZoomBuf)); 78 | 79 | /* 创建线程 */ 80 | pthread_t thread; 81 | pthread_create(&thread, NULL, thread_camera_work, NULL); 82 | 83 | return 0; 84 | } 85 | 86 | void camera_100ask_dev_set_opt(camera_100ask_opt_t opt) 87 | { 88 | g_camera_opt = opt; 89 | } 90 | 91 | void camera_100ask_dev_set_brightness(int value) 92 | { 93 | g_brightness_value = value; 94 | } 95 | 96 | PT_VideoBuf camera_100ask_dev_get_video_buf_cur(void) 97 | { 98 | return ptVideoBufCur; 99 | } 100 | 101 | static void camera_set_brightness(int value) 102 | { 103 | PT_VideoDevice ptVideoDevice = &tVideoDevice; 104 | 105 | struct v4l2_queryctrl qctrl; 106 | memset(&qctrl, 0, sizeof(qctrl)); 107 | qctrl.id = V4L2_CID_BRIGHTNESS; // V4L2_CID_BASE+0; 108 | if (0 != ioctl(ptVideoDevice->iFd, VIDIOC_QUERYCTRL, &qctrl)) 109 | { 110 | printf("can not query brightness\n"); 111 | return; 112 | } 113 | 114 | //printf("current value=%d, brightness min = %d, max = %d\n", value, qctrl.minimum, qctrl.maximum); 115 | 116 | struct v4l2_control ctl; 117 | ctl.id = V4L2_CID_BRIGHTNESS; // V4L2_CID_BASE+0; 118 | ioctl(ptVideoDevice->iFd, VIDIOC_G_CTRL, &ctl); 119 | 120 | ctl.value = value; 121 | 122 | if (ctl.value > qctrl.maximum) 123 | ctl.value = qctrl.maximum; 124 | if (ctl.value < qctrl.minimum) 125 | ctl.value = qctrl.minimum; 126 | 127 | ioctl(ptVideoDevice->iFd, VIDIOC_S_CTRL, &ctl); 128 | 129 | } 130 | 131 | static void *thread_camera_work(void *args) 132 | { 133 | int iError; 134 | float k; 135 | int iTopLeftX; 136 | int iTopLeftY; 137 | 138 | time_t timep; 139 | struct tm *p; 140 | char time_buffer [64]; 141 | 142 | while(1) 143 | { 144 | pthread_mutex_lock(&g_camera_100ask_mutex); 145 | /* 读入摄像头数据 */ 146 | int iError; 147 | iError = tVideoDevice.ptOPr->GetFrame(&tVideoDevice, &tVideoBuf); 148 | if (iError) 149 | { 150 | DBG_PRINTF("GetFrame for error!\n"); 151 | //return; 152 | } 153 | ptVideoBufCur = &tVideoBuf; 154 | 155 | if (iPixelFormatOfVideo != iPixelFormatOfDisp) 156 | { 157 | /* 转换为RGB */ 158 | iError = ptVideoConvert->Convert(&tVideoBuf, &tConvertBuf); 159 | //DBG_PRINTF("Convert %s, ret = %d\n", ptVideoConvert->name, iError); 160 | if (iError) 161 | { 162 | DBG_PRINTF("Convert for error!\n"); 163 | //return; 164 | } 165 | ptVideoBufCur = &tConvertBuf; 166 | } 167 | 168 | /* 如果图像分辨率大于LCD, 缩放 */ 169 | if (ptVideoBufCur->tPixelDatas.iWidth > iLcdWidth || ptVideoBufCur->tPixelDatas.iHeight > iLcdHeigt) 170 | { 171 | /* 确定缩放后的分辨率 */ 172 | /* 把图片按比例缩放到VideoMem上, 居中显示 173 | * 1. 先算出缩放后的大小 174 | */ 175 | k = (float)ptVideoBufCur->tPixelDatas.iHeight / ptVideoBufCur->tPixelDatas.iWidth; 176 | tZoomBuf.tPixelDatas.iWidth = iLcdWidth; 177 | tZoomBuf.tPixelDatas.iHeight = iLcdWidth * k; 178 | if ( tZoomBuf.tPixelDatas.iHeight > iLcdHeigt) 179 | { 180 | tZoomBuf.tPixelDatas.iWidth = iLcdHeigt / k; 181 | tZoomBuf.tPixelDatas.iHeight = iLcdHeigt; 182 | } 183 | tZoomBuf.tPixelDatas.iBpp = iLcdBpp; 184 | tZoomBuf.tPixelDatas.iLineBytes = tZoomBuf.tPixelDatas.iWidth * tZoomBuf.tPixelDatas.iBpp / 8; 185 | tZoomBuf.tPixelDatas.iTotalBytes = tZoomBuf.tPixelDatas.iLineBytes * tZoomBuf.tPixelDatas.iHeight; 186 | 187 | if (!tZoomBuf.tPixelDatas.aucPixelDatas) 188 | { 189 | tZoomBuf.tPixelDatas.aucPixelDatas = malloc(tZoomBuf.tPixelDatas.iTotalBytes); 190 | } 191 | 192 | PicZoom(&ptVideoBufCur->tPixelDatas, &tZoomBuf.tPixelDatas); 193 | ptVideoBufCur = &tZoomBuf; 194 | } 195 | 196 | /* 合并进framebuffer */ 197 | /* 接着算出居中显示时左上角坐标 */ 198 | //iTopLeftX = (iLcdWidth - ptVideoBufCur->tPixelDatas.iWidth) / 2; 199 | //iTopLeftY = (iLcdHeigt - ptVideoBufCur->tPixelDatas.iHeight) / 2; 200 | 201 | //PicMerge(iTopLeftX, iTopLeftY, &ptVideoBufCur->tPixelDatas, &tFrameBuf.tPixelDatas); 202 | 203 | //FlushPixelDatasToDev(&tFrameBuf.tPixelDatas); 204 | 205 | iError = tVideoDevice.ptOPr->PutFrame(&tVideoDevice, &tVideoBuf); 206 | if (iError) 207 | { 208 | DBG_PRINTF("PutFrame for error!\n"); 209 | } 210 | 211 | pthread_mutex_unlock(&g_camera_100ask_mutex); 212 | 213 | switch (g_camera_opt) 214 | { 215 | case CAMERA_100ASK_OPT_UPDATE_BRIGHTNESS: 216 | camera_set_brightness(g_brightness_value); 217 | g_camera_opt = CAMERA_100ASK_OPT_NONE; 218 | break; 219 | case CAMERA_100ASK_OPT_TAKE_PHOTOS: 220 | time (&timep); 221 | p=gmtime(&timep); 222 | strftime (time_buffer, sizeof(time_buffer),"100ask-picture-%Y%m%d-%H%M%S.bmp",p); 223 | printf("photos name: %s\n", time_buffer); 224 | CvtRgb2BMPFileFrmFrameBuffer(ptVideoBufCur->tPixelDatas.aucPixelDatas, ptVideoBufCur->tPixelDatas.iWidth, ptVideoBufCur->tPixelDatas.iHeight, ptVideoBufCur->tPixelDatas.iBpp, time_buffer); 225 | g_camera_opt = CAMERA_100ASK_OPT_NONE; 226 | break; 227 | case CAMERA_100ASK_OPT_TAKE_VIDEO: 228 | g_camera_opt = CAMERA_100ASK_OPT_NONE; 229 | break; 230 | case CAMERA_100ASK_OPT_NONE: 231 | default: 232 | break; 233 | } 234 | } 235 | 236 | return NULL; 237 | } 238 | 239 | -------------------------------------------------------------------------------- /camera_100ask/camera_100ask_dev.h: -------------------------------------------------------------------------------- 1 | #ifndef CAMERA_100ASK_DEV_H 2 | #define CAMERA_100ASK_DEV_H 3 | 4 | #include 5 | #include 6 | #include 7 | #include 8 | #include 9 | 10 | typedef enum { 11 | CAMERA_100ASK_OPT_NONE = 0, 12 | CAMERA_100ASK_OPT_UPDATE_BRIGHTNESS, 13 | CAMERA_100ASK_OPT_TAKE_PHOTOS, 14 | CAMERA_100ASK_OPT_TAKE_VIDEO, 15 | } camera_100ask_opt_t; 16 | 17 | int camera_100ask_dev_init(char * dev); 18 | 19 | void camera_100ask_dev_set_brightness(int value); 20 | 21 | PT_VideoBuf camera_100ask_dev_get_video_buf_cur(void); 22 | 23 | #endif /*CAMERA_100ASK_DEV_H*/ 24 | -------------------------------------------------------------------------------- /camera_100ask/camera_100ask_ui.c: -------------------------------------------------------------------------------- 1 | #include "camera_100ask_ui.h" 2 | #include "camera_100ask_dev.h" 3 | #include 4 | 5 | #define PATH_FILE_NAME_LEN 256 6 | #define BLINK_TIME 200 /*ms*/ 7 | #define BOOT_TIME 1500 8 | 9 | typedef struct{ 10 | uint8_t * name; // 蛇身 11 | } photo_file_t; 12 | 13 | static uint8_t g_dir_path[PATH_FILE_NAME_LEN]; 14 | static lv_img_dsc_t * img_dsc; 15 | static photo_file_t * g_node_ll; 16 | static lv_ll_t photo_file_ll; 17 | static lv_obj_t * g_obj_blink; 18 | static lv_obj_t * g_slider_label_setting; 19 | static lv_obj_t * g_img_photo_browser; 20 | 21 | extern pthread_mutex_t g_camera_100ask_mutex; 22 | static void lv_100ask_boot_animation(uint32_t boot_time); 23 | static void lv_100ask_boot_animation(uint32_t boot_time); 24 | static void camera_startup_timer(lv_timer_t * timer); 25 | static void camera_work_timer(lv_timer_t * timer); 26 | static void blink_timer(lv_timer_t * timer); 27 | 28 | static void btn_capture_event_handler(lv_event_t * e); 29 | static void btn_setting_event_handler(lv_event_t * e); 30 | static void slider_setting_event_cb(lv_event_t * e); 31 | 32 | static void btn_photo_browser_event_handler(lv_event_t * e); 33 | static void btn_open_photo_browser_event_handler(lv_event_t * e); 34 | 35 | static bool is_end_with(const char * str1, const char * str2); 36 | 37 | 38 | void camera_100ask_ui_init(void) 39 | { 40 | lv_100ask_boot_animation(BOOT_TIME); 41 | 42 | lv_obj_t * cont = lv_obj_create(lv_scr_act()); 43 | lv_obj_set_style_radius(cont, 0, 0); 44 | lv_obj_set_style_pad_all(cont, 0, 0); 45 | lv_obj_set_size(cont, LV_HOR_RES, LV_VER_RES); 46 | lv_obj_set_y(cont, 0); 47 | 48 | lv_obj_fade_in(cont, 0, BOOT_TIME); 49 | 50 | img_dsc = lv_mem_alloc(sizeof(lv_img_dsc_t)); 51 | lv_memset_00(img_dsc, sizeof(lv_img_dsc_t)); 52 | 53 | lv_obj_t * img = lv_img_create(cont); 54 | lv_img_set_antialias(img, true); 55 | lv_obj_center(img); 56 | lv_timer_t * timer = lv_timer_create(camera_startup_timer, BOOT_TIME, img); 57 | lv_timer_set_repeat_count(timer, 1); 58 | 59 | /*Blinking effect*/ 60 | g_obj_blink = lv_obj_create(cont); 61 | lv_obj_set_style_border_width(g_obj_blink, 0, 0); 62 | lv_obj_set_style_pad_all(g_obj_blink, 0, 0); 63 | lv_obj_set_style_radius(g_obj_blink, 0, 0); 64 | lv_obj_set_size(g_obj_blink, LV_HOR_RES, LV_VER_RES); 65 | lv_obj_set_style_bg_color(g_obj_blink, lv_color_hex(0x000000), 0); 66 | lv_obj_add_flag(g_obj_blink, LV_OBJ_FLAG_HIDDEN); 67 | 68 | 69 | /*btn_capture*/ 70 | static lv_style_t style; 71 | lv_style_init(&style); 72 | 73 | lv_style_set_radius(&style, LV_RADIUS_CIRCLE); 74 | 75 | lv_style_set_bg_opa(&style, LV_OPA_100); 76 | lv_style_set_bg_color(&style, lv_color_hex(0xffffff)); 77 | 78 | lv_style_set_border_opa(&style, LV_OPA_40); 79 | lv_style_set_border_width(&style, 2); 80 | lv_style_set_border_color(&style, lv_color_hex(0x000000)); 81 | 82 | lv_style_set_outline_opa(&style, LV_OPA_COVER); 83 | lv_style_set_outline_color(&style, lv_color_hex(0x000000)); 84 | 85 | lv_style_set_text_color(&style, lv_color_white()); 86 | lv_style_set_pad_all(&style, 10); 87 | 88 | /*Init the pressed style*/ 89 | static lv_style_t style_pr; 90 | lv_style_init(&style_pr); 91 | 92 | /*Ad a large outline when pressed*/ 93 | lv_style_set_outline_width(&style_pr, 15); 94 | lv_style_set_outline_opa(&style_pr, LV_OPA_TRANSP); 95 | 96 | lv_style_set_translate_y(&style_pr, 5); 97 | //lv_style_set_shadow_ofs_y(&style_pr, 3); 98 | lv_style_set_bg_color(&style_pr, lv_color_hex(0xffffff)); 99 | lv_style_set_bg_grad_color(&style_pr, lv_palette_main(LV_PALETTE_GREEN)); 100 | 101 | /*Add a transition to the the outline*/ 102 | static lv_style_transition_dsc_t trans; 103 | static lv_style_prop_t props[] = {LV_STYLE_OUTLINE_WIDTH, LV_STYLE_OUTLINE_OPA, 0}; 104 | lv_style_transition_dsc_init(&trans, props, lv_anim_path_linear, 300, 0, NULL); 105 | lv_style_set_transition(&style_pr, &trans); 106 | 107 | lv_obj_t * cont_capture = lv_obj_create(cont); 108 | lv_obj_set_size(cont_capture, 100, 100); 109 | lv_obj_set_align(cont_capture, LV_ALIGN_BOTTOM_MID); 110 | lv_obj_clear_flag(cont_capture, LV_OBJ_FLAG_SCROLLABLE); 111 | lv_obj_set_style_radius(cont_capture, LV_RADIUS_CIRCLE, 0); 112 | lv_obj_set_style_border_width(cont_capture, 0, 0); 113 | 114 | lv_obj_t * btn_capture = lv_btn_create(cont_capture); 115 | lv_obj_set_size(btn_capture, 75, 75); 116 | lv_obj_set_align(btn_capture, LV_ALIGN_CENTER); 117 | 118 | lv_obj_add_style(btn_capture, &style, 0); 119 | lv_obj_add_style(btn_capture, &style_pr, LV_STATE_PRESSED); 120 | 121 | lv_obj_add_event_cb(btn_capture, btn_capture_event_handler, LV_EVENT_ALL, NULL); 122 | 123 | /*camera setting*/ 124 | lv_obj_t * btn_setting = lv_btn_create(cont); 125 | lv_obj_set_style_radius(btn_setting, LV_RADIUS_CIRCLE, 0); 126 | lv_obj_set_size(btn_setting, 50, 50); 127 | lv_obj_align_to(btn_setting, cont_capture, LV_ALIGN_OUT_RIGHT_MID, (LV_VER_RES / 4), 0); 128 | 129 | lv_obj_t * label_setting = lv_label_create(btn_setting); 130 | lv_obj_set_style_text_font(label_setting, &lv_font_montserrat_28, 0); 131 | lv_label_set_text(label_setting, LV_SYMBOL_SETTINGS); 132 | lv_obj_set_align(label_setting, LV_ALIGN_CENTER); 133 | 134 | // slider setting 135 | lv_obj_t * slider_setting = lv_slider_create(cont); 136 | lv_slider_set_mode(slider_setting, LV_SLIDER_MODE_SYMMETRICAL); 137 | lv_slider_set_range(slider_setting, -255, 255); 138 | lv_obj_add_flag(slider_setting, LV_OBJ_FLAG_HIDDEN); 139 | lv_obj_align_to(slider_setting, btn_setting, LV_ALIGN_OUT_TOP_MID, 0, -10); 140 | 141 | /*Create a label below the slider*/ 142 | g_slider_label_setting = lv_label_create(cont); 143 | lv_label_set_text(g_slider_label_setting, "camera brightness:0"); 144 | lv_obj_add_flag(g_slider_label_setting, LV_OBJ_FLAG_HIDDEN); 145 | 146 | lv_obj_align_to(g_slider_label_setting, slider_setting, LV_ALIGN_OUT_TOP_MID, 0, -10); 147 | 148 | lv_obj_add_event_cb(btn_setting, btn_setting_event_handler, LV_EVENT_CLICKED, slider_setting); 149 | lv_obj_add_event_cb(slider_setting, slider_setting_event_cb, LV_EVENT_VALUE_CHANGED, g_slider_label_setting); 150 | 151 | /*Photo Browser*/ 152 | lv_obj_t * btn_open_photo_browser = lv_btn_create(cont); 153 | lv_obj_set_style_radius(btn_open_photo_browser, LV_RADIUS_CIRCLE, 0); 154 | lv_obj_set_size(btn_open_photo_browser, 50, 50); 155 | lv_obj_align_to(btn_open_photo_browser, cont_capture, LV_ALIGN_OUT_LEFT_MID, -(LV_VER_RES / 4), 0); 156 | 157 | lv_obj_t * label_photo_browser = lv_label_create(btn_open_photo_browser); 158 | lv_obj_set_style_text_font(label_photo_browser, &lv_font_montserrat_28, 0); 159 | lv_label_set_text(label_photo_browser, LV_SYMBOL_IMAGE); 160 | lv_obj_set_align(label_photo_browser, LV_ALIGN_CENTER); 161 | 162 | lv_obj_t * cont_photo_browser = lv_obj_create(cont); 163 | lv_obj_set_size(cont_photo_browser, LV_PCT(100), LV_PCT(100)); 164 | lv_obj_set_style_pad_all(cont_photo_browser, 0, 0); 165 | lv_obj_set_style_radius(cont_photo_browser, 0, 0); 166 | lv_obj_set_align(cont_photo_browser, LV_ALIGN_CENTER); 167 | lv_obj_add_flag(cont_photo_browser, LV_OBJ_FLAG_HIDDEN); 168 | 169 | g_img_photo_browser = lv_img_create(cont_photo_browser); 170 | //lv_img_set_src(g_img_photo_browser, "//mnt/100ask-picture-20230803-105727.bmp"); 171 | //lv_img_set_src(g_img_photo_browser, "//mnt/12345.bmp"); 172 | //lv_img_set_src(g_img_photo_browser, "//mnt/test.png"); 173 | lv_obj_set_align(g_img_photo_browser, LV_ALIGN_CENTER); 174 | 175 | lv_obj_t * btn_photo_browser_pre = lv_btn_create(cont_photo_browser); 176 | lv_obj_set_style_radius(btn_photo_browser_pre, LV_RADIUS_CIRCLE, 0); 177 | lv_obj_set_size(btn_photo_browser_pre, 50, 50); 178 | lv_obj_align(btn_photo_browser_pre, LV_ALIGN_LEFT_MID, 0, 0); 179 | 180 | lv_obj_t * label_photo_browser_pre = lv_label_create(btn_photo_browser_pre); 181 | lv_obj_set_style_text_font(label_photo_browser_pre, &lv_font_montserrat_28, 0); 182 | lv_label_set_text(label_photo_browser_pre, LV_SYMBOL_LEFT); 183 | lv_obj_set_align(label_photo_browser_pre, LV_ALIGN_CENTER); 184 | 185 | lv_obj_t * btn_photo_browser_next = lv_btn_create(cont_photo_browser); 186 | lv_obj_set_style_radius(btn_photo_browser_next, LV_RADIUS_CIRCLE, 0); 187 | lv_obj_set_size(btn_photo_browser_next, 50, 50); 188 | lv_obj_align(btn_photo_browser_next, LV_ALIGN_RIGHT_MID, 0, 0); 189 | 190 | lv_obj_t * label_photo_browser_next = lv_label_create(btn_photo_browser_next); 191 | lv_obj_set_style_text_font(label_photo_browser_next, &lv_font_montserrat_28, 0); 192 | lv_label_set_text(label_photo_browser_next, LV_SYMBOL_RIGHT); 193 | lv_obj_set_align(label_photo_browser_next, LV_ALIGN_CENTER); 194 | 195 | lv_obj_add_event_cb(btn_photo_browser_pre, btn_photo_browser_event_handler, LV_EVENT_CLICKED, label_photo_browser_pre); 196 | lv_obj_add_event_cb(btn_photo_browser_next, btn_photo_browser_event_handler, LV_EVENT_CLICKED, label_photo_browser_next); 197 | lv_obj_add_event_cb(btn_open_photo_browser, btn_open_photo_browser_event_handler, LV_EVENT_CLICKED, cont_photo_browser); 198 | 199 | } 200 | 201 | static void lv_100ask_boot_animation(uint32_t boot_time) 202 | { 203 | LV_IMG_DECLARE(img_lv_100ask_demo_logo); 204 | lv_obj_t * logo = lv_img_create(lv_scr_act()); 205 | lv_img_set_src(logo, &img_lv_100ask_demo_logo); 206 | lv_obj_align(logo, LV_ALIGN_CENTER, 0, 0); 207 | 208 | /*Animate in the content after the intro time*/ 209 | lv_anim_t a; 210 | lv_anim_init(&a); 211 | lv_anim_set_path_cb(&a, lv_anim_path_bounce); 212 | lv_anim_set_path_cb(&a, lv_anim_path_overshoot); 213 | lv_anim_set_var(&a, logo); 214 | lv_anim_set_time(&a, boot_time); 215 | lv_anim_set_delay(&a, 0); 216 | lv_anim_set_values(&a, 1, LV_IMG_ZOOM_NONE); 217 | lv_anim_set_exec_cb(&a, (lv_anim_exec_xcb_t) lv_img_set_zoom); 218 | lv_anim_set_ready_cb(&a, lv_obj_del_anim_ready_cb); 219 | lv_anim_start(&a); 220 | 221 | /* Create an intro from a label */ 222 | lv_obj_t * title = lv_label_create(lv_scr_act()); 223 | //lv_label_set_text(title, "100ASK LVGL DEMO\nhttps://www.100ask.net\nhttp:/lvgl.100ask.net"); 224 | lv_label_set_text(title, "100ASK LVGL DEMO"); 225 | lv_obj_set_style_text_font(title, &lv_font_montserrat_22, LV_STATE_DEFAULT); // Please enable LV_FONT_MONTSERRAT_22 in lv_conf.h 226 | lv_obj_set_style_text_line_space(title, 8, LV_STATE_DEFAULT); 227 | lv_obj_align_to(title, logo, LV_ALIGN_OUT_BOTTOM_MID, 0, 0); 228 | 229 | lv_obj_fade_out(title, 0, boot_time); 230 | lv_obj_fade_out(logo, 0, boot_time); 231 | } 232 | 233 | 234 | static void camera_startup_timer(lv_timer_t * timer) 235 | { 236 | lv_obj_t * img = (lv_obj_t *)timer->user_data; 237 | lv_timer_create(camera_work_timer, 0, img); 238 | } 239 | 240 | static void camera_work_timer(lv_timer_t * timer) 241 | { 242 | /*Use the user_data*/ 243 | lv_obj_t * img = (lv_obj_t *)timer->user_data; 244 | 245 | /*Do something with LVGL*/ 246 | pthread_mutex_lock(&g_camera_100ask_mutex); 247 | PT_VideoBuf VideoBufCur = camera_100ask_dev_get_video_buf_cur(); 248 | PT_PixelDatas ptSmallPic = &VideoBufCur->tPixelDatas; 249 | img_dsc->data = ptSmallPic->aucPixelDatas; 250 | img_dsc->data_size = (VideoBufCur->tPixelDatas.iBpp / 8) * VideoBufCur->tPixelDatas.iWidth * VideoBufCur->tPixelDatas.iHeight; 251 | 252 | img_dsc->header.w = VideoBufCur->tPixelDatas.iWidth; 253 | img_dsc->header.h = VideoBufCur->tPixelDatas.iHeight; 254 | img_dsc->header.cf = LV_IMG_CF_TRUE_COLOR; 255 | lv_img_set_src(img, img_dsc); 256 | 257 | pthread_mutex_unlock(&g_camera_100ask_mutex); 258 | 259 | } 260 | 261 | static void blink_timer(lv_timer_t * timer) 262 | { 263 | lv_obj_add_flag(g_obj_blink, LV_OBJ_FLAG_HIDDEN); 264 | } 265 | 266 | static void btn_capture_event_handler(lv_event_t * e) 267 | { 268 | lv_event_code_t code = lv_event_get_code(e); 269 | lv_obj_t * btn_capture = lv_event_get_target(e); 270 | 271 | if(code == LV_EVENT_CLICKED) { 272 | camera_100ask_dev_set_opt(CAMERA_100ASK_OPT_TAKE_PHOTOS); 273 | 274 | lv_obj_clear_flag(g_obj_blink, LV_OBJ_FLAG_HIDDEN); 275 | 276 | lv_timer_t * timer = lv_timer_create(blink_timer, BLINK_TIME, NULL); 277 | lv_timer_set_repeat_count(timer, 1); 278 | } 279 | } 280 | 281 | 282 | static void btn_setting_event_handler(lv_event_t * e) 283 | { 284 | lv_event_code_t code = lv_event_get_code(e); 285 | lv_obj_t * slider_setting = lv_event_get_user_data(e); 286 | 287 | if(code == LV_EVENT_CLICKED) { 288 | if(lv_obj_has_flag(slider_setting, LV_OBJ_FLAG_HIDDEN)) 289 | { 290 | lv_obj_clear_flag(slider_setting, LV_OBJ_FLAG_HIDDEN); 291 | lv_obj_clear_flag(g_slider_label_setting, LV_OBJ_FLAG_HIDDEN); 292 | } 293 | else 294 | { 295 | lv_obj_add_flag(slider_setting, LV_OBJ_FLAG_HIDDEN); 296 | lv_obj_add_flag(g_slider_label_setting, LV_OBJ_FLAG_HIDDEN); 297 | } 298 | } 299 | } 300 | 301 | static void slider_setting_event_cb(lv_event_t * e) 302 | { 303 | lv_obj_t * slider_setting = lv_event_get_target(e); 304 | lv_obj_t * slider_label_setting = lv_event_get_user_data(e); 305 | 306 | int slider_value = (int)lv_slider_get_value(slider_setting); 307 | 308 | char buf[32]; 309 | lv_snprintf(buf, sizeof(buf), "camera brightness: %d", slider_value); 310 | lv_label_set_text(slider_label_setting, buf); 311 | //lv_obj_align_to(slider_label_setting, slider, LV_ALIGN_OUT_TOP_MID, 0, -10); 312 | 313 | camera_100ask_dev_set_brightness(slider_value); 314 | camera_100ask_dev_set_opt(CAMERA_100ASK_OPT_UPDATE_BRIGHTNESS); 315 | } 316 | 317 | 318 | static void btn_open_photo_browser_event_handler(lv_event_t * e) 319 | { 320 | lv_event_code_t code = lv_event_get_code(e); 321 | lv_obj_t * btn = lv_event_get_target(e); 322 | lv_obj_t * cont_photo_browse = lv_event_get_user_data(e); 323 | 324 | char file_path_name[PATH_FILE_NAME_LEN]; 325 | 326 | if(code == LV_EVENT_CLICKED) { 327 | lv_obj_move_foreground(btn); 328 | if(lv_obj_has_flag(cont_photo_browse, LV_OBJ_FLAG_HIDDEN)) 329 | { 330 | _lv_ll_init(&photo_file_ll, sizeof(photo_file_t)); 331 | 332 | lv_snprintf(g_dir_path, sizeof(g_dir_path), "/%s", getcwd(NULL, 0)); 333 | 334 | lv_fs_dir_t dir; 335 | lv_fs_res_t res; 336 | res = lv_fs_dir_open(&dir, g_dir_path); 337 | if(res != LV_FS_RES_OK) { 338 | LV_LOG_USER("Open dir error %d!", res); 339 | return; 340 | } 341 | 342 | char fn[PATH_FILE_NAME_LEN]; 343 | photo_file_t * node_ll; 344 | while(1) { 345 | res = lv_fs_dir_read(&dir, fn); 346 | if(res != LV_FS_RES_OK) { 347 | LV_LOG_USER("Driver, file or directory is not exists %d!", res); 348 | break; 349 | } 350 | 351 | /*fn is empty, if not more files to read*/ 352 | if(strlen(fn) == 0) { 353 | LV_LOG_USER("Not more files to read!"); 354 | break; 355 | } 356 | 357 | // 识别并文件 358 | if ((is_end_with(fn, ".png") == true) || (is_end_with(fn, ".PNG") == true) ||\ 359 | (is_end_with(fn , ".jpg") == true) || (is_end_with(fn , ".JPG") == true) ||\ 360 | (is_end_with(fn , ".sjpg") == true) || (is_end_with(fn , ".SJPG") == true) ||\ 361 | (is_end_with(fn , ".bmp") == true) || (is_end_with(fn , ".BMP") == true)) 362 | { 363 | node_ll = _lv_ll_ins_tail(&photo_file_ll); 364 | node_ll->name = lv_mem_alloc(strlen(fn)); 365 | strcpy(node_ll->name, fn); 366 | LV_LOG_USER("%s", node_ll->name); 367 | } 368 | } 369 | 370 | lv_fs_dir_close(&dir); 371 | 372 | g_node_ll = _lv_ll_get_tail(&photo_file_ll); // r 373 | lv_snprintf(file_path_name, sizeof(file_path_name), "%s/%s", g_dir_path, g_node_ll->name); 374 | lv_img_set_src(g_img_photo_browser, file_path_name); 375 | 376 | lv_obj_clear_flag(cont_photo_browse, LV_OBJ_FLAG_HIDDEN); 377 | } 378 | else 379 | { 380 | photo_file_t * node_ll = _lv_ll_get_head(&photo_file_ll); 381 | while(node_ll != NULL) 382 | { 383 | lv_mem_free(node_ll->name); 384 | node_ll = _lv_ll_get_next(&photo_file_ll, node_ll); 385 | } 386 | _lv_ll_clear(&photo_file_ll); 387 | 388 | g_node_ll = NULL; 389 | 390 | lv_obj_add_flag(cont_photo_browse, LV_OBJ_FLAG_HIDDEN); 391 | } 392 | } 393 | } 394 | 395 | 396 | static void btn_photo_browser_event_handler(lv_event_t * e) 397 | { 398 | lv_event_code_t code = lv_event_get_code(e); 399 | lv_obj_t * btn = lv_event_get_target(e); 400 | lv_obj_t * label = lv_event_get_user_data(e); 401 | photo_file_t * tmp_node_ll; 402 | char file_path_name[PATH_FILE_NAME_LEN]; 403 | 404 | if(code == LV_EVENT_CLICKED) { 405 | 406 | if((strcmp(LV_SYMBOL_LEFT, lv_label_get_text(label)) == 0)) 407 | { 408 | 409 | tmp_node_ll = _lv_ll_get_prev(&photo_file_ll, g_node_ll); 410 | if(tmp_node_ll != NULL) 411 | { 412 | g_node_ll = _lv_ll_get_prev(&photo_file_ll, g_node_ll); 413 | } 414 | 415 | lv_snprintf(file_path_name, sizeof(file_path_name), "%s/%s", g_dir_path, g_node_ll->name); 416 | lv_img_set_src(g_img_photo_browser, file_path_name); 417 | LV_LOG_USER("Open %s", g_node_ll->name); 418 | } 419 | else if((strcmp(LV_SYMBOL_RIGHT, lv_label_get_text(label)) == 0)) 420 | { 421 | tmp_node_ll = _lv_ll_get_next(&photo_file_ll, g_node_ll); 422 | if(tmp_node_ll != NULL) 423 | { 424 | g_node_ll = _lv_ll_get_next(&photo_file_ll, g_node_ll); 425 | } 426 | 427 | lv_snprintf(file_path_name, sizeof(file_path_name), "%s/%s", g_dir_path, g_node_ll->name); 428 | lv_img_set_src(g_img_photo_browser, file_path_name); 429 | LV_LOG_USER("Open %s", g_node_ll->name); 430 | } 431 | } 432 | } 433 | 434 | 435 | 436 | static bool is_end_with(const char * str1, const char * str2) 437 | { 438 | if(str1 == NULL || str2 == NULL) 439 | return false; 440 | 441 | uint16_t len1 = strlen(str1); 442 | uint16_t len2 = strlen(str2); 443 | if((len1 < len2) || (len1 == 0 || len2 == 0)) 444 | return false; 445 | 446 | while(len2 >= 1) 447 | { 448 | if(str2[len2 - 1] != str1[len1 - 1]) 449 | return false; 450 | 451 | len2--; 452 | len1--; 453 | } 454 | 455 | return true; 456 | } -------------------------------------------------------------------------------- /camera_100ask/camera_100ask_ui.h: -------------------------------------------------------------------------------- 1 | #ifndef CAMERA_100ASK_UI_H 2 | #define CAMERA_100ASK_UI_H 3 | 4 | #include "lvgl/lvgl.h" 5 | #include 6 | 7 | void camera_100ask_ui_init(void); 8 | 9 | #endif /*CAMERA_100ASK_UI_H*/ 10 | -------------------------------------------------------------------------------- /camera_100ask/convert_to_bmp_file.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "convert_to_bmp_file.h" 6 | 7 | typedef struct tagBITMAPFILEHEADER { 8 | UINT16 bfType; 9 | UINT32 bfSize; 10 | UINT16 bfReserved1; 11 | UINT16 bfReserved2; 12 | UINT32 bfOffBits; 13 | } __attribute__ ((packed)) BITMAPFILEHEADER, *PBITMAPFILEHEADER; 14 | 15 | typedef struct tagBITMAPINFOHEADER{ 16 | UINT32 biSize; 17 | UINT32 biwidth; 18 | UINT32 biheight; 19 | UINT16 biPlanes; 20 | UINT16 biBitCount; 21 | UINT32 biCompression; 22 | UINT32 biSizeImage; 23 | UINT32 biXPelsPerMeter; 24 | UINT32 biYPelsPerMeter; 25 | UINT32 biClrUsed; 26 | UINT32 biClrImportant; 27 | } __attribute__ ((packed)) BITMAPINFOHEADER, *PBITMAPINFOHEADER; 28 | 29 | typedef struct tagRGBQUAD { 30 | UINT8 rgbBlue; 31 | UINT8 rgbGreen; 32 | UINT8 rgbRed; 33 | UINT8 rgbReserved; 34 | } __attribute__ ((packed)) RGBQUAD; 35 | 36 | 37 | 38 | 39 | int CvtRgb2BMPFileFrmFrameBuffer(unsigned char * pRgb, UINT32 dwWidth, UINT32 dwHeight, UINT32 dwBpp, char *outfilename) 40 | { 41 | BITMAPFILEHEADER tBmpFileHead; 42 | BITMAPINFOHEADER tBmpInfoHead; 43 | 44 | UINT32 dwSize; 45 | 46 | unsigned char *pPos = 0; 47 | 48 | FILE * fout; 49 | 50 | memset(&tBmpFileHead, 0, sizeof(BITMAPFILEHEADER)); 51 | memset(&tBmpInfoHead, 0, sizeof(BITMAPINFOHEADER)); 52 | 53 | fout = fopen(outfilename, "w"); 54 | 55 | if (!fout) 56 | { 57 | printf("Can't create output file %s\n", outfilename); 58 | return -2; 59 | } 60 | 61 | tBmpFileHead.bfType = 0x4d42; 62 | tBmpFileHead.bfSize = 0x36 + dwWidth * dwHeight * (dwBpp / 8); 63 | tBmpFileHead.bfOffBits = 0x00000036; 64 | 65 | tBmpInfoHead.biSize = 0x00000028; 66 | tBmpInfoHead.biwidth = dwWidth; 67 | tBmpInfoHead.biheight = dwHeight; 68 | tBmpInfoHead.biPlanes = 0x0001; 69 | tBmpInfoHead.biBitCount = dwBpp; 70 | tBmpInfoHead.biCompression = 0; 71 | tBmpInfoHead.biSizeImage = dwWidth * dwHeight * (dwBpp / 8); 72 | tBmpInfoHead.biXPelsPerMeter = 0; 73 | tBmpInfoHead.biYPelsPerMeter = 0; 74 | tBmpInfoHead.biClrUsed = 0; 75 | tBmpInfoHead.biClrImportant = 0; 76 | 77 | //printf("dwBpp=%d, dwWidth=%d, dwHeight=%d\n", dwBpp, dwWidth, dwHeight); 78 | 79 | if (fwrite(&tBmpFileHead, 1, sizeof(tBmpFileHead), fout) != sizeof(tBmpFileHead)) 80 | { 81 | printf("Can't write BMP File Head to %s\n", outfilename); 82 | return -3; 83 | } 84 | 85 | if (fwrite(&tBmpInfoHead, 1, sizeof(tBmpInfoHead), fout) != sizeof(tBmpInfoHead)) 86 | { 87 | printf("Can't write BMP File Info Head to %s\n", outfilename); 88 | return -4; 89 | } 90 | 91 | dwSize = dwWidth * dwBpp / 8; 92 | pPos = pRgb + (dwHeight - 1) * dwSize; 93 | 94 | while (pPos >= pRgb) 95 | { 96 | if (fwrite(pPos, 1, dwSize, fout) != dwSize) 97 | { 98 | printf("Can't write date to BMP File %s\n", outfilename); 99 | return -5; 100 | } 101 | pPos -= dwSize; 102 | } 103 | 104 | fclose(fout); 105 | 106 | return 0; 107 | } 108 | 109 | -------------------------------------------------------------------------------- /camera_100ask/convert_to_bmp_file.h: -------------------------------------------------------------------------------- 1 | #ifndef CONVERT_TO_BMP_FILE_H 2 | #define CONVERT_TO_BMP_FILE_H 3 | 4 | #include "types.h" 5 | 6 | int CvtRgb2BMPFileFrmFrameBuffer(unsigned char * pRgb, UINT32 dwWidth, UINT32 dwHeight, UINT32 dwBpp, char *outfilename); 7 | 8 | #endif /*CONVERT_TO_BMP_FILE_H*/ 9 | -------------------------------------------------------------------------------- /camera_100ask/types.h: -------------------------------------------------------------------------------- 1 | /* 2 | * types.h 3 | */ 4 | 5 | #ifndef __TYPES_H__ 6 | #define __TYPES_H__ 7 | 8 | #ifndef UINT8 9 | #define UINT8 unsigned char 10 | #endif 11 | 12 | #ifndef UINT16 13 | #define UINT16 unsigned short 14 | #endif 15 | 16 | #ifndef UINT32 17 | #define UINT32 unsigned int 18 | #endif 19 | 20 | #ifndef INT8 21 | #define INT8 char 22 | #endif 23 | 24 | #ifndef INT16 25 | #define INT16 short 26 | #endif 27 | 28 | #ifndef INT32 29 | #define INT32 int 30 | #endif 31 | 32 | 33 | #ifndef NULL 34 | #define NULL 0 35 | #endif 36 | 37 | 38 | #ifndef __s8 39 | #define __s8 signed char 40 | #endif 41 | 42 | #ifndef __u8 43 | #define __u8 unsigned char 44 | #endif 45 | 46 | #ifndef __s16 47 | #define __s16 signed short 48 | #endif 49 | 50 | #ifndef __u16 51 | #define __u16 unsigned short 52 | #endif 53 | 54 | #ifndef __s32 55 | #define __s32 signed int 56 | #endif 57 | 58 | #ifndef __u32 59 | #define __u32 unsigned int 60 | #endif 61 | 62 | 63 | // Internal macros. 64 | 65 | #define _F_START(f) (0 ? f) 66 | #define _F_END(f) (1 ? f) 67 | #define _F_SIZE(f) (1 + _F_END(f) - _F_START(f)) 68 | #define _F_MASK(f) (((1 << _F_SIZE(f)) - 1) << _F_START(f)) 69 | #define _F_NORMALIZE(v, f) (((v) & _F_MASK(f)) >> _F_START(f)) 70 | #define _F_DENORMALIZE(v, f) (((v) << _F_START(f)) & _F_MASK(f)) 71 | 72 | // Global macros. 73 | #define FIELD_GET(x, reg, field) (_F_NORMALIZE((x), reg ## _ ## field)) 74 | #define FIELD_SET(x, reg, field, value) ( (x & ~_F_MASK(reg ## _ ## field)) | _F_DENORMALIZE(reg ## _ ## field ## _ ## value, reg ## _ ## field)) 75 | #define FIELD_VALUE(x, reg, field, value) ( (x & ~_F_MASK(reg ## _ ## field)) | _F_DENORMALIZE(value, reg ## _ ## field) ) 76 | #define FIELD_CLEAR(reg, field) ( ~ _F_MASK(reg ## _ ## field) ) 77 | 78 | #define FIELD_INIT(reg, field, value) _F_DENORMALIZE(reg ## _ ## field ## _ ## value, reg ## _ ## field) 79 | #define FIELD_INIT_VAL(reg, field, value) (_F_DENORMALIZE(value, reg ## _ ## field)) 80 | #define FIELD_GET_MASK(reg, field) _F_MASK(reg ## _ ## field) 81 | 82 | enum { 83 | BUFFER0 = 0, 84 | BUFFER1 = 1, 85 | }; 86 | 87 | enum { 88 | Y_BASE = 0, 89 | U_BASE = 1, 90 | V_BASE = 2, 91 | }; 92 | 93 | #endif /* __TYPES_H__ */ 94 | 95 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/Makefile: -------------------------------------------------------------------------------- 1 | 2 | #CROSS_COMPILE = arm-linux- 3 | CROSS_COMPILE = arm-buildroot-linux-gnueabihf- 4 | AS = $(CROSS_COMPILE)as 5 | LD = $(CROSS_COMPILE)ld 6 | CC = $(CROSS_COMPILE)gcc 7 | CPP = $(CC) -E 8 | AR = $(CROSS_COMPILE)ar 9 | NM = $(CROSS_COMPILE)nm 10 | 11 | STRIP = $(CROSS_COMPILE)strip 12 | OBJCOPY = $(CROSS_COMPILE)objcopy 13 | OBJDUMP = $(CROSS_COMPILE)objdump 14 | 15 | export AS LD CC CPP AR NM 16 | export STRIP OBJCOPY OBJDUMP 17 | 18 | #CFLAGS := -Wall -Werror -O2 -g 19 | CFLAGS := -Wall -O2 -g 20 | CFLAGS += -I $(shell pwd)/include 21 | 22 | LDFLAGS := -lm -ljpeg 23 | 24 | export CFLAGS LDFLAGS 25 | 26 | TOPDIR := $(shell pwd) 27 | export TOPDIR 28 | 29 | TARGET := video2lcd 30 | 31 | 32 | obj-y += main.o 33 | obj-y += convert/ 34 | obj-y += display/ 35 | obj-y += render/ 36 | obj-y += video/ 37 | 38 | all : 39 | make -C ./ -f $(TOPDIR)/Makefile.build 40 | $(CC) $(LDFLAGS) -o $(TARGET) built-in.o 41 | 42 | 43 | clean: 44 | rm -f $(shell find -name "*.o") 45 | rm -f $(TARGET) 46 | 47 | distclean: 48 | rm -f $(shell find -name "*.o") 49 | rm -f $(shell find -name "*.d") 50 | rm -f $(TARGET) 51 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/Makefile.build: -------------------------------------------------------------------------------- 1 | PHONY := __build 2 | __build: 3 | 4 | 5 | obj-y := 6 | subdir-y := 7 | 8 | include Makefile 9 | 10 | # obj-y := a.o b.o c/ d/ 11 | # $(filter %/, $(obj-y)) : c/ d/ 12 | # __subdir-y : c d 13 | # subdir-y : c d 14 | __subdir-y := $(patsubst %/,%,$(filter %/, $(obj-y))) 15 | subdir-y += $(__subdir-y) 16 | 17 | # c/built-in.o d/built-in.o 18 | subdir_objs := $(foreach f,$(subdir-y),$(f)/built-in.o) 19 | 20 | # a.o b.o 21 | cur_objs := $(filter-out %/, $(obj-y)) 22 | dep_files := $(foreach f,$(cur_objs),.$(f).d) 23 | dep_files := $(wildcard $(dep_files)) 24 | 25 | ifneq ($(dep_files),) 26 | include $(dep_files) 27 | endif 28 | 29 | 30 | PHONY += $(subdir-y) 31 | 32 | 33 | __build : $(subdir-y) built-in.o 34 | 35 | $(subdir-y): 36 | make -C $@ -f $(TOPDIR)/Makefile.build 37 | 38 | built-in.o : $(cur_objs) $(subdir_objs) 39 | $(LD) -r -o $@ $^ 40 | 41 | dep_file = .$@.d 42 | 43 | %.o : %.c 44 | $(CC) $(CFLAGS) -Wp,-MD,$(dep_file) -c -o $@ $< 45 | 46 | .PHONY : $(PHONY) -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/Makefile: -------------------------------------------------------------------------------- 1 | obj-y += convert_manager.o 2 | obj-y += yuv2rgb.o 3 | obj-y += color.o 4 | obj-y += mjpeg2rgb.o 5 | obj-y += jdatasrc-tj.o 6 | obj-y += rgb2rgb.o 7 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/color.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | # GspcaGui: Gspca/Spca5xx Grabber # 3 | # Copyright (C) 2004 2005 2006 Michel Xhaard # 4 | # # 5 | # This program is free software; you can redistribute it and/or modify # 6 | # it under the terms of the GNU General Public License as published by # 7 | # the Free Software Foundation; either version 2 of the License, or # 8 | # (at your option) any later version. # 9 | # # 10 | # This program is distributed in the hope that it will be useful, # 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 13 | # GNU General Public License for more details. # 14 | # # 15 | # You should have received a copy of the GNU General Public License # 16 | # along with this program; if not, write to the Free Software # 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # 18 | # # 19 | ****************************************************************************/ 20 | #include 21 | #include 22 | #include 23 | #include "color.h" 24 | 25 | static int *LutYr = NULL; 26 | static int *LutYg = NULL;; 27 | static int *LutYb = NULL;; 28 | static int *LutVr = NULL;; 29 | static int *LutVrY = NULL;; 30 | static int *LutUb = NULL;; 31 | static int *LutUbY = NULL;; 32 | static int *LutRv = NULL; 33 | static int *LutGu = NULL; 34 | static int *LutGv = NULL; 35 | static int *LutBu = NULL; 36 | 37 | #if 0 38 | #define RGB24_TO_Y(r,g,b) LutYr[(r)] + LutYg[(g)] + LutYb[(b)] 39 | #define YR_TO_V(r,y) LutVr[(r)] + LutVrY[(y)] 40 | #define YB_TO_U(b,y) LutUb[(b)] + LutUbY[(y)] 41 | 42 | #define R_FROMYV(y,v) CLIP((y) + LutRv[(v)]) 43 | #define G_FROMYUV(y,u,v) CLIP((y) + LutGu[(u)] + LutGv[(v)]) 44 | #define B_FROMYU(y,u) CLIP((y) + LutBu[(u)]) 45 | #endif 46 | 47 | unsigned char 48 | RGB24_TO_Y(unsigned char r, unsigned char g, unsigned char b) 49 | { 50 | return (LutYr[(r)] + LutYg[(g)] + LutYb[(b)]); 51 | } 52 | unsigned char 53 | YR_TO_V(unsigned char r, unsigned char y) 54 | { 55 | return (LutVr[(r)] + LutVrY[(y)]); 56 | } 57 | unsigned char 58 | YB_TO_U(unsigned char b, unsigned char y) 59 | { 60 | return (LutUb[(b)] + LutUbY[(y)]); 61 | } 62 | unsigned char 63 | R_FROMYV(unsigned char y, unsigned char v) 64 | { 65 | return CLIP((y) + LutRv[(v)]); 66 | } 67 | unsigned char 68 | G_FROMYUV(unsigned char y, unsigned char u, unsigned char v) 69 | { 70 | return CLIP((y) + LutGu[(u)] + LutGv[(v)]); 71 | } 72 | unsigned char 73 | B_FROMYU(unsigned char y, unsigned char u) 74 | { 75 | return CLIP((y) + LutBu[(u)]); 76 | } 77 | 78 | void initLut(void) 79 | { 80 | int i; 81 | #define Rcoef 299 82 | #define Gcoef 587 83 | #define Bcoef 114 84 | #define Vrcoef 711 //656 //877 85 | #define Ubcoef 560 //500 //493 564 86 | 87 | #define CoefRv 1402 88 | #define CoefGu 714 // 344 89 | #define CoefGv 344 // 714 90 | #define CoefBu 1772 91 | 92 | LutYr = malloc(256*sizeof(int)); 93 | LutYg = malloc(256*sizeof(int)); 94 | LutYb = malloc(256*sizeof(int)); 95 | LutVr = malloc(256*sizeof(int)); 96 | LutVrY = malloc(256*sizeof(int)); 97 | LutUb = malloc(256*sizeof(int)); 98 | LutUbY = malloc(256*sizeof(int)); 99 | 100 | LutRv = malloc(256*sizeof(int)); 101 | LutGu = malloc(256*sizeof(int)); 102 | LutGv = malloc(256*sizeof(int)); 103 | LutBu = malloc(256*sizeof(int)); 104 | for (i= 0;i < 256;i++){ 105 | LutYr[i] = i*Rcoef/1000 ; 106 | LutYg[i] = i*Gcoef/1000 ; 107 | LutYb[i] = i*Bcoef/1000 ; 108 | LutVr[i] = i*Vrcoef/1000; 109 | LutUb[i] = i*Ubcoef/1000; 110 | LutVrY[i] = 128 -(i*Vrcoef/1000); 111 | LutUbY[i] = 128 -(i*Ubcoef/1000); 112 | LutRv[i] = (i-128)*CoefRv/1000; 113 | LutBu[i] = (i-128)*CoefBu/1000; 114 | LutGu[i] = (128-i)*CoefGu/1000; 115 | LutGv[i] = (128-i)*CoefGv/1000; 116 | } 117 | } 118 | 119 | 120 | void freeLut(void){ 121 | free(LutYr); 122 | free(LutYg); 123 | free(LutYb); 124 | free(LutVr); 125 | free(LutVrY); 126 | free(LutUb); 127 | free(LutUbY); 128 | 129 | free(LutRv); 130 | free(LutGu); 131 | free(LutGv); 132 | free(LutBu); 133 | } 134 | 135 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/color.h: -------------------------------------------------------------------------------- 1 | /**************************************************************************** 2 | # GspcaGui: Gspca/Spca5xx Grabber # 3 | # Copyright (C) 2004 2005 2006 Michel Xhaard # 4 | # # 5 | # This program is free software; you can redistribute it and/or modify # 6 | # it under the terms of the GNU General Public License as published by # 7 | # the Free Software Foundation; either version 2 of the License, or # 8 | # (at your option) any later version. # 9 | # # 10 | # This program is distributed in the hope that it will be useful, # 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # 13 | # GNU General Public License for more details. # 14 | # # 15 | # You should have received a copy of the GNU General Public License # 16 | # along with this program; if not, write to the Free Software # 17 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # 18 | # # 19 | ****************************************************************************/ 20 | typedef struct Myrgb16 { 21 | unsigned short blue:5; 22 | unsigned short green:6; 23 | unsigned short red:5; 24 | } Myrgb16; 25 | typedef struct Myrgb24 { 26 | unsigned char blue; 27 | unsigned char green; 28 | unsigned char red; 29 | } Myrgb24; 30 | typedef struct Myrgb32 { 31 | unsigned char blue; 32 | unsigned char green; 33 | unsigned char red; 34 | unsigned char alpha; 35 | } Myrgb32; 36 | 37 | typedef struct MyYUV422 { 38 | unsigned char y0; 39 | unsigned char u; 40 | unsigned char y1; 41 | unsigned char v; 42 | } MyYUV422; 43 | 44 | typedef struct MyYUV444 { 45 | unsigned char y; 46 | unsigned char u; 47 | unsigned char v; 48 | } MyYUV444; 49 | 50 | #define CLIP(color) (unsigned char)(((color)>0xFF)?0xff:(((color)<0)?0:(color))) 51 | 52 | unsigned char 53 | RGB24_TO_Y(unsigned char r, unsigned char g, unsigned char b); 54 | 55 | unsigned char 56 | YR_TO_V(unsigned char r, unsigned char y); 57 | 58 | unsigned char 59 | YB_TO_U(unsigned char b, unsigned char y); 60 | 61 | unsigned char 62 | R_FROMYV(unsigned char y, unsigned char v); 63 | 64 | unsigned char 65 | G_FROMYUV(unsigned char y, unsigned char u, unsigned char v); 66 | 67 | unsigned char 68 | B_FROMYU(unsigned char y, unsigned char u); 69 | 70 | #define YfromRGB(r,g,b) CLIP((77*(r)+150*(g)+29*(b))>>8) 71 | #define UfromRGB(r,g,b) CLIP(((128*(b)-85*(g)-43*(r))>>8 )+128) 72 | #define VfromRGB(r,g,b) CLIP(((128*(r)-107*(g)-21*(b))>>8) +128) 73 | 74 | #define PACKRGB16(r,g,b) (__u16) ((((b) & 0xF8) << 8 ) | (((g) & 0xFC) << 3 ) | (((r) & 0xF8) >> 3 )) 75 | #define UNPACK16(pixel,r,g,b) r=((pixel)&0xf800) >> 8; g=((pixel)&0x07e0) >> 3; b=(((pixel)&0x001f) << 3) 76 | 77 | void initLut(void); 78 | void freeLut(void); 79 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/convert_manager.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/convert/convert_manager.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/jdatasrc-tj.c: -------------------------------------------------------------------------------- 1 | /* 2 | * jdatasrc.c 3 | * 4 | * Copyright (C) 1994-1996, Thomas G. Lane. 5 | * Modified 2009-2010 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file contains decompression data source routines for the case of 10 | * reading JPEG data from memory or from a file (or any stdio stream). 11 | * While these routines are sufficient for most applications, 12 | * some will want to use a different source manager. 13 | * IMPORTANT: we assume that fread() will correctly transcribe an array of 14 | * JOCTETs from 8-bit-wide elements on external storage. If char is wider 15 | * than 8 bits on your machine, you may need to do some tweaking. 16 | */ 17 | 18 | /* this is not a core library module, so it doesn't define JPEG_INTERNALS */ 19 | #include "jinclude.h" 20 | #include "jpeglib.h" 21 | #include "jerror.h" 22 | 23 | 24 | /* 25 | * Initialize source --- called by jpeg_read_header 26 | * before any data is actually read. 27 | */ 28 | 29 | METHODDEF(void) 30 | init_mem_source (j_decompress_ptr cinfo) 31 | { 32 | /* no work necessary here */ 33 | } 34 | 35 | 36 | /* 37 | * Fill the input buffer --- called whenever buffer is emptied. 38 | * 39 | * In typical applications, this should read fresh data into the buffer 40 | * (ignoring the current state of next_input_byte & bytes_in_buffer), 41 | * reset the pointer & count to the start of the buffer, and return TRUE 42 | * indicating that the buffer has been reloaded. It is not necessary to 43 | * fill the buffer entirely, only to obtain at least one more byte. 44 | * 45 | * There is no such thing as an EOF return. If the end of the file has been 46 | * reached, the routine has a choice of ERREXIT() or inserting fake data into 47 | * the buffer. In most cases, generating a warning message and inserting a 48 | * fake EOI marker is the best course of action --- this will allow the 49 | * decompressor to output however much of the image is there. However, 50 | * the resulting error message is misleading if the real problem is an empty 51 | * input file, so we handle that case specially. 52 | * 53 | * In applications that need to be able to suspend compression due to input 54 | * not being available yet, a FALSE return indicates that no more data can be 55 | * obtained right now, but more may be forthcoming later. In this situation, 56 | * the decompressor will return to its caller (with an indication of the 57 | * number of scanlines it has read, if any). The application should resume 58 | * decompression after it has loaded more data into the input buffer. Note 59 | * that there are substantial restrictions on the use of suspension --- see 60 | * the documentation. 61 | * 62 | * When suspending, the decompressor will back up to a convenient restart point 63 | * (typically the start of the current MCU). next_input_byte & bytes_in_buffer 64 | * indicate where the restart point will be if the current call returns FALSE. 65 | * Data beyond this point must be rescanned after resumption, so move it to 66 | * the front of the buffer rather than discarding it. 67 | */ 68 | 69 | METHODDEF(boolean) 70 | fill_mem_input_buffer (j_decompress_ptr cinfo) 71 | { 72 | static JOCTET mybuffer[4]; 73 | 74 | /* The whole JPEG data is expected to reside in the supplied memory 75 | * buffer, so any request for more data beyond the given buffer size 76 | * is treated as an error. 77 | */ 78 | WARNMS(cinfo, JWRN_JPEG_EOF); 79 | /* Insert a fake EOI marker */ 80 | mybuffer[0] = (JOCTET) 0xFF; 81 | mybuffer[1] = (JOCTET) JPEG_EOI; 82 | 83 | cinfo->src->next_input_byte = mybuffer; 84 | cinfo->src->bytes_in_buffer = 2; 85 | 86 | return TRUE; 87 | } 88 | 89 | 90 | /* 91 | * Skip data --- used to skip over a potentially large amount of 92 | * uninteresting data (such as an APPn marker). 93 | * 94 | * Writers of suspendable-input applications must note that skip_input_data 95 | * is not granted the right to give a suspension return. If the skip extends 96 | * beyond the data currently in the buffer, the buffer can be marked empty so 97 | * that the next read will cause a fill_input_buffer call that can suspend. 98 | * Arranging for additional bytes to be discarded before reloading the input 99 | * buffer is the application writer's problem. 100 | */ 101 | 102 | METHODDEF(void) 103 | skip_input_data (j_decompress_ptr cinfo, long num_bytes) 104 | { 105 | struct jpeg_source_mgr * src = cinfo->src; 106 | 107 | /* Just a dumb implementation for now. Could use fseek() except 108 | * it doesn't work on pipes. Not clear that being smart is worth 109 | * any trouble anyway --- large skips are infrequent. 110 | */ 111 | if (num_bytes > 0) { 112 | while (num_bytes > (long) src->bytes_in_buffer) { 113 | num_bytes -= (long) src->bytes_in_buffer; 114 | (void) (*src->fill_input_buffer) (cinfo); 115 | /* note we assume that fill_input_buffer will never return FALSE, 116 | * so suspension need not be handled. 117 | */ 118 | } 119 | src->next_input_byte += (size_t) num_bytes; 120 | src->bytes_in_buffer -= (size_t) num_bytes; 121 | } 122 | } 123 | 124 | 125 | /* 126 | * An additional method that can be provided by data source modules is the 127 | * resync_to_restart method for error recovery in the presence of RST markers. 128 | * For the moment, this source module just uses the default resync method 129 | * provided by the JPEG library. That method assumes that no backtracking 130 | * is possible. 131 | */ 132 | 133 | 134 | /* 135 | * Terminate source --- called by jpeg_finish_decompress 136 | * after all data has been read. Often a no-op. 137 | * 138 | * NB: *not* called by jpeg_abort or jpeg_destroy; surrounding 139 | * application must deal with any cleanup that should happen even 140 | * for error exit. 141 | */ 142 | 143 | METHODDEF(void) 144 | term_source (j_decompress_ptr cinfo) 145 | { 146 | /* no work necessary here */ 147 | } 148 | 149 | 150 | /* 151 | * Prepare for input from a supplied memory buffer. 152 | * The buffer must contain the whole JPEG data. 153 | */ 154 | 155 | GLOBAL(void) 156 | jpeg_mem_src_tj (j_decompress_ptr cinfo, 157 | unsigned char * inbuffer, unsigned long insize) 158 | { 159 | struct jpeg_source_mgr * src; 160 | 161 | if (inbuffer == NULL || insize == 0) /* Treat empty input as fatal error */ 162 | ERREXIT(cinfo, JERR_INPUT_EMPTY); 163 | 164 | /* The source object is made permanent so that a series of JPEG images 165 | * can be read from the same buffer by calling jpeg_mem_src only before 166 | * the first one. 167 | */ 168 | if (cinfo->src == NULL) { /* first time for this JPEG object? */ 169 | cinfo->src = (struct jpeg_source_mgr *) 170 | (*cinfo->mem->alloc_small) ((j_common_ptr) cinfo, JPOOL_PERMANENT, 171 | SIZEOF(struct jpeg_source_mgr)); 172 | } 173 | 174 | src = cinfo->src; 175 | src->init_source = init_mem_source; 176 | src->fill_input_buffer = fill_mem_input_buffer; 177 | src->skip_input_data = skip_input_data; 178 | src->resync_to_restart = jpeg_resync_to_restart; /* use default method */ 179 | src->term_source = term_source; 180 | src->bytes_in_buffer = (size_t) insize; 181 | src->next_input_byte = (JOCTET *) inbuffer; 182 | } 183 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/jerror.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jerror.h 3 | * 4 | * Copyright (C) 1994-1997, Thomas G. Lane. 5 | * Modified 1997-2009 by Guido Vollbeding. 6 | * This file is part of the Independent JPEG Group's software. 7 | * For conditions of distribution and use, see the accompanying README file. 8 | * 9 | * This file defines the error and message codes for the JPEG library. 10 | * Edit this file to add new codes, or to translate the message strings to 11 | * some other language. 12 | * A set of error-reporting macros are defined too. Some applications using 13 | * the JPEG library may wish to include this file to get the error codes 14 | * and/or the macros. 15 | */ 16 | 17 | /* 18 | * To define the enum list of message codes, include this file without 19 | * defining macro JMESSAGE. To create a message string table, include it 20 | * again with a suitable JMESSAGE definition (see jerror.c for an example). 21 | */ 22 | #ifndef JMESSAGE 23 | #ifndef JERROR_H 24 | /* First time through, define the enum list */ 25 | #define JMAKE_ENUM_LIST 26 | #else 27 | /* Repeated inclusions of this file are no-ops unless JMESSAGE is defined */ 28 | #define JMESSAGE(code,string) 29 | #endif /* JERROR_H */ 30 | #endif /* JMESSAGE */ 31 | 32 | #ifdef JMAKE_ENUM_LIST 33 | 34 | typedef enum { 35 | 36 | #define JMESSAGE(code,string) code , 37 | 38 | #endif /* JMAKE_ENUM_LIST */ 39 | 40 | JMESSAGE(JMSG_NOMESSAGE, "Bogus message code %d") /* Must be first entry! */ 41 | 42 | /* For maintenance convenience, list is alphabetical by message code name */ 43 | #if JPEG_LIB_VERSION < 70 44 | JMESSAGE(JERR_ARITH_NOTIMPL, 45 | "Sorry, arithmetic coding is not implemented") 46 | #endif 47 | JMESSAGE(JERR_BAD_ALIGN_TYPE, "ALIGN_TYPE is wrong, please fix") 48 | JMESSAGE(JERR_BAD_ALLOC_CHUNK, "MAX_ALLOC_CHUNK is wrong, please fix") 49 | JMESSAGE(JERR_BAD_BUFFER_MODE, "Bogus buffer control mode") 50 | JMESSAGE(JERR_BAD_COMPONENT_ID, "Invalid component ID %d in SOS") 51 | #if JPEG_LIB_VERSION >= 70 52 | JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") 53 | #endif 54 | JMESSAGE(JERR_BAD_DCT_COEF, "DCT coefficient out of range") 55 | JMESSAGE(JERR_BAD_DCTSIZE, "IDCT output block size %d not supported") 56 | #if JPEG_LIB_VERSION >= 70 57 | JMESSAGE(JERR_BAD_DROP_SAMPLING, 58 | "Component index %d: mismatching sampling ratio %d:%d, %d:%d, %c") 59 | #endif 60 | JMESSAGE(JERR_BAD_HUFF_TABLE, "Bogus Huffman table definition") 61 | JMESSAGE(JERR_BAD_IN_COLORSPACE, "Bogus input colorspace") 62 | JMESSAGE(JERR_BAD_J_COLORSPACE, "Bogus JPEG colorspace") 63 | JMESSAGE(JERR_BAD_LENGTH, "Bogus marker length") 64 | JMESSAGE(JERR_BAD_LIB_VERSION, 65 | "Wrong JPEG library version: library is %d, caller expects %d") 66 | JMESSAGE(JERR_BAD_MCU_SIZE, "Sampling factors too large for interleaved scan") 67 | JMESSAGE(JERR_BAD_POOL_ID, "Invalid memory pool code %d") 68 | JMESSAGE(JERR_BAD_PRECISION, "Unsupported JPEG data precision %d") 69 | JMESSAGE(JERR_BAD_PROGRESSION, 70 | "Invalid progressive parameters Ss=%d Se=%d Ah=%d Al=%d") 71 | JMESSAGE(JERR_BAD_PROG_SCRIPT, 72 | "Invalid progressive parameters at scan script entry %d") 73 | JMESSAGE(JERR_BAD_SAMPLING, "Bogus sampling factors") 74 | JMESSAGE(JERR_BAD_SCAN_SCRIPT, "Invalid scan script at entry %d") 75 | JMESSAGE(JERR_BAD_STATE, "Improper call to JPEG library in state %d") 76 | JMESSAGE(JERR_BAD_STRUCT_SIZE, 77 | "JPEG parameter struct mismatch: library thinks size is %u, caller expects %u") 78 | JMESSAGE(JERR_BAD_VIRTUAL_ACCESS, "Bogus virtual array access") 79 | JMESSAGE(JERR_BUFFER_SIZE, "Buffer passed to JPEG library is too small") 80 | JMESSAGE(JERR_CANT_SUSPEND, "Suspension not allowed here") 81 | JMESSAGE(JERR_CCIR601_NOTIMPL, "CCIR601 sampling not implemented yet") 82 | JMESSAGE(JERR_COMPONENT_COUNT, "Too many color components: %d, max %d") 83 | JMESSAGE(JERR_CONVERSION_NOTIMPL, "Unsupported color conversion request") 84 | JMESSAGE(JERR_DAC_INDEX, "Bogus DAC index %d") 85 | JMESSAGE(JERR_DAC_VALUE, "Bogus DAC value 0x%x") 86 | JMESSAGE(JERR_DHT_INDEX, "Bogus DHT index %d") 87 | JMESSAGE(JERR_DQT_INDEX, "Bogus DQT index %d") 88 | JMESSAGE(JERR_EMPTY_IMAGE, "Empty JPEG image (DNL not supported)") 89 | JMESSAGE(JERR_EMS_READ, "Read from EMS failed") 90 | JMESSAGE(JERR_EMS_WRITE, "Write to EMS failed") 91 | JMESSAGE(JERR_EOI_EXPECTED, "Didn't expect more than one scan") 92 | JMESSAGE(JERR_FILE_READ, "Input file read error") 93 | JMESSAGE(JERR_FILE_WRITE, "Output file write error --- out of disk space?") 94 | JMESSAGE(JERR_FRACT_SAMPLE_NOTIMPL, "Fractional sampling not implemented yet") 95 | JMESSAGE(JERR_HUFF_CLEN_OVERFLOW, "Huffman code size table overflow") 96 | JMESSAGE(JERR_HUFF_MISSING_CODE, "Missing Huffman code table entry") 97 | JMESSAGE(JERR_IMAGE_TOO_BIG, "Maximum supported image dimension is %u pixels") 98 | JMESSAGE(JERR_INPUT_EMPTY, "Empty input file") 99 | JMESSAGE(JERR_INPUT_EOF, "Premature end of input file") 100 | JMESSAGE(JERR_MISMATCHED_QUANT_TABLE, 101 | "Cannot transcode due to multiple use of quantization table %d") 102 | JMESSAGE(JERR_MISSING_DATA, "Scan script does not transmit all data") 103 | JMESSAGE(JERR_MODE_CHANGE, "Invalid color quantization mode change") 104 | JMESSAGE(JERR_NOTIMPL, "Not implemented yet") 105 | JMESSAGE(JERR_NOT_COMPILED, "Requested feature was omitted at compile time") 106 | #if JPEG_LIB_VERSION >= 70 107 | JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") 108 | #endif 109 | JMESSAGE(JERR_NO_BACKING_STORE, "Backing store not supported") 110 | JMESSAGE(JERR_NO_HUFF_TABLE, "Huffman table 0x%02x was not defined") 111 | JMESSAGE(JERR_NO_IMAGE, "JPEG datastream contains no image") 112 | JMESSAGE(JERR_NO_QUANT_TABLE, "Quantization table 0x%02x was not defined") 113 | JMESSAGE(JERR_NO_SOI, "Not a JPEG file: starts with 0x%02x 0x%02x") 114 | JMESSAGE(JERR_OUT_OF_MEMORY, "Insufficient memory (case %d)") 115 | JMESSAGE(JERR_QUANT_COMPONENTS, 116 | "Cannot quantize more than %d color components") 117 | JMESSAGE(JERR_QUANT_FEW_COLORS, "Cannot quantize to fewer than %d colors") 118 | JMESSAGE(JERR_QUANT_MANY_COLORS, "Cannot quantize to more than %d colors") 119 | JMESSAGE(JERR_SOF_DUPLICATE, "Invalid JPEG file structure: two SOF markers") 120 | JMESSAGE(JERR_SOF_NO_SOS, "Invalid JPEG file structure: missing SOS marker") 121 | JMESSAGE(JERR_SOF_UNSUPPORTED, "Unsupported JPEG process: SOF type 0x%02x") 122 | JMESSAGE(JERR_SOI_DUPLICATE, "Invalid JPEG file structure: two SOI markers") 123 | JMESSAGE(JERR_SOS_NO_SOF, "Invalid JPEG file structure: SOS before SOF") 124 | JMESSAGE(JERR_TFILE_CREATE, "Failed to create temporary file %s") 125 | JMESSAGE(JERR_TFILE_READ, "Read failed on temporary file") 126 | JMESSAGE(JERR_TFILE_SEEK, "Seek failed on temporary file") 127 | JMESSAGE(JERR_TFILE_WRITE, 128 | "Write failed on temporary file --- out of disk space?") 129 | JMESSAGE(JERR_TOO_LITTLE_DATA, "Application transferred too few scanlines") 130 | JMESSAGE(JERR_UNKNOWN_MARKER, "Unsupported marker type 0x%02x") 131 | JMESSAGE(JERR_VIRTUAL_BUG, "Virtual array controller messed up") 132 | JMESSAGE(JERR_WIDTH_OVERFLOW, "Image too wide for this implementation") 133 | JMESSAGE(JERR_XMS_READ, "Read from XMS failed") 134 | JMESSAGE(JERR_XMS_WRITE, "Write to XMS failed") 135 | JMESSAGE(JMSG_COPYRIGHT, JCOPYRIGHT) 136 | JMESSAGE(JMSG_VERSION, JVERSION) 137 | JMESSAGE(JTRC_16BIT_TABLES, 138 | "Caution: quantization tables are too coarse for baseline JPEG") 139 | JMESSAGE(JTRC_ADOBE, 140 | "Adobe APP14 marker: version %d, flags 0x%04x 0x%04x, transform %d") 141 | JMESSAGE(JTRC_APP0, "Unknown APP0 marker (not JFIF), length %u") 142 | JMESSAGE(JTRC_APP14, "Unknown APP14 marker (not Adobe), length %u") 143 | JMESSAGE(JTRC_DAC, "Define Arithmetic Table 0x%02x: 0x%02x") 144 | JMESSAGE(JTRC_DHT, "Define Huffman Table 0x%02x") 145 | JMESSAGE(JTRC_DQT, "Define Quantization Table %d precision %d") 146 | JMESSAGE(JTRC_DRI, "Define Restart Interval %u") 147 | JMESSAGE(JTRC_EMS_CLOSE, "Freed EMS handle %u") 148 | JMESSAGE(JTRC_EMS_OPEN, "Obtained EMS handle %u") 149 | JMESSAGE(JTRC_EOI, "End Of Image") 150 | JMESSAGE(JTRC_HUFFBITS, " %3d %3d %3d %3d %3d %3d %3d %3d") 151 | JMESSAGE(JTRC_JFIF, "JFIF APP0 marker: version %d.%02d, density %dx%d %d") 152 | JMESSAGE(JTRC_JFIF_BADTHUMBNAILSIZE, 153 | "Warning: thumbnail image size does not match data length %u") 154 | JMESSAGE(JTRC_JFIF_EXTENSION, 155 | "JFIF extension marker: type 0x%02x, length %u") 156 | JMESSAGE(JTRC_JFIF_THUMBNAIL, " with %d x %d thumbnail image") 157 | JMESSAGE(JTRC_MISC_MARKER, "Miscellaneous marker 0x%02x, length %u") 158 | JMESSAGE(JTRC_PARMLESS_MARKER, "Unexpected marker 0x%02x") 159 | JMESSAGE(JTRC_QUANTVALS, " %4u %4u %4u %4u %4u %4u %4u %4u") 160 | JMESSAGE(JTRC_QUANT_3_NCOLORS, "Quantizing to %d = %d*%d*%d colors") 161 | JMESSAGE(JTRC_QUANT_NCOLORS, "Quantizing to %d colors") 162 | JMESSAGE(JTRC_QUANT_SELECTED, "Selected %d colors for quantization") 163 | JMESSAGE(JTRC_RECOVERY_ACTION, "At marker 0x%02x, recovery action %d") 164 | JMESSAGE(JTRC_RST, "RST%d") 165 | JMESSAGE(JTRC_SMOOTH_NOTIMPL, 166 | "Smoothing not supported with nonstandard sampling ratios") 167 | JMESSAGE(JTRC_SOF, "Start Of Frame 0x%02x: width=%u, height=%u, components=%d") 168 | JMESSAGE(JTRC_SOF_COMPONENT, " Component %d: %dhx%dv q=%d") 169 | JMESSAGE(JTRC_SOI, "Start of Image") 170 | JMESSAGE(JTRC_SOS, "Start Of Scan: %d components") 171 | JMESSAGE(JTRC_SOS_COMPONENT, " Component %d: dc=%d ac=%d") 172 | JMESSAGE(JTRC_SOS_PARAMS, " Ss=%d, Se=%d, Ah=%d, Al=%d") 173 | JMESSAGE(JTRC_TFILE_CLOSE, "Closed temporary file %s") 174 | JMESSAGE(JTRC_TFILE_OPEN, "Opened temporary file %s") 175 | JMESSAGE(JTRC_THUMB_JPEG, 176 | "JFIF extension marker: JPEG-compressed thumbnail image, length %u") 177 | JMESSAGE(JTRC_THUMB_PALETTE, 178 | "JFIF extension marker: palette thumbnail image, length %u") 179 | JMESSAGE(JTRC_THUMB_RGB, 180 | "JFIF extension marker: RGB thumbnail image, length %u") 181 | JMESSAGE(JTRC_UNKNOWN_IDS, 182 | "Unrecognized component IDs %d %d %d, assuming YCbCr") 183 | JMESSAGE(JTRC_XMS_CLOSE, "Freed XMS handle %u") 184 | JMESSAGE(JTRC_XMS_OPEN, "Obtained XMS handle %u") 185 | JMESSAGE(JWRN_ADOBE_XFORM, "Unknown Adobe color transform code %d") 186 | #if JPEG_LIB_VERSION >= 70 187 | JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") 188 | #endif 189 | JMESSAGE(JWRN_BOGUS_PROGRESSION, 190 | "Inconsistent progression sequence for component %d coefficient %d") 191 | JMESSAGE(JWRN_EXTRANEOUS_DATA, 192 | "Corrupt JPEG data: %u extraneous bytes before marker 0x%02x") 193 | JMESSAGE(JWRN_HIT_MARKER, "Corrupt JPEG data: premature end of data segment") 194 | JMESSAGE(JWRN_HUFF_BAD_CODE, "Corrupt JPEG data: bad Huffman code") 195 | JMESSAGE(JWRN_JFIF_MAJOR, "Warning: unknown JFIF revision number %d.%02d") 196 | JMESSAGE(JWRN_JPEG_EOF, "Premature end of JPEG file") 197 | JMESSAGE(JWRN_MUST_RESYNC, 198 | "Corrupt JPEG data: found marker 0x%02x instead of RST%d") 199 | JMESSAGE(JWRN_NOT_SEQUENTIAL, "Invalid SOS parameters for sequential JPEG") 200 | JMESSAGE(JWRN_TOO_MUCH_DATA, "Application transferred too many scanlines") 201 | #if JPEG_LIB_VERSION < 70 202 | JMESSAGE(JERR_BAD_CROP_SPEC, "Invalid crop request") 203 | #if defined(C_ARITH_CODING_SUPPORTED) || defined(D_ARITH_CODING_SUPPORTED) 204 | JMESSAGE(JERR_NO_ARITH_TABLE, "Arithmetic table 0x%02x was not defined") 205 | JMESSAGE(JWRN_ARITH_BAD_CODE, "Corrupt JPEG data: bad arithmetic code") 206 | #endif 207 | #endif 208 | 209 | #ifdef JMAKE_ENUM_LIST 210 | 211 | JMSG_LASTMSGCODE 212 | } J_MESSAGE_CODE; 213 | 214 | #undef JMAKE_ENUM_LIST 215 | #endif /* JMAKE_ENUM_LIST */ 216 | 217 | /* Zap JMESSAGE macro so that future re-inclusions do nothing by default */ 218 | #undef JMESSAGE 219 | 220 | 221 | #ifndef JERROR_H 222 | #define JERROR_H 223 | 224 | /* Macros to simplify using the error and trace message stuff */ 225 | /* The first parameter is either type of cinfo pointer */ 226 | 227 | /* Fatal errors (print message and exit) */ 228 | #define ERREXIT(cinfo,code) \ 229 | ((cinfo)->err->msg_code = (code), \ 230 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 231 | #define ERREXIT1(cinfo,code,p1) \ 232 | ((cinfo)->err->msg_code = (code), \ 233 | (cinfo)->err->msg_parm.i[0] = (p1), \ 234 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 235 | #define ERREXIT2(cinfo,code,p1,p2) \ 236 | ((cinfo)->err->msg_code = (code), \ 237 | (cinfo)->err->msg_parm.i[0] = (p1), \ 238 | (cinfo)->err->msg_parm.i[1] = (p2), \ 239 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 240 | #define ERREXIT3(cinfo,code,p1,p2,p3) \ 241 | ((cinfo)->err->msg_code = (code), \ 242 | (cinfo)->err->msg_parm.i[0] = (p1), \ 243 | (cinfo)->err->msg_parm.i[1] = (p2), \ 244 | (cinfo)->err->msg_parm.i[2] = (p3), \ 245 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 246 | #define ERREXIT4(cinfo,code,p1,p2,p3,p4) \ 247 | ((cinfo)->err->msg_code = (code), \ 248 | (cinfo)->err->msg_parm.i[0] = (p1), \ 249 | (cinfo)->err->msg_parm.i[1] = (p2), \ 250 | (cinfo)->err->msg_parm.i[2] = (p3), \ 251 | (cinfo)->err->msg_parm.i[3] = (p4), \ 252 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 253 | #define ERREXITS(cinfo,code,str) \ 254 | ((cinfo)->err->msg_code = (code), \ 255 | strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ 256 | (*(cinfo)->err->error_exit) ((j_common_ptr) (cinfo))) 257 | 258 | #define MAKESTMT(stuff) do { stuff } while (0) 259 | 260 | /* Nonfatal errors (we can keep going, but the data is probably corrupt) */ 261 | #define WARNMS(cinfo,code) \ 262 | ((cinfo)->err->msg_code = (code), \ 263 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 264 | #define WARNMS1(cinfo,code,p1) \ 265 | ((cinfo)->err->msg_code = (code), \ 266 | (cinfo)->err->msg_parm.i[0] = (p1), \ 267 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 268 | #define WARNMS2(cinfo,code,p1,p2) \ 269 | ((cinfo)->err->msg_code = (code), \ 270 | (cinfo)->err->msg_parm.i[0] = (p1), \ 271 | (cinfo)->err->msg_parm.i[1] = (p2), \ 272 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), -1)) 273 | 274 | /* Informational/debugging messages */ 275 | #define TRACEMS(cinfo,lvl,code) \ 276 | ((cinfo)->err->msg_code = (code), \ 277 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 278 | #define TRACEMS1(cinfo,lvl,code,p1) \ 279 | ((cinfo)->err->msg_code = (code), \ 280 | (cinfo)->err->msg_parm.i[0] = (p1), \ 281 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 282 | #define TRACEMS2(cinfo,lvl,code,p1,p2) \ 283 | ((cinfo)->err->msg_code = (code), \ 284 | (cinfo)->err->msg_parm.i[0] = (p1), \ 285 | (cinfo)->err->msg_parm.i[1] = (p2), \ 286 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 287 | #define TRACEMS3(cinfo,lvl,code,p1,p2,p3) \ 288 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 289 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); \ 290 | (cinfo)->err->msg_code = (code); \ 291 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 292 | #define TRACEMS4(cinfo,lvl,code,p1,p2,p3,p4) \ 293 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 294 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 295 | (cinfo)->err->msg_code = (code); \ 296 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 297 | #define TRACEMS5(cinfo,lvl,code,p1,p2,p3,p4,p5) \ 298 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 299 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 300 | _mp[4] = (p5); \ 301 | (cinfo)->err->msg_code = (code); \ 302 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 303 | #define TRACEMS8(cinfo,lvl,code,p1,p2,p3,p4,p5,p6,p7,p8) \ 304 | MAKESTMT(int * _mp = (cinfo)->err->msg_parm.i; \ 305 | _mp[0] = (p1); _mp[1] = (p2); _mp[2] = (p3); _mp[3] = (p4); \ 306 | _mp[4] = (p5); _mp[5] = (p6); _mp[6] = (p7); _mp[7] = (p8); \ 307 | (cinfo)->err->msg_code = (code); \ 308 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl)); ) 309 | #define TRACEMSS(cinfo,lvl,code,str) \ 310 | ((cinfo)->err->msg_code = (code), \ 311 | strncpy((cinfo)->err->msg_parm.s, (str), JMSG_STR_PARM_MAX), \ 312 | (*(cinfo)->err->emit_message) ((j_common_ptr) (cinfo), (lvl))) 313 | 314 | #endif /* JERROR_H */ 315 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/jinclude.h: -------------------------------------------------------------------------------- 1 | /* 2 | * jinclude.h 3 | * 4 | * Copyright (C) 1991-1994, Thomas G. Lane. 5 | * This file is part of the Independent JPEG Group's software. 6 | * For conditions of distribution and use, see the accompanying README file. 7 | * 8 | * This file exists to provide a single place to fix any problems with 9 | * including the wrong system include files. (Common problems are taken 10 | * care of by the standard jconfig symbols, but on really weird systems 11 | * you may have to edit this file.) 12 | * 13 | * NOTE: this file is NOT intended to be included by applications using the 14 | * JPEG library. Most applications need only include jpeglib.h. 15 | */ 16 | 17 | 18 | /* Include auto-config file to find out which system include files we need. */ 19 | 20 | #include "jconfig.h" /* auto configuration options */ 21 | #define JCONFIG_INCLUDED /* so that jpeglib.h doesn't do it again */ 22 | 23 | /* 24 | * We need the NULL macro and size_t typedef. 25 | * On an ANSI-conforming system it is sufficient to include . 26 | * Otherwise, we get them from or ; we may have to 27 | * pull in as well. 28 | * Note that the core JPEG library does not require ; 29 | * only the default error handler and data source/destination modules do. 30 | * But we must pull it in because of the references to FILE in jpeglib.h. 31 | * You can remove those references if you want to compile without . 32 | */ 33 | 34 | #ifdef HAVE_STDDEF_H 35 | #include 36 | #endif 37 | 38 | #ifdef HAVE_STDLIB_H 39 | #include 40 | #endif 41 | 42 | #ifdef NEED_SYS_TYPES_H 43 | #include 44 | #endif 45 | 46 | #include 47 | 48 | /* 49 | * We need memory copying and zeroing functions, plus strncpy(). 50 | * ANSI and System V implementations declare these in . 51 | * BSD doesn't have the mem() functions, but it does have bcopy()/bzero(). 52 | * Some systems may declare memset and memcpy in . 53 | * 54 | * NOTE: we assume the size parameters to these functions are of type size_t. 55 | * Change the casts in these macros if not! 56 | */ 57 | 58 | #ifdef NEED_BSD_STRINGS 59 | 60 | #include 61 | #define MEMZERO(target,size) bzero((void *)(target), (size_t)(size)) 62 | #define MEMCOPY(dest,src,size) bcopy((const void *)(src), (void *)(dest), (size_t)(size)) 63 | 64 | #else /* not BSD, assume ANSI/SysV string lib */ 65 | 66 | #include 67 | #define MEMZERO(target,size) memset((void *)(target), 0, (size_t)(size)) 68 | #define MEMCOPY(dest,src,size) memcpy((void *)(dest), (const void *)(src), (size_t)(size)) 69 | 70 | #endif 71 | 72 | /* 73 | * In ANSI C, and indeed any rational implementation, size_t is also the 74 | * type returned by sizeof(). However, it seems there are some irrational 75 | * implementations out there, in which sizeof() returns an int even though 76 | * size_t is defined as long or unsigned long. To ensure consistent results 77 | * we always use this SIZEOF() macro in place of using sizeof() directly. 78 | */ 79 | 80 | #define SIZEOF(object) ((size_t) sizeof(object)) 81 | 82 | /* 83 | * The modules that use fread() and fwrite() always invoke them through 84 | * these macros. On some systems you may need to twiddle the argument casts. 85 | * CAUTION: argument order is different from underlying functions! 86 | */ 87 | 88 | #define JFREAD(file,buf,sizeofbuf) \ 89 | ((size_t) fread((void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) 90 | #define JFWRITE(file,buf,sizeofbuf) \ 91 | ((size_t) fwrite((const void *) (buf), (size_t) 1, (size_t) (sizeofbuf), (file))) 92 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/mjpeg2rgb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/convert/mjpeg2rgb.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/rgb2rgb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/convert/rgb2rgb.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/convert/yuv2rgb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/convert/yuv2rgb.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/display/Makefile: -------------------------------------------------------------------------------- 1 | obj-y += disp_manager.o 2 | obj-y += fb.o -------------------------------------------------------------------------------- /camera_100ask/video2lcd/display/disp_manager.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/display/disp_manager.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/display/fb.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/display/fb.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/include/config.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CONFIG_H 3 | #define _CONFIG_H 4 | 5 | #include 6 | 7 | 8 | //#define DBG_PRINTF(...) 9 | #define DBG_PRINTF printf 10 | 11 | #define FB_DEVICE_NAME "/dev/fb0" 12 | 13 | #endif /* _CONFIG_H */ 14 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/include/convert_manager.h: -------------------------------------------------------------------------------- 1 | 2 | #ifndef _CONVERT_MANAGER_H 3 | #define _CONVERT_MANAGER_H 4 | 5 | #include 6 | #include 7 | #include 8 | 9 | typedef struct VideoConvert { 10 | char *name; 11 | int (*isSupport)(int iPixelFormatIn, int iPixelFormatOut); 12 | int (*Convert)(PT_VideoBuf ptVideoBufIn, PT_VideoBuf ptVideoBufOut); 13 | int (*ConvertExit)(PT_VideoBuf ptVideoBufOut); 14 | struct VideoConvert *ptNext; 15 | }T_VideoConvert, *PT_VideoConvert; 16 | 17 | PT_VideoConvert GetVideoConvertForFormats(int iPixelFormatIn, int iPixelFormatOut); 18 | int VideoConvertInit(void); 19 | 20 | int Yuv2RgbInit(void); 21 | int Mjpeg2RgbInit(void); 22 | int Rgb2RgbInit(void); 23 | int RegisterVideoConvert(PT_VideoConvert ptVideoConvert); 24 | 25 | 26 | #endif /* _CONVERT_MANAGER_H */ 27 | 28 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/include/disp_manager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/include/disp_manager.h -------------------------------------------------------------------------------- /camera_100ask/video2lcd/include/pic_operation.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/include/pic_operation.h -------------------------------------------------------------------------------- /camera_100ask/video2lcd/include/picfmt_manager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/include/picfmt_manager.h -------------------------------------------------------------------------------- /camera_100ask/video2lcd/include/render.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/include/render.h -------------------------------------------------------------------------------- /camera_100ask/video2lcd/include/video_manager.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/include/video_manager.h -------------------------------------------------------------------------------- /camera_100ask/video2lcd/log.txt: -------------------------------------------------------------------------------- 1 | ./ 2 | |-- display 3 | | |-- disp_manager.c 4 | | |-- fb.c 5 | | |-- Makefile 6 | | `-- test 7 | | |-- Makefile 8 | | `-- test.c 9 | |-- draw 10 | | |-- draw.c 11 | | `-- Makefile 12 | |-- encoding 13 | | |-- ascii.c 14 | | |-- encoding_manager.c 15 | | |-- Makefile 16 | | |-- utf-16be.c 17 | | |-- utf-16le.c 18 | | `-- utf-8.c 19 | |-- fonts 20 | | |-- ascii.c 21 | | |-- fonts_manager.c 22 | | |-- freetype.c 23 | | |-- gbk.c 24 | | `-- Makefile 25 | |-- include 26 | | |-- config.h 27 | | |-- disp_manager.h 28 | | |-- draw.h 29 | | |-- encoding_manager.h 30 | | `-- fonts_manager.h 31 | |-- log.txt 32 | |-- main.c 33 | `-- Makefile 34 | 35 | 6 directories, 26 files 36 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/main.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/main.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/netprint_client.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/netprint_client.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/render/Makefile: -------------------------------------------------------------------------------- 1 | obj-y += operation/ 2 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/render/operation/Makefile: -------------------------------------------------------------------------------- 1 | obj-y += zoom.o 2 | obj-y += merge.o 3 | 4 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/render/operation/merge.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/render/operation/merge.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/render/operation/zoom.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/render/operation/zoom.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/video/Makefile: -------------------------------------------------------------------------------- 1 | obj-y += video_manager.o 2 | obj-y += v4l2.o 3 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/video/v4l2.c: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | 14 | static int g_aiSupportedFormats[] = {V4L2_PIX_FMT_YUYV, V4L2_PIX_FMT_MJPEG, V4L2_PIX_FMT_RGB565}; 15 | 16 | static int V4l2GetFrameForReadWrite(PT_VideoDevice ptVideoDevice, PT_VideoBuf ptVideoBuf); 17 | static int V4l2PutFrameForReadWrite(PT_VideoDevice ptVideoDevice, PT_VideoBuf ptVideoBuf); 18 | static T_VideoOpr g_tV4l2VideoOpr; 19 | 20 | static int isSupportThisFormat(int iPixelFormat) 21 | { 22 | int i; 23 | for (i = 0; i < sizeof(g_aiSupportedFormats)/sizeof(g_aiSupportedFormats[0]); i++) 24 | { 25 | if (g_aiSupportedFormats[i] == iPixelFormat) 26 | return 1; 27 | } 28 | return 0; 29 | } 30 | 31 | /* �ο� luvcview */ 32 | 33 | /* open 34 | * VIDIOC_QUERYCAP ȷ�����Ƿ���Ƶ��׽�豸,֧�����ֽӿ�(streaming/read,write) 35 | * VIDIOC_ENUM_FMT ��ѯ֧�����ָ�ʽ 36 | * VIDIOC_S_FMT ��������ͷʹ�����ָ�ʽ 37 | * VIDIOC_REQBUFS ����buffer 38 | ���� streaming: 39 | * VIDIOC_QUERYBUF ȷ��ÿһ��buffer����Ϣ ���� mmap 40 | * VIDIOC_QBUF ������� 41 | * VIDIOC_STREAMON �����豸 42 | * poll �ȴ������� 43 | * VIDIOC_DQBUF �Ӷ�����ȡ�� 44 | * ����.... 45 | * VIDIOC_QBUF ������� 46 | * .... 47 | ����read,write: 48 | read 49 | ����.... 50 | read 51 | * VIDIOC_STREAMOFF ֹͣ�豸 52 | * 53 | */ 54 | 55 | static int V4l2InitDevice(char *strDevName, PT_VideoDevice ptVideoDevice) 56 | { 57 | int i; 58 | int iFd; 59 | int iError; 60 | struct v4l2_capability tV4l2Cap; 61 | struct v4l2_fmtdesc tFmtDesc; 62 | struct v4l2_format tV4l2Fmt; 63 | struct v4l2_requestbuffers tV4l2ReqBuffs; 64 | struct v4l2_buffer tV4l2Buf; 65 | 66 | int iLcdWidth; 67 | int iLcdHeigt; 68 | int iLcdBpp; 69 | 70 | iFd = open(strDevName, O_RDWR); 71 | if (iFd < 0) 72 | { 73 | DBG_PRINTF("can not open %s\n", strDevName); 74 | return -1; 75 | } 76 | ptVideoDevice->iFd = iFd; 77 | 78 | iError = ioctl(iFd, VIDIOC_QUERYCAP, &tV4l2Cap); 79 | memset(&tV4l2Cap, 0, sizeof(struct v4l2_capability)); 80 | iError = ioctl(iFd, VIDIOC_QUERYCAP, &tV4l2Cap); 81 | if (iError) { 82 | DBG_PRINTF("Error opening device %s: unable to query device.\n", strDevName); 83 | goto err_exit; 84 | } 85 | 86 | if (!(tV4l2Cap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) 87 | { 88 | DBG_PRINTF("%s is not a video capture device\n", strDevName); 89 | goto err_exit; 90 | } 91 | 92 | if (tV4l2Cap.capabilities & V4L2_CAP_STREAMING) { 93 | DBG_PRINTF("%s supports streaming i/o\n", strDevName); 94 | } 95 | 96 | if (tV4l2Cap.capabilities & V4L2_CAP_READWRITE) { 97 | DBG_PRINTF("%s supports read i/o\n", strDevName); 98 | } 99 | 100 | memset(&tFmtDesc, 0, sizeof(tFmtDesc)); 101 | tFmtDesc.index = 0; 102 | tFmtDesc.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 103 | while ((iError = ioctl(iFd, VIDIOC_ENUM_FMT, &tFmtDesc)) == 0) { 104 | if (isSupportThisFormat(tFmtDesc.pixelformat)) 105 | { 106 | ptVideoDevice->iPixelFormat = tFmtDesc.pixelformat; 107 | break; 108 | } 109 | tFmtDesc.index++; 110 | } 111 | 112 | if (!ptVideoDevice->iPixelFormat) 113 | { 114 | DBG_PRINTF("can not support the format of this device\n"); 115 | goto err_exit; 116 | } 117 | 118 | 119 | /* set format in */ 120 | GetDispResolution(&iLcdWidth, &iLcdHeigt, &iLcdBpp); 121 | memset(&tV4l2Fmt, 0, sizeof(struct v4l2_format)); 122 | tV4l2Fmt.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 123 | tV4l2Fmt.fmt.pix.pixelformat = ptVideoDevice->iPixelFormat; 124 | tV4l2Fmt.fmt.pix.width = iLcdWidth; 125 | tV4l2Fmt.fmt.pix.height = iLcdHeigt; 126 | tV4l2Fmt.fmt.pix.field = V4L2_FIELD_ANY; 127 | 128 | /* ��������������޷�ijЩ����(����ֱ���), 129 | * ���������Щ����, ���ҷ��ظ�Ӧ�ó��� 130 | */ 131 | iError = ioctl(iFd, VIDIOC_S_FMT, &tV4l2Fmt); 132 | if (iError) 133 | { 134 | DBG_PRINTF("Unable to set format\n"); 135 | goto err_exit; 136 | } 137 | ptVideoDevice->iWidth = tV4l2Fmt.fmt.pix.width; 138 | ptVideoDevice->iHeight = tV4l2Fmt.fmt.pix.height; 139 | 140 | /* request buffers */ 141 | memset(&tV4l2ReqBuffs, 0, sizeof(struct v4l2_requestbuffers)); 142 | tV4l2ReqBuffs.count = NB_BUFFER; 143 | tV4l2ReqBuffs.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 144 | tV4l2ReqBuffs.memory = V4L2_MEMORY_MMAP; 145 | 146 | iError = ioctl(iFd, VIDIOC_REQBUFS, &tV4l2ReqBuffs); 147 | if (iError) 148 | { 149 | DBG_PRINTF("Unable to allocate buffers.\n"); 150 | goto err_exit; 151 | } 152 | 153 | ptVideoDevice->iVideoBufCnt = tV4l2ReqBuffs.count; 154 | if (tV4l2Cap.capabilities & V4L2_CAP_STREAMING) 155 | { 156 | /* map the buffers */ 157 | for (i = 0; i < ptVideoDevice->iVideoBufCnt; i++) 158 | { 159 | memset(&tV4l2Buf, 0, sizeof(struct v4l2_buffer)); 160 | tV4l2Buf.index = i; 161 | tV4l2Buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 162 | tV4l2Buf.memory = V4L2_MEMORY_MMAP; 163 | iError = ioctl(iFd, VIDIOC_QUERYBUF, &tV4l2Buf); 164 | if (iError) 165 | { 166 | DBG_PRINTF("Unable to query buffer.\n"); 167 | goto err_exit; 168 | } 169 | 170 | ptVideoDevice->iVideoBufMaxLen = tV4l2Buf.length; 171 | ptVideoDevice->pucVideBuf[i] = mmap(0 /* start anywhere */ , 172 | tV4l2Buf.length, PROT_READ, MAP_SHARED, iFd, 173 | tV4l2Buf.m.offset); 174 | if (ptVideoDevice->pucVideBuf[i] == MAP_FAILED) 175 | { 176 | DBG_PRINTF("Unable to map buffer\n"); 177 | goto err_exit; 178 | } 179 | } 180 | 181 | /* Queue the buffers. */ 182 | for (i = 0; i < ptVideoDevice->iVideoBufCnt; i++) 183 | { 184 | memset(&tV4l2Buf, 0, sizeof(struct v4l2_buffer)); 185 | tV4l2Buf.index = i; 186 | tV4l2Buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 187 | tV4l2Buf.memory = V4L2_MEMORY_MMAP; 188 | iError = ioctl(iFd, VIDIOC_QBUF, &tV4l2Buf); 189 | if (iError) 190 | { 191 | DBG_PRINTF("Unable to queue buffer.\n"); 192 | goto err_exit; 193 | } 194 | } 195 | 196 | } 197 | else if (tV4l2Cap.capabilities & V4L2_CAP_READWRITE) 198 | { 199 | g_tV4l2VideoOpr.GetFrame = V4l2GetFrameForReadWrite; 200 | g_tV4l2VideoOpr.PutFrame = V4l2PutFrameForReadWrite; 201 | 202 | /* read(fd, buf, size) */ 203 | ptVideoDevice->iVideoBufCnt = 1; 204 | /* �������������֧�ֵĸ�ʽ��, һ���������ֻ��Ҫ4�ֽ� */ 205 | ptVideoDevice->iVideoBufMaxLen = ptVideoDevice->iWidth * ptVideoDevice->iHeight * 4; 206 | ptVideoDevice->pucVideBuf[0] = malloc(ptVideoDevice->iVideoBufMaxLen); 207 | } 208 | 209 | ptVideoDevice->ptOPr = &g_tV4l2VideoOpr; 210 | return 0; 211 | 212 | err_exit: 213 | close(iFd); 214 | return -1; 215 | } 216 | 217 | static int V4l2ExitDevice(PT_VideoDevice ptVideoDevice) 218 | { 219 | int i; 220 | for (i = 0; i < ptVideoDevice->iVideoBufCnt; i++) 221 | { 222 | if (ptVideoDevice->pucVideBuf[i]) 223 | { 224 | munmap(ptVideoDevice->pucVideBuf[i], ptVideoDevice->iVideoBufMaxLen); 225 | ptVideoDevice->pucVideBuf[i] = NULL; 226 | } 227 | } 228 | 229 | close(ptVideoDevice->iFd); 230 | return 0; 231 | } 232 | 233 | static int V4l2GetFrameForStreaming(PT_VideoDevice ptVideoDevice, PT_VideoBuf ptVideoBuf) 234 | { 235 | struct pollfd tFds[1]; 236 | int iRet; 237 | struct v4l2_buffer tV4l2Buf; 238 | 239 | /* poll */ 240 | tFds[0].fd = ptVideoDevice->iFd; 241 | tFds[0].events = POLLIN; 242 | 243 | iRet = poll(tFds, 1, -1); 244 | if (iRet <= 0) 245 | { 246 | DBG_PRINTF("poll error!\n"); 247 | return -1; 248 | } 249 | 250 | /* VIDIOC_DQBUF */ 251 | memset(&tV4l2Buf, 0, sizeof(struct v4l2_buffer)); 252 | tV4l2Buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 253 | tV4l2Buf.memory = V4L2_MEMORY_MMAP; 254 | iRet = ioctl(ptVideoDevice->iFd, VIDIOC_DQBUF, &tV4l2Buf); 255 | if (iRet < 0) 256 | { 257 | DBG_PRINTF("Unable to dequeue buffer.\n"); 258 | return -1; 259 | } 260 | ptVideoDevice->iVideoBufCurIndex = tV4l2Buf.index; 261 | 262 | ptVideoBuf->iPixelFormat = ptVideoDevice->iPixelFormat; 263 | ptVideoBuf->tPixelDatas.iWidth = ptVideoDevice->iWidth; 264 | ptVideoBuf->tPixelDatas.iHeight = ptVideoDevice->iHeight; 265 | ptVideoBuf->tPixelDatas.iBpp = (ptVideoDevice->iPixelFormat == V4L2_PIX_FMT_YUYV) ? 16 : \ 266 | (ptVideoDevice->iPixelFormat == V4L2_PIX_FMT_MJPEG) ? 0 : \ 267 | (ptVideoDevice->iPixelFormat == V4L2_PIX_FMT_RGB565) ? 16 : \ 268 | 0; 269 | ptVideoBuf->tPixelDatas.iLineBytes = ptVideoDevice->iWidth * ptVideoBuf->tPixelDatas.iBpp / 8; 270 | ptVideoBuf->tPixelDatas.iTotalBytes = tV4l2Buf.bytesused; 271 | ptVideoBuf->tPixelDatas.aucPixelDatas = ptVideoDevice->pucVideBuf[tV4l2Buf.index]; 272 | return 0; 273 | } 274 | 275 | 276 | static int V4l2PutFrameForStreaming(PT_VideoDevice ptVideoDevice, PT_VideoBuf ptVideoBuf) 277 | { 278 | /* VIDIOC_QBUF */ 279 | struct v4l2_buffer tV4l2Buf; 280 | int iError; 281 | 282 | memset(&tV4l2Buf, 0, sizeof(struct v4l2_buffer)); 283 | tV4l2Buf.index = ptVideoDevice->iVideoBufCurIndex; 284 | tV4l2Buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE; 285 | tV4l2Buf.memory = V4L2_MEMORY_MMAP; 286 | iError = ioctl(ptVideoDevice->iFd, VIDIOC_QBUF, &tV4l2Buf); 287 | if (iError) 288 | { 289 | DBG_PRINTF("Unable to queue buffer.\n"); 290 | return -1; 291 | } 292 | return 0; 293 | } 294 | 295 | static int V4l2GetFrameForReadWrite(PT_VideoDevice ptVideoDevice, PT_VideoBuf ptVideoBuf) 296 | { 297 | int iRet; 298 | 299 | iRet = read(ptVideoDevice->iFd, ptVideoDevice->pucVideBuf[0], ptVideoDevice->iVideoBufMaxLen); 300 | if (iRet <= 0) 301 | { 302 | return -1; 303 | } 304 | 305 | ptVideoBuf->iPixelFormat = ptVideoDevice->iPixelFormat; 306 | ptVideoBuf->tPixelDatas.iWidth = ptVideoDevice->iWidth; 307 | ptVideoBuf->tPixelDatas.iHeight = ptVideoDevice->iHeight; 308 | ptVideoBuf->tPixelDatas.iBpp = (ptVideoDevice->iPixelFormat == V4L2_PIX_FMT_YUYV) ? 16 : \ 309 | (ptVideoDevice->iPixelFormat == V4L2_PIX_FMT_MJPEG) ? 0 : \ 310 | (ptVideoDevice->iPixelFormat == V4L2_PIX_FMT_RGB565)? 16 : \ 311 | 0; 312 | ptVideoBuf->tPixelDatas.iLineBytes = ptVideoDevice->iWidth * ptVideoBuf->tPixelDatas.iBpp / 8; 313 | ptVideoBuf->tPixelDatas.iTotalBytes = iRet; 314 | ptVideoBuf->tPixelDatas.aucPixelDatas = ptVideoDevice->pucVideBuf[0]; 315 | 316 | return 0; 317 | } 318 | 319 | 320 | static int V4l2PutFrameForReadWrite(PT_VideoDevice ptVideoDevice, PT_VideoBuf ptVideoBuf) 321 | { 322 | return 0; 323 | } 324 | 325 | static int V4l2StartDevice(PT_VideoDevice ptVideoDevice) 326 | { 327 | int iType = V4L2_BUF_TYPE_VIDEO_CAPTURE; 328 | int iError; 329 | 330 | iError = ioctl(ptVideoDevice->iFd, VIDIOC_STREAMON, &iType); 331 | if (iError) 332 | { 333 | DBG_PRINTF("Unable to start capture.\n"); 334 | return -1; 335 | } 336 | return 0; 337 | } 338 | 339 | static int V4l2StopDevice(PT_VideoDevice ptVideoDevice) 340 | { 341 | int iType = V4L2_BUF_TYPE_VIDEO_CAPTURE; 342 | int iError; 343 | 344 | iError = ioctl(ptVideoDevice->iFd, VIDIOC_STREAMOFF, &iType); 345 | if (iError) 346 | { 347 | DBG_PRINTF("Unable to stop capture.\n"); 348 | return -1; 349 | } 350 | return 0; 351 | } 352 | 353 | static int V4l2GetFormat(PT_VideoDevice ptVideoDevice) 354 | { 355 | return ptVideoDevice->iPixelFormat; 356 | } 357 | 358 | 359 | /* ����һ��VideoOpr�ṹ�� */ 360 | static T_VideoOpr g_tV4l2VideoOpr = { 361 | .name = "v4l2", 362 | .InitDevice = V4l2InitDevice, 363 | .ExitDevice = V4l2ExitDevice, 364 | .GetFormat = V4l2GetFormat, 365 | .GetFrame = V4l2GetFrameForStreaming, 366 | .PutFrame = V4l2PutFrameForStreaming, 367 | .StartDevice = V4l2StartDevice, 368 | .StopDevice = V4l2StopDevice, 369 | }; 370 | 371 | /* ע������ṹ�� */ 372 | int V4l2Init(void) 373 | { 374 | return RegisterVideoOpr(&g_tV4l2VideoOpr); 375 | } 376 | 377 | -------------------------------------------------------------------------------- /camera_100ask/video2lcd/video/video_manager.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/video/video_manager.c -------------------------------------------------------------------------------- /camera_100ask/video2lcd/说明.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/100askTeam/lv_100ask_linux_camera/6697fd4cdea3d2ea55135acc8fcc1c89aa07510c/camera_100ask/video2lcd/说明.txt -------------------------------------------------------------------------------- /lv_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_conf.h 3 | * Configuration file for v8.2.0 4 | */ 5 | 6 | /* 7 | * Copy this file as `lv_conf.h` 8 | * 1. simply next to the `lvgl` folder 9 | * 2. or any other places and 10 | * - define `LV_CONF_INCLUDE_SIMPLE` 11 | * - add the path as include path 12 | */ 13 | 14 | /* clang-format off */ 15 | #if 1 /*Set it to "1" to enable content*/ 16 | 17 | #ifndef LV_CONF_H 18 | #define LV_CONF_H 19 | 20 | #include 21 | 22 | /*======================= 23 | FUNCTION PROTOTYPES 24 | *=======================*/ 25 | 26 | extern uint32_t custom_tick_get(void); 27 | 28 | /*==================== 29 | COLOR SETTINGS 30 | *====================*/ 31 | 32 | /*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/ 33 | #define LV_COLOR_DEPTH 32 34 | 35 | /*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/ 36 | #define LV_COLOR_16_SWAP 0 37 | 38 | /*Enable more complex drawing routines to manage screens transparency. 39 | *Can be used if the UI is above another layer, e.g. an OSD menu or video player. 40 | *Requires `LV_COLOR_DEPTH = 32` colors and the screen's `bg_opa` should be set to non LV_OPA_COVER value*/ 41 | #define LV_COLOR_SCREEN_TRANSP 0 42 | 43 | /* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently. 44 | * 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */ 45 | #define LV_COLOR_MIX_ROUND_OFS (LV_COLOR_DEPTH == 32 ? 0: 128) 46 | 47 | /*Images pixels with this color will not be drawn if they are chroma keyed)*/ 48 | #define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/ 49 | 50 | /*========================= 51 | MEMORY SETTINGS 52 | *=========================*/ 53 | 54 | /*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/ 55 | #define LV_MEM_CUSTOM 1 56 | #if LV_MEM_CUSTOM == 0 57 | /*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/ 58 | #define LV_MEM_SIZE (2 * 1024U * 1024U) /*[bytes]*/ 59 | 60 | /*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/ 61 | #define LV_MEM_ADR 0 /*0: unused*/ 62 | /*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/ 63 | #if LV_MEM_ADR == 0 64 | //#define LV_MEM_POOL_INCLUDE your_alloc_library /* Uncomment if using an external allocator*/ 65 | //#define LV_MEM_POOL_ALLOC your_alloc /* Uncomment if using an external allocator*/ 66 | #endif 67 | 68 | #else /*LV_MEM_CUSTOM*/ 69 | #define LV_MEM_CUSTOM_INCLUDE /*Header for the dynamic memory function*/ 70 | #define LV_MEM_CUSTOM_ALLOC malloc 71 | #define LV_MEM_CUSTOM_FREE free 72 | #define LV_MEM_CUSTOM_REALLOC realloc 73 | #endif /*LV_MEM_CUSTOM*/ 74 | 75 | /*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms. 76 | *You will see an error log message if there wasn't enough buffers. */ 77 | #define LV_MEM_BUF_MAX_NUM 16 78 | 79 | /*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/ 80 | #define LV_MEMCPY_MEMSET_STD 0 81 | 82 | /*==================== 83 | HAL SETTINGS 84 | *====================*/ 85 | 86 | /*Default display refresh period. LVG will redraw changed areas with this period time*/ 87 | #define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/ 88 | 89 | /*Input device read period in milliseconds*/ 90 | #define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/ 91 | 92 | /*Use a custom tick source that tells the elapsed time in milliseconds. 93 | *It removes the need to manually update the tick with `lv_tick_inc()`)*/ 94 | #define LV_TICK_CUSTOM 1 95 | #if LV_TICK_CUSTOM 96 | #define LV_TICK_CUSTOM_INCLUDE /*Header for the system time function*/ 97 | #define LV_TICK_CUSTOM_SYS_TIME_EXPR (custom_tick_get()) /*Expression evaluating to current system time in ms*/ 98 | #endif /*LV_TICK_CUSTOM*/ 99 | 100 | /*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings. 101 | *(Not so important, you can adjust it to modify default sizes and spaces)*/ 102 | #define LV_DPI_DEF 130 /*[px/inch]*/ 103 | 104 | /*======================= 105 | * FEATURE CONFIGURATION 106 | *=======================*/ 107 | 108 | /*------------- 109 | * Drawing 110 | *-----------*/ 111 | 112 | /*Enable complex draw engine. 113 | *Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/ 114 | #define LV_DRAW_COMPLEX 1 115 | #if LV_DRAW_COMPLEX != 0 116 | 117 | /*Allow buffering some shadow calculation. 118 | *LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius` 119 | *Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/ 120 | #define LV_SHADOW_CACHE_SIZE 0 121 | 122 | /* Set number of maximally cached circle data. 123 | * The circumference of 1/4 circle are saved for anti-aliasing 124 | * radius * 4 bytes are used per circle (the most often used radiuses are saved) 125 | * 0: to disable caching */ 126 | #define LV_CIRCLE_CACHE_SIZE 4 127 | #endif /*LV_DRAW_COMPLEX*/ 128 | 129 | /*Default image cache size. Image caching keeps the images opened. 130 | *If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added) 131 | *With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images. 132 | *However the opened images might consume additional RAM. 133 | *0: to disable caching*/ 134 | #define LV_IMG_CACHE_DEF_SIZE 0 135 | 136 | /*Number of stops allowed per gradient. Increase this to allow more stops. 137 | *This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/ 138 | #define LV_GRADIENT_MAX_STOPS 2 139 | 140 | /*Default gradient buffer size. 141 | *When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again. 142 | *LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes. 143 | *If the cache is too small the map will be allocated only while it's required for the drawing. 144 | *0 mean no caching.*/ 145 | #define LV_GRAD_CACHE_DEF_SIZE 0 146 | 147 | /*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display) 148 | *LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface 149 | *The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */ 150 | #define LV_DITHER_GRADIENT 0 151 | #if LV_DITHER_GRADIENT 152 | /*Add support for error diffusion dithering. 153 | *Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing. 154 | *The increase in memory consumption is (24 bits * object's width)*/ 155 | #define LV_DITHER_ERROR_DIFFUSION 0 156 | #endif 157 | 158 | /*Maximum buffer size to allocate for rotation. 159 | *Only used if software rotation is enabled in the display driver.*/ 160 | #define LV_DISP_ROT_MAX_BUF (10*1024) 161 | 162 | /*------------- 163 | * GPU 164 | *-----------*/ 165 | 166 | /*Use STM32's DMA2D (aka Chrom Art) GPU*/ 167 | #define LV_USE_GPU_STM32_DMA2D 0 168 | #if LV_USE_GPU_STM32_DMA2D 169 | /*Must be defined to include path of CMSIS header of target processor 170 | e.g. "stm32f769xx.h" or "stm32f429xx.h"*/ 171 | #define LV_GPU_DMA2D_CMSIS_INCLUDE 172 | #endif 173 | 174 | /*Use NXP's PXP GPU iMX RTxxx platforms*/ 175 | #define LV_USE_GPU_NXP_PXP 0 176 | #if LV_USE_GPU_NXP_PXP 177 | /*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c) 178 | * and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS 179 | * has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected. 180 | *0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init() 181 | */ 182 | #define LV_USE_GPU_NXP_PXP_AUTO_INIT 0 183 | #endif 184 | 185 | /*Use NXP's VG-Lite GPU iMX RTxxx platforms*/ 186 | #define LV_USE_GPU_NXP_VG_LITE 0 187 | 188 | /*Use SDL renderer API*/ 189 | #define LV_USE_GPU_SDL 0 190 | #if LV_USE_GPU_SDL 191 | #define LV_GPU_SDL_INCLUDE_PATH 192 | /*Texture cache size, 8MB by default*/ 193 | #define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8) 194 | /*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/ 195 | #define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6)) 196 | #endif 197 | 198 | /*------------- 199 | * Logging 200 | *-----------*/ 201 | 202 | /*Enable the log module*/ 203 | #define LV_USE_LOG 1 204 | #if LV_USE_LOG 205 | 206 | /*How important log should be added: 207 | *LV_LOG_LEVEL_TRACE A lot of logs to give detailed information 208 | *LV_LOG_LEVEL_INFO Log important events 209 | *LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem 210 | *LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail 211 | *LV_LOG_LEVEL_USER Only logs added by the user 212 | *LV_LOG_LEVEL_NONE Do not log anything*/ 213 | #define LV_LOG_LEVEL LV_LOG_LEVEL_WARN 214 | 215 | /*1: Print the log with 'printf'; 216 | *0: User need to register a callback with `lv_log_register_print_cb()`*/ 217 | #define LV_LOG_PRINTF 1 218 | 219 | /*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/ 220 | #define LV_LOG_TRACE_MEM 1 221 | #define LV_LOG_TRACE_TIMER 1 222 | #define LV_LOG_TRACE_INDEV 1 223 | #define LV_LOG_TRACE_DISP_REFR 1 224 | #define LV_LOG_TRACE_EVENT 1 225 | #define LV_LOG_TRACE_OBJ_CREATE 1 226 | #define LV_LOG_TRACE_LAYOUT 1 227 | #define LV_LOG_TRACE_ANIM 1 228 | 229 | #endif /*LV_USE_LOG*/ 230 | 231 | /*------------- 232 | * Asserts 233 | *-----------*/ 234 | 235 | /*Enable asserts if an operation is failed or an invalid data is found. 236 | *If LV_USE_LOG is enabled an error message will be printed on failure*/ 237 | #define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/ 238 | #define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/ 239 | #define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/ 240 | #define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/ 241 | #define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/ 242 | 243 | /*Add a custom handler when assert happens e.g. to restart the MCU*/ 244 | #define LV_ASSERT_HANDLER_INCLUDE 245 | #define LV_ASSERT_HANDLER while(1); /*Halt by default*/ 246 | 247 | /*------------- 248 | * Others 249 | *-----------*/ 250 | 251 | /*1: Show CPU usage and FPS count*/ 252 | #define LV_USE_PERF_MONITOR 1 253 | #if LV_USE_PERF_MONITOR 254 | #define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT 255 | #endif 256 | 257 | /*1: Show the used memory and the memory fragmentation 258 | * Requires LV_MEM_CUSTOM = 0*/ 259 | #define LV_USE_MEM_MONITOR 0 260 | #if LV_USE_MEM_MONITOR 261 | #define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT 262 | #endif 263 | 264 | /*1: Draw random colored rectangles over the redrawn areas*/ 265 | #define LV_USE_REFR_DEBUG 0 266 | 267 | /*Change the built in (v)snprintf functions*/ 268 | #define LV_SPRINTF_CUSTOM 0 269 | #if LV_SPRINTF_CUSTOM 270 | #define LV_SPRINTF_INCLUDE 271 | #define lv_snprintf snprintf 272 | #define lv_vsnprintf vsnprintf 273 | #else /*LV_SPRINTF_CUSTOM*/ 274 | #define LV_SPRINTF_USE_FLOAT 0 275 | #endif /*LV_SPRINTF_CUSTOM*/ 276 | 277 | #define LV_USE_USER_DATA 1 278 | 279 | /*Garbage Collector settings 280 | *Used if lvgl is bound to higher level language and the memory is managed by that language*/ 281 | #define LV_ENABLE_GC 0 282 | #if LV_ENABLE_GC != 0 283 | #define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/ 284 | #endif /*LV_ENABLE_GC*/ 285 | 286 | /*===================== 287 | * COMPILER SETTINGS 288 | *====================*/ 289 | 290 | /*For big endian systems set to 1*/ 291 | #define LV_BIG_ENDIAN_SYSTEM 0 292 | 293 | /*Define a custom attribute to `lv_tick_inc` function*/ 294 | #define LV_ATTRIBUTE_TICK_INC 295 | 296 | /*Define a custom attribute to `lv_timer_handler` function*/ 297 | #define LV_ATTRIBUTE_TIMER_HANDLER 298 | 299 | /*Define a custom attribute to `lv_disp_flush_ready` function*/ 300 | #define LV_ATTRIBUTE_FLUSH_READY 301 | 302 | /*Required alignment size for buffers*/ 303 | #define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1 304 | 305 | /*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default). 306 | * E.g. __attribute__((aligned(4)))*/ 307 | #define LV_ATTRIBUTE_MEM_ALIGN 308 | 309 | /*Attribute to mark large constant arrays for example font's bitmaps*/ 310 | #define LV_ATTRIBUTE_LARGE_CONST 311 | 312 | /*Compiler prefix for a big array declaration in RAM*/ 313 | #define LV_ATTRIBUTE_LARGE_RAM_ARRAY 314 | 315 | /*Place performance critical functions into a faster memory (e.g RAM)*/ 316 | #define LV_ATTRIBUTE_FAST_MEM 317 | 318 | /*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/ 319 | #define LV_ATTRIBUTE_DMA 320 | 321 | /*Export integer constant to binding. This macro is used with constants in the form of LV_ that 322 | *should also appear on LVGL binding API such as Micropython.*/ 323 | #define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/ 324 | 325 | /*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/ 326 | #define LV_USE_LARGE_COORD 0 327 | 328 | /*================== 329 | * FONT USAGE 330 | *===================*/ 331 | 332 | /*Montserrat fonts with ASCII range and some symbols using bpp = 4 333 | *https://fonts.google.com/specimen/Montserrat*/ 334 | #define LV_FONT_MONTSERRAT_8 0 335 | #define LV_FONT_MONTSERRAT_10 0 336 | #define LV_FONT_MONTSERRAT_12 0 337 | #define LV_FONT_MONTSERRAT_14 1 338 | #define LV_FONT_MONTSERRAT_16 0 339 | #define LV_FONT_MONTSERRAT_18 0 340 | #define LV_FONT_MONTSERRAT_20 1 341 | #define LV_FONT_MONTSERRAT_22 1 342 | #define LV_FONT_MONTSERRAT_24 0 343 | #define LV_FONT_MONTSERRAT_26 0 344 | #define LV_FONT_MONTSERRAT_28 1 345 | #define LV_FONT_MONTSERRAT_30 0 346 | #define LV_FONT_MONTSERRAT_32 0 347 | #define LV_FONT_MONTSERRAT_34 0 348 | #define LV_FONT_MONTSERRAT_36 0 349 | #define LV_FONT_MONTSERRAT_38 0 350 | #define LV_FONT_MONTSERRAT_40 1 351 | #define LV_FONT_MONTSERRAT_42 0 352 | #define LV_FONT_MONTSERRAT_44 0 353 | #define LV_FONT_MONTSERRAT_46 0 354 | #define LV_FONT_MONTSERRAT_48 0 355 | 356 | /*Demonstrate special features*/ 357 | #define LV_FONT_MONTSERRAT_12_SUBPX 0 358 | #define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/ 359 | #define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/ 360 | #define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/ 361 | 362 | /*Pixel perfect monospace fonts*/ 363 | #define LV_FONT_UNSCII_8 0 364 | #define LV_FONT_UNSCII_16 0 365 | 366 | /*Optionally declare custom fonts here. 367 | *You can use these fonts as default font too and they will be available globally. 368 | *E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/ 369 | #define LV_FONT_CUSTOM_DECLARE 370 | 371 | /*Always set a default font*/ 372 | #define LV_FONT_DEFAULT &lv_font_montserrat_14 373 | 374 | /*Enable handling large font and/or fonts with a lot of characters. 375 | *The limit depends on the font size, font face and bpp. 376 | *Compiler error will be triggered if a font needs it.*/ 377 | #define LV_FONT_FMT_TXT_LARGE 1 378 | 379 | /*Enables/disables support for compressed fonts.*/ 380 | #define LV_USE_FONT_COMPRESSED 0 381 | 382 | /*Enable subpixel rendering*/ 383 | #define LV_USE_FONT_SUBPX 0 384 | #if LV_USE_FONT_SUBPX 385 | /*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/ 386 | #define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/ 387 | #endif 388 | 389 | /*================= 390 | * TEXT SETTINGS 391 | *=================*/ 392 | 393 | /** 394 | * Select a character encoding for strings. 395 | * Your IDE or editor should have the same character encoding 396 | * - LV_TXT_ENC_UTF8 397 | * - LV_TXT_ENC_ASCII 398 | */ 399 | #define LV_TXT_ENC LV_TXT_ENC_UTF8 400 | 401 | /*Can break (wrap) texts on these chars*/ 402 | #define LV_TXT_BREAK_CHARS " ,.;:-_" 403 | 404 | /*If a word is at least this long, will break wherever "prettiest" 405 | *To disable, set to a value <= 0*/ 406 | #define LV_TXT_LINE_BREAK_LONG_LEN 0 407 | 408 | /*Minimum number of characters in a long word to put on a line before a break. 409 | *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ 410 | #define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3 411 | 412 | /*Minimum number of characters in a long word to put on a line after a break. 413 | *Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/ 414 | #define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3 415 | 416 | /*The control character to use for signalling text recoloring.*/ 417 | #define LV_TXT_COLOR_CMD "#" 418 | 419 | /*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts. 420 | *The direction will be processed according to the Unicode Bidirectional Algorithm: 421 | *https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/ 422 | #define LV_USE_BIDI 0 423 | #if LV_USE_BIDI 424 | /*Set the default direction. Supported values: 425 | *`LV_BASE_DIR_LTR` Left-to-Right 426 | *`LV_BASE_DIR_RTL` Right-to-Left 427 | *`LV_BASE_DIR_AUTO` detect texts base direction*/ 428 | #define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO 429 | #endif 430 | 431 | /*Enable Arabic/Persian processing 432 | *In these languages characters should be replaced with an other form based on their position in the text*/ 433 | #define LV_USE_ARABIC_PERSIAN_CHARS 0 434 | 435 | /*================== 436 | * WIDGET USAGE 437 | *================*/ 438 | 439 | /*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/ 440 | 441 | #define LV_USE_ARC 1 442 | 443 | #define LV_USE_ANIMIMG 1 444 | 445 | #define LV_USE_BAR 1 446 | 447 | #define LV_USE_BTN 1 448 | 449 | #define LV_USE_BTNMATRIX 1 450 | 451 | #define LV_USE_CANVAS 1 452 | 453 | #define LV_USE_CHECKBOX 1 454 | 455 | #define LV_USE_DROPDOWN 1 /*Requires: lv_label*/ 456 | 457 | #define LV_USE_IMG 1 /*Requires: lv_label*/ 458 | 459 | #define LV_USE_LABEL 1 460 | #if LV_USE_LABEL 461 | #define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/ 462 | #define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/ 463 | #endif 464 | 465 | #define LV_USE_LINE 1 466 | 467 | #define LV_USE_ROLLER 1 /*Requires: lv_label*/ 468 | #if LV_USE_ROLLER 469 | #define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/ 470 | #endif 471 | 472 | #define LV_USE_SLIDER 1 /*Requires: lv_bar*/ 473 | 474 | #define LV_USE_SWITCH 1 475 | 476 | #define LV_USE_TEXTAREA 1 /*Requires: lv_label*/ 477 | #if LV_USE_TEXTAREA != 0 478 | #define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/ 479 | #endif 480 | 481 | #define LV_USE_TABLE 1 482 | 483 | /*================== 484 | * EXTRA COMPONENTS 485 | *==================*/ 486 | 487 | /*----------- 488 | * Widgets 489 | *----------*/ 490 | #define LV_USE_CALENDAR 1 491 | #if LV_USE_CALENDAR 492 | #define LV_CALENDAR_WEEK_STARTS_MONDAY 0 493 | #if LV_CALENDAR_WEEK_STARTS_MONDAY 494 | #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"} 495 | #else 496 | #define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"} 497 | #endif 498 | 499 | #define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"} 500 | #define LV_USE_CALENDAR_HEADER_ARROW 1 501 | #define LV_USE_CALENDAR_HEADER_DROPDOWN 1 502 | #endif /*LV_USE_CALENDAR*/ 503 | 504 | #define LV_USE_CHART 1 505 | 506 | #define LV_USE_COLORWHEEL 1 507 | 508 | #define LV_USE_IMGBTN 1 509 | 510 | #define LV_USE_KEYBOARD 1 511 | 512 | #define LV_USE_LED 1 513 | 514 | #define LV_USE_LIST 1 515 | 516 | #define LV_USE_MENU 1 517 | 518 | #define LV_USE_METER 1 519 | 520 | #define LV_USE_MSGBOX 1 521 | 522 | #define LV_USE_SPINBOX 1 523 | 524 | #define LV_USE_SPINNER 1 525 | 526 | #define LV_USE_TABVIEW 1 527 | 528 | #define LV_USE_TILEVIEW 1 529 | 530 | #define LV_USE_WIN 1 531 | 532 | #define LV_USE_SPAN 1 533 | #if LV_USE_SPAN 534 | /*A line text can contain maximum num of span descriptor */ 535 | #define LV_SPAN_SNIPPET_STACK_SIZE 64 536 | #endif 537 | 538 | /*----------- 539 | * Themes 540 | *----------*/ 541 | 542 | /*A simple, impressive and very complete theme*/ 543 | #define LV_USE_THEME_DEFAULT 1 544 | #if LV_USE_THEME_DEFAULT 545 | 546 | /*0: Light mode; 1: Dark mode*/ 547 | #define LV_THEME_DEFAULT_DARK 0 548 | 549 | /*1: Enable grow on press*/ 550 | #define LV_THEME_DEFAULT_GROW 1 551 | 552 | /*Default transition time in [ms]*/ 553 | #define LV_THEME_DEFAULT_TRANSITION_TIME 80 554 | #endif /*LV_USE_THEME_DEFAULT*/ 555 | 556 | /*A very simple theme that is a good starting point for a custom theme*/ 557 | #define LV_USE_THEME_BASIC 1 558 | 559 | /*A theme designed for monochrome displays*/ 560 | #define LV_USE_THEME_MONO 1 561 | 562 | /*----------- 563 | * Layouts 564 | *----------*/ 565 | 566 | /*A layout similar to Flexbox in CSS.*/ 567 | #define LV_USE_FLEX 1 568 | 569 | /*A layout similar to Grid in CSS.*/ 570 | #define LV_USE_GRID 1 571 | 572 | /*--------------------- 573 | * 3rd party libraries 574 | *--------------------*/ 575 | 576 | /*File system interfaces for common APIs */ 577 | 578 | /*API for fopen, fread, etc*/ 579 | #define LV_USE_FS_STDIO 1 580 | #if LV_USE_FS_STDIO 581 | #define LV_FS_STDIO_LETTER '/' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 582 | #define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ 583 | #define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ 584 | #endif 585 | 586 | /*API for open, read, etc*/ 587 | #define LV_USE_FS_POSIX 0 588 | #if LV_USE_FS_POSIX 589 | #define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 590 | #define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ 591 | #define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ 592 | #endif 593 | 594 | /*API for CreateFile, ReadFile, etc*/ 595 | #define LV_USE_FS_WIN32 0 596 | #if LV_USE_FS_WIN32 597 | #define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 598 | #define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/ 599 | #define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ 600 | #endif 601 | 602 | /*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/ 603 | #define LV_USE_FS_FATFS 0 604 | #if LV_USE_FS_FATFS 605 | #define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/ 606 | #define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/ 607 | #endif 608 | 609 | /*PNG decoder library*/ 610 | #define LV_USE_PNG 1 611 | 612 | /*BMP decoder library*/ 613 | #define LV_USE_BMP 1 614 | 615 | /* JPG + split JPG decoder library. 616 | * Split JPG is a custom format optimized for embedded systems. */ 617 | #define LV_USE_SJPG 1 618 | 619 | /*GIF decoder library*/ 620 | #define LV_USE_GIF 1 621 | 622 | /*QR code library*/ 623 | #define LV_USE_QRCODE 0 624 | 625 | /*FreeType library*/ 626 | #define LV_USE_FREETYPE 0 627 | #if LV_USE_FREETYPE 628 | /*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/ 629 | #define LV_FREETYPE_CACHE_SIZE (16 * 1024) 630 | #if LV_FREETYPE_CACHE_SIZE >= 0 631 | /* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */ 632 | /* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */ 633 | /* if font size >= 256, must be configured as image cache */ 634 | #define LV_FREETYPE_SBIT_CACHE 0 635 | /* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */ 636 | /* (0:use system defaults) */ 637 | #define LV_FREETYPE_CACHE_FT_FACES 0 638 | #define LV_FREETYPE_CACHE_FT_SIZES 0 639 | #endif 640 | #endif 641 | 642 | /*Rlottie library*/ 643 | #define LV_USE_RLOTTIE 0 644 | 645 | /*FFmpeg library for image decoding and playing videos 646 | *Supports all major image formats so do not enable other image decoder with it*/ 647 | #define LV_USE_FFMPEG 0 648 | #if LV_USE_FFMPEG 649 | /*Dump input information to stderr*/ 650 | #define LV_FFMPEG_AV_DUMP_FORMAT 0 651 | #endif 652 | 653 | /*----------- 654 | * Others 655 | *----------*/ 656 | 657 | /*1: Enable API to take snapshot for object*/ 658 | #define LV_USE_SNAPSHOT 0 659 | 660 | /*1: Enable Monkey test*/ 661 | #define LV_USE_MONKEY 0 662 | 663 | /*1: Enable grid navigation*/ 664 | #define LV_USE_GRIDNAV 0 665 | 666 | /*================== 667 | * EXAMPLES 668 | *==================*/ 669 | 670 | /*Enable the examples to be built with the library*/ 671 | #define LV_BUILD_EXAMPLES 0 672 | 673 | /*=================== 674 | * DEMO USAGE 675 | ====================*/ 676 | 677 | /*Show some widget. It might be required to increase `LV_MEM_SIZE` */ 678 | #define LV_USE_DEMO_WIDGETS 0 679 | #if LV_USE_DEMO_WIDGETS 680 | #define LV_DEMO_WIDGETS_SLIDESHOW 0 681 | #endif 682 | 683 | /*Demonstrate the usage of encoder and keyboard*/ 684 | #define LV_USE_DEMO_KEYPAD_AND_ENCODER 0 685 | 686 | /*Benchmark your system*/ 687 | #define LV_USE_DEMO_BENCHMARK 0 688 | 689 | /*Stress test for LVGL*/ 690 | #define LV_USE_DEMO_STRESS 0 691 | 692 | /*Music player demo*/ 693 | #define LV_USE_DEMO_MUSIC 0 694 | #if LV_USE_DEMO_MUSIC 695 | # define LV_DEMO_MUSIC_SQUARE 0 696 | # define LV_DEMO_MUSIC_LANDSCAPE 0 697 | # define LV_DEMO_MUSIC_ROUND 0 698 | # define LV_DEMO_MUSIC_LARGE 0 699 | # define LV_DEMO_MUSIC_AUTO_PLAY 0 700 | #endif 701 | 702 | /*--END OF LV_CONF_H--*/ 703 | 704 | #endif /*LV_CONF_H*/ 705 | 706 | #endif /*End of "Content enable"*/ 707 | -------------------------------------------------------------------------------- /lv_drv_conf.h: -------------------------------------------------------------------------------- 1 | /** 2 | * @file lv_drv_conf.h 3 | * Configuration file for v8.2.0 4 | */ 5 | 6 | /* 7 | * COPY THIS FILE AS lv_drv_conf.h 8 | */ 9 | 10 | /* clang-format off */ 11 | #if 1 /*Set it to "1" to enable the content*/ 12 | 13 | #ifndef LV_DRV_CONF_H 14 | #define LV_DRV_CONF_H 15 | 16 | #include "lv_conf.h" 17 | 18 | /********************* 19 | * DELAY INTERFACE 20 | *********************/ 21 | #define LV_DRV_DELAY_INCLUDE /*Dummy include by default*/ 22 | #define LV_DRV_DELAY_US(us) /*delay_us(us)*/ /*Delay the given number of microseconds*/ 23 | #define LV_DRV_DELAY_MS(ms) /*delay_ms(ms)*/ /*Delay the given number of milliseconds*/ 24 | 25 | /********************* 26 | * DISPLAY INTERFACE 27 | *********************/ 28 | 29 | /*------------ 30 | * Common 31 | *------------*/ 32 | #define LV_DRV_DISP_INCLUDE /*Dummy include by default*/ 33 | #define LV_DRV_DISP_CMD_DATA(val) /*pin_x_set(val)*/ /*Set the command/data pin to 'val'*/ 34 | #define LV_DRV_DISP_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/ 35 | 36 | /*--------- 37 | * SPI 38 | *---------*/ 39 | #define LV_DRV_DISP_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/ 40 | #define LV_DRV_DISP_SPI_WR_BYTE(data) /*spi_wr(data)*/ /*Write a byte the SPI bus*/ 41 | #define LV_DRV_DISP_SPI_WR_ARRAY(adr, n) /*spi_wr_mem(adr, n)*/ /*Write 'n' bytes to SPI bus from 'adr'*/ 42 | 43 | /*------------------ 44 | * Parallel port 45 | *-----------------*/ 46 | #define LV_DRV_DISP_PAR_CS(val) /*par_cs_set(val)*/ /*Set the Parallel port's Chip select to 'val'*/ 47 | #define LV_DRV_DISP_PAR_SLOW /*par_slow()*/ /*Set low speed on the parallel port*/ 48 | #define LV_DRV_DISP_PAR_FAST /*par_fast()*/ /*Set high speed on the parallel port*/ 49 | #define LV_DRV_DISP_PAR_WR_WORD(data) /*par_wr(data)*/ /*Write a word to the parallel port*/ 50 | #define LV_DRV_DISP_PAR_WR_ARRAY(adr, n) /*par_wr_mem(adr,n)*/ /*Write 'n' bytes to Parallel ports from 'adr'*/ 51 | 52 | /*************************** 53 | * INPUT DEVICE INTERFACE 54 | ***************************/ 55 | 56 | /*---------- 57 | * Common 58 | *----------*/ 59 | #define LV_DRV_INDEV_INCLUDE /*Dummy include by default*/ 60 | #define LV_DRV_INDEV_RST(val) /*pin_x_set(val)*/ /*Set the reset pin to 'val'*/ 61 | #define LV_DRV_INDEV_IRQ_READ 0 /*pn_x_read()*/ /*Read the IRQ pin*/ 62 | 63 | /*--------- 64 | * SPI 65 | *---------*/ 66 | #define LV_DRV_INDEV_SPI_CS(val) /*spi_cs_set(val)*/ /*Set the SPI's Chip select to 'val'*/ 67 | #define LV_DRV_INDEV_SPI_XCHG_BYTE(data) 0 /*spi_xchg(val)*/ /*Write 'val' to SPI and give the read value*/ 68 | 69 | /*--------- 70 | * I2C 71 | *---------*/ 72 | #define LV_DRV_INDEV_I2C_START /*i2c_start()*/ /*Make an I2C start*/ 73 | #define LV_DRV_INDEV_I2C_STOP /*i2c_stop()*/ /*Make an I2C stop*/ 74 | #define LV_DRV_INDEV_I2C_RESTART /*i2c_restart()*/ /*Make an I2C restart*/ 75 | #define LV_DRV_INDEV_I2C_WR(data) /*i2c_wr(data)*/ /*Write a byte to the I1C bus*/ 76 | #define LV_DRV_INDEV_I2C_READ(last_read) 0 /*i2c_rd()*/ /*Read a byte from the I2C bud*/ 77 | 78 | 79 | /********************* 80 | * DISPLAY DRIVERS 81 | *********************/ 82 | 83 | /*------------------- 84 | * SDL 85 | *-------------------*/ 86 | 87 | /* SDL based drivers for display, mouse, mousewheel and keyboard*/ 88 | #ifndef USE_SDL 89 | # define USE_SDL 0 90 | #endif 91 | 92 | /* Hardware accelerated SDL driver */ 93 | #ifndef USE_SDL_GPU 94 | # define USE_SDL_GPU 0 95 | #endif 96 | 97 | #if USE_SDL || USE_SDL_GPU 98 | # define SDL_HOR_RES 480 99 | # define SDL_VER_RES 320 100 | 101 | /* Scale window by this factor (useful when simulating small screens) */ 102 | # define SDL_ZOOM 1 103 | 104 | /* Used to test true double buffering with only address changing. 105 | * Use 2 draw buffers, bith with SDL_HOR_RES x SDL_VER_RES size*/ 106 | # define SDL_DOUBLE_BUFFERED 0 107 | 108 | /*Eclipse: Visual Studio: */ 109 | # define SDL_INCLUDE_PATH 110 | 111 | /*Open two windows to test multi display support*/ 112 | # define SDL_DUAL_DISPLAY 0 113 | #endif 114 | 115 | /*------------------- 116 | * Monitor of PC 117 | *-------------------*/ 118 | 119 | /*DEPRECATED: Use the SDL driver instead. */ 120 | #ifndef USE_MONITOR 121 | # define USE_MONITOR 0 122 | #endif 123 | 124 | #if USE_MONITOR 125 | # define MONITOR_HOR_RES 480 126 | # define MONITOR_VER_RES 320 127 | 128 | /* Scale window by this factor (useful when simulating small screens) */ 129 | # define MONITOR_ZOOM 1 130 | 131 | /* Used to test true double buffering with only address changing. 132 | * Use 2 draw buffers, bith with MONITOR_HOR_RES x MONITOR_VER_RES size*/ 133 | # define MONITOR_DOUBLE_BUFFERED 0 134 | 135 | /*Eclipse: Visual Studio: */ 136 | # define MONITOR_SDL_INCLUDE_PATH 137 | 138 | /*Open two windows to test multi display support*/ 139 | # define MONITOR_DUAL 0 140 | #endif 141 | 142 | /*----------------------------------- 143 | * Native Windows (including mouse) 144 | *----------------------------------*/ 145 | #ifndef USE_WINDOWS 146 | # define USE_WINDOWS 0 147 | #endif 148 | 149 | #if USE_WINDOWS 150 | # define WINDOW_HOR_RES 480 151 | # define WINDOW_VER_RES 320 152 | #endif 153 | 154 | /*---------------------------- 155 | * Native Windows (win32drv) 156 | *---------------------------*/ 157 | #ifndef USE_WIN32DRV 158 | # define USE_WIN32DRV 0 159 | #endif 160 | 161 | #if USE_WIN32DRV 162 | /* Scale window by this factor (useful when simulating small screens) */ 163 | # define WIN32DRV_MONITOR_ZOOM 1 164 | #endif 165 | 166 | /*---------------------------------------- 167 | * GTK drivers (monitor, mouse, keyboard 168 | *---------------------------------------*/ 169 | #ifndef USE_GTK 170 | # define USE_GTK 0 171 | #endif 172 | 173 | /*---------------------------------------- 174 | * Wayland drivers (monitor, mouse, keyboard, touchscreen) 175 | *---------------------------------------*/ 176 | #ifndef USE_WAYLAND 177 | # define USE_WAYLAND 0 178 | #endif 179 | 180 | #if USE_WAYLAND 181 | /* Support for client-side decorations */ 182 | # ifndef LV_WAYLAND_CLIENT_SIDE_DECORATIONS 183 | # define LV_WAYLAND_CLIENT_SIDE_DECORATIONS 1 184 | # endif 185 | /* Support for (deprecated) wl-shell protocol */ 186 | # ifndef LV_WAYLAND_WL_SHELL 187 | # define LV_WAYLAND_WL_SHELL 1 188 | # endif 189 | /* Support for xdg-shell protocol */ 190 | # ifndef LV_WAYLAND_XDG_SHELL 191 | # define LV_WAYLAND_XDG_SHELL 0 192 | # endif 193 | #endif 194 | 195 | /*---------------- 196 | * SSD1963 197 | *--------------*/ 198 | #ifndef USE_SSD1963 199 | # define USE_SSD1963 0 200 | #endif 201 | 202 | #if USE_SSD1963 203 | # define SSD1963_HOR_RES LV_HOR_RES 204 | # define SSD1963_VER_RES LV_VER_RES 205 | # define SSD1963_HT 531 206 | # define SSD1963_HPS 43 207 | # define SSD1963_LPS 8 208 | # define SSD1963_HPW 10 209 | # define SSD1963_VT 288 210 | # define SSD1963_VPS 12 211 | # define SSD1963_FPS 4 212 | # define SSD1963_VPW 10 213 | # define SSD1963_HS_NEG 0 /*Negative hsync*/ 214 | # define SSD1963_VS_NEG 0 /*Negative vsync*/ 215 | # define SSD1963_ORI 0 /*0, 90, 180, 270*/ 216 | # define SSD1963_COLOR_DEPTH 16 217 | #endif 218 | 219 | /*---------------- 220 | * R61581 221 | *--------------*/ 222 | #ifndef USE_R61581 223 | # define USE_R61581 0 224 | #endif 225 | 226 | #if USE_R61581 227 | # define R61581_HOR_RES LV_HOR_RES 228 | # define R61581_VER_RES LV_VER_RES 229 | # define R61581_HSPL 0 /*HSYNC signal polarity*/ 230 | # define R61581_HSL 10 /*HSYNC length (Not Implemented)*/ 231 | # define R61581_HFP 10 /*Horitontal Front poarch (Not Implemented)*/ 232 | # define R61581_HBP 10 /*Horitontal Back poarch (Not Implemented */ 233 | # define R61581_VSPL 0 /*VSYNC signal polarity*/ 234 | # define R61581_VSL 10 /*VSYNC length (Not Implemented)*/ 235 | # define R61581_VFP 8 /*Vertical Front poarch*/ 236 | # define R61581_VBP 8 /*Vertical Back poarch */ 237 | # define R61581_DPL 0 /*DCLK signal polarity*/ 238 | # define R61581_EPL 1 /*ENABLE signal polarity*/ 239 | # define R61581_ORI 0 /*0, 180*/ 240 | # define R61581_LV_COLOR_DEPTH 16 /*Fix 16 bit*/ 241 | #endif 242 | 243 | /*------------------------------ 244 | * ST7565 (Monochrome, low res.) 245 | *-----------------------------*/ 246 | #ifndef USE_ST7565 247 | # define USE_ST7565 0 248 | #endif 249 | 250 | #if USE_ST7565 251 | /*No settings*/ 252 | #endif /*USE_ST7565*/ 253 | 254 | /*------------------------------ 255 | * GC9A01 (color, low res.) 256 | *-----------------------------*/ 257 | #ifndef USE_GC9A01 258 | # define USE_GC9A01 0 259 | #endif 260 | 261 | #if USE_GC9A01 262 | /*No settings*/ 263 | #endif /*USE_GC9A01*/ 264 | 265 | /*------------------------------------------ 266 | * UC1610 (4 gray 160*[104|128]) 267 | * (EA DOGXL160 160x104 tested) 268 | *-----------------------------------------*/ 269 | #ifndef USE_UC1610 270 | # define USE_UC1610 0 271 | #endif 272 | 273 | #if USE_UC1610 274 | # define UC1610_HOR_RES LV_HOR_RES 275 | # define UC1610_VER_RES LV_VER_RES 276 | # define UC1610_INIT_CONTRAST 33 /* init contrast, values in [%] */ 277 | # define UC1610_INIT_HARD_RST 0 /* 1 : hardware reset at init, 0 : software reset */ 278 | # define UC1610_TOP_VIEW 0 /* 0 : Bottom View, 1 : Top View */ 279 | #endif /*USE_UC1610*/ 280 | 281 | /*------------------------------------------------- 282 | * SHARP memory in pixel monochrome display series 283 | * LS012B7DD01 (184x38 pixels.) 284 | * LS013B7DH03 (128x128 pixels.) 285 | * LS013B7DH05 (144x168 pixels.) 286 | * LS027B7DH01 (400x240 pixels.) (tested) 287 | * LS032B7DD02 (336x536 pixels.) 288 | * LS044Q7DH01 (320x240 pixels.) 289 | *------------------------------------------------*/ 290 | #ifndef USE_SHARP_MIP 291 | # define USE_SHARP_MIP 0 292 | #endif 293 | 294 | #if USE_SHARP_MIP 295 | # define SHARP_MIP_HOR_RES LV_HOR_RES 296 | # define SHARP_MIP_VER_RES LV_VER_RES 297 | # define SHARP_MIP_SOFT_COM_INVERSION 0 298 | # define SHARP_MIP_REV_BYTE(b) /*((uint8_t) __REV(__RBIT(b)))*/ /*Architecture / compiler dependent byte bits order reverse*/ 299 | #endif /*USE_SHARP_MIP*/ 300 | 301 | /*------------------------------------------------- 302 | * ILI9341 240X320 TFT LCD 303 | *------------------------------------------------*/ 304 | #ifndef USE_ILI9341 305 | # define USE_ILI9341 0 306 | #endif 307 | 308 | #if USE_ILI9341 309 | # define ILI9341_HOR_RES LV_HOR_RES 310 | # define ILI9341_VER_RES LV_VER_RES 311 | # define ILI9341_GAMMA 1 312 | # define ILI9341_TEARING 0 313 | #endif /*USE_ILI9341*/ 314 | 315 | /*----------------------------------------- 316 | * Linux frame buffer device (/dev/fbx) 317 | *-----------------------------------------*/ 318 | #ifndef USE_FBDEV 319 | # define USE_FBDEV 1 320 | #endif 321 | 322 | #if USE_FBDEV 323 | # define FBDEV_PATH "/dev/fb0" 324 | #endif 325 | 326 | /*----------------------------------------- 327 | * FreeBSD frame buffer device (/dev/fbx) 328 | *.........................................*/ 329 | #ifndef USE_BSD_FBDEV 330 | # define USE_BSD_FBDEV 0 331 | #endif 332 | 333 | #if USE_BSD_FBDEV 334 | # define FBDEV_PATH "/dev/fb0" 335 | #endif 336 | 337 | /*----------------------------------------- 338 | * DRM/KMS device (/dev/dri/cardX) 339 | *-----------------------------------------*/ 340 | #ifndef USE_DRM 341 | # define USE_DRM 0 342 | #endif 343 | 344 | #if USE_DRM 345 | # define DRM_CARD "/dev/dri/card0" 346 | # define DRM_CONNECTOR_ID -1 /* -1 for the first connected one */ 347 | #endif 348 | 349 | /********************* 350 | * INPUT DEVICES 351 | *********************/ 352 | 353 | /*-------------- 354 | * XPT2046 355 | *--------------*/ 356 | #ifndef USE_XPT2046 357 | # define USE_XPT2046 0 358 | #endif 359 | 360 | #if USE_XPT2046 361 | # define XPT2046_HOR_RES 480 362 | # define XPT2046_VER_RES 320 363 | # define XPT2046_X_MIN 200 364 | # define XPT2046_Y_MIN 200 365 | # define XPT2046_X_MAX 3800 366 | # define XPT2046_Y_MAX 3800 367 | # define XPT2046_AVG 4 368 | # define XPT2046_X_INV 0 369 | # define XPT2046_Y_INV 0 370 | # define XPT2046_XY_SWAP 0 371 | #endif 372 | 373 | /*----------------- 374 | * FT5406EE8 375 | *-----------------*/ 376 | #ifndef USE_FT5406EE8 377 | # define USE_FT5406EE8 0 378 | #endif 379 | 380 | #if USE_FT5406EE8 381 | # define FT5406EE8_I2C_ADR 0x38 /*7 bit address*/ 382 | #endif 383 | 384 | /*--------------- 385 | * AD TOUCH 386 | *--------------*/ 387 | #ifndef USE_AD_TOUCH 388 | # define USE_AD_TOUCH 0 389 | #endif 390 | 391 | #if USE_AD_TOUCH 392 | /*No settings*/ 393 | #endif 394 | 395 | 396 | /*--------------------------------------- 397 | * Mouse or touchpad on PC (using SDL) 398 | *-------------------------------------*/ 399 | /*DEPRECATED: Use the SDL driver instead. */ 400 | #ifndef USE_MOUSE 401 | # define USE_MOUSE 0 402 | #endif 403 | 404 | #if USE_MOUSE 405 | /*No settings*/ 406 | #endif 407 | 408 | /*------------------------------------------- 409 | * Mousewheel as encoder on PC (using SDL) 410 | *------------------------------------------*/ 411 | /*DEPRECATED: Use the SDL driver instead. */ 412 | #ifndef USE_MOUSEWHEEL 413 | # define USE_MOUSEWHEEL 0 414 | #endif 415 | 416 | #if USE_MOUSEWHEEL 417 | /*No settings*/ 418 | #endif 419 | 420 | /*------------------------------------------------- 421 | * Touchscreen, mouse/touchpad or keyboard as libinput interface (for Linux based systems) 422 | *------------------------------------------------*/ 423 | #ifndef USE_LIBINPUT 424 | # define USE_LIBINPUT 0 425 | #endif 426 | 427 | #ifndef USE_BSD_LIBINPUT 428 | # define USE_BSD_LIBINPUT 0 429 | #endif 430 | 431 | #if USE_LIBINPUT || USE_BSD_LIBINPUT 432 | /*If only a single device of the same type is connected, you can also auto detect it, e.g.: 433 | *#define LIBINPUT_NAME libinput_find_dev(LIBINPUT_CAPABILITY_TOUCH, false)*/ 434 | # define LIBINPUT_NAME "/dev/input/event0" /*You can use the "evtest" Linux tool to get the list of devices and test them*/ 435 | 436 | #endif /*USE_LIBINPUT || USE_BSD_LIBINPUT*/ 437 | 438 | /*------------------------------------------------- 439 | * Mouse or touchpad as evdev interface (for Linux based systems) 440 | *------------------------------------------------*/ 441 | #ifndef USE_EVDEV 442 | # define USE_EVDEV 1 443 | #endif 444 | 445 | #ifndef USE_BSD_EVDEV 446 | # define USE_BSD_EVDEV 0 447 | #endif 448 | 449 | #if USE_EVDEV || USE_BSD_EVDEV 450 | # define EVDEV_NAME "/dev/input/event1" /*You can use the "evtest" Linux tool to get the list of devices and test them*/ 451 | # define EVDEV_SWAP_AXES 0 /*Swap the x and y axes of the touchscreen*/ 452 | 453 | # define EVDEV_CALIBRATE 0 /*Scale and offset the touchscreen coordinates by using maximum and minimum values for each axis*/ 454 | 455 | # if EVDEV_CALIBRATE 456 | # define EVDEV_HOR_MIN 0 /*to invert axis swap EVDEV_XXX_MIN by EVDEV_XXX_MAX*/ 457 | # define EVDEV_HOR_MAX 4096 /*"evtest" Linux tool can help to get the correct calibraion values>*/ 458 | # define EVDEV_VER_MIN 0 459 | # define EVDEV_VER_MAX 4096 460 | # endif /*EVDEV_CALIBRATE*/ 461 | #endif /*USE_EVDEV*/ 462 | 463 | /*------------------------------------------------- 464 | * Full keyboard support for evdev and libinput interface 465 | *------------------------------------------------*/ 466 | # ifndef USE_XKB 467 | # define USE_XKB 0 468 | # endif 469 | 470 | #if USE_LIBINPUT || USE_BSD_LIBINPUT || USE_EVDEV || USE_BSD_EVDEV 471 | # if USE_XKB 472 | # define XKB_KEY_MAP { .rules = NULL, \ 473 | .model = "pc101", \ 474 | .layout = "us", \ 475 | .variant = NULL, \ 476 | .options = NULL } /*"setxkbmap -query" can help find the right values for your keyboard*/ 477 | # endif /*USE_XKB*/ 478 | #endif /*USE_LIBINPUT || USE_BSD_LIBINPUT || USE_EVDEV || USE_BSD_EVDEV*/ 479 | 480 | /*------------------------------- 481 | * Keyboard of a PC (using SDL) 482 | *------------------------------*/ 483 | /*DEPRECATED: Use the SDL driver instead. */ 484 | #ifndef USE_KEYBOARD 485 | # define USE_KEYBOARD 0 486 | #endif 487 | 488 | #if USE_KEYBOARD 489 | /*No settings*/ 490 | #endif 491 | 492 | #endif /*LV_DRV_CONF_H*/ 493 | 494 | #endif /*End of "Content enable"*/ 495 | -------------------------------------------------------------------------------- /main.c: -------------------------------------------------------------------------------- 1 | #include "lvgl/lvgl.h" 2 | #include "lv_drivers/display/fbdev.h" 3 | #include "lv_drivers/indev/evdev.h" 4 | 5 | #include 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | 12 | #define DISP_BUF_SIZE (1024 * 600) 13 | 14 | int main(int argc, char **argv) 15 | { 16 | int iError; 17 | 18 | if (argc != 2) 19 | { 20 | printf("Usage:\n"); 21 | printf("%s \n", argv[0]); 22 | return -1; 23 | } 24 | 25 | iError = camera_100ask_dev_init(argv[1]); 26 | if(iError) return; 27 | 28 | /*LittlevGL init*/ 29 | lv_init(); 30 | 31 | /*Linux frame buffer device init*/ 32 | fbdev_init(); 33 | 34 | /*A small buffer for LittlevGL to draw the screen's content*/ 35 | static lv_color_t buf[DISP_BUF_SIZE]; 36 | 37 | /*Initialize a descriptor for the buffer*/ 38 | static lv_disp_draw_buf_t disp_buf; 39 | lv_disp_draw_buf_init(&disp_buf, buf, NULL, DISP_BUF_SIZE); 40 | 41 | /*Initialize and register a display driver*/ 42 | static lv_disp_drv_t disp_drv; 43 | lv_disp_drv_init(&disp_drv); 44 | disp_drv.draw_buf = &disp_buf; 45 | disp_drv.flush_cb = fbdev_flush; 46 | disp_drv.hor_res = 1024; 47 | disp_drv.ver_res = 600; 48 | lv_disp_drv_register(&disp_drv); 49 | 50 | evdev_init(); 51 | static lv_indev_drv_t indev_drv_1; 52 | lv_indev_drv_init(&indev_drv_1); /*Basic initialization*/ 53 | indev_drv_1.type = LV_INDEV_TYPE_POINTER; 54 | 55 | /*This function will be called periodically (by the library) to get the mouse position and state*/ 56 | indev_drv_1.read_cb = evdev_read; 57 | lv_indev_t *mouse_indev = lv_indev_drv_register(&indev_drv_1); 58 | 59 | /*Set a cursor for the mouse*/ 60 | LV_IMG_DECLARE(mouse_cursor_icon) 61 | lv_obj_t * cursor_obj = lv_img_create(lv_scr_act()); /*Create an image object for the cursor */ 62 | lv_img_set_src(cursor_obj, &mouse_cursor_icon); /*Set the image source*/ 63 | lv_indev_set_cursor(mouse_indev, cursor_obj); /*Connect the image object to the driver*/ 64 | 65 | /*Create a Demo*/ 66 | camera_100ask_ui_init(); 67 | 68 | 69 | /*Handle LitlevGL tasks (tickless mode)*/ 70 | while(1) { 71 | lv_timer_handler(); 72 | usleep(5000); 73 | } 74 | 75 | return 0; 76 | } 77 | 78 | /*Set in lv_conf.h as `LV_TICK_CUSTOM_SYS_TIME_EXPR`*/ 79 | uint32_t custom_tick_get(void) 80 | { 81 | static uint64_t start_ms = 0; 82 | if(start_ms == 0) { 83 | struct timeval tv_start; 84 | gettimeofday(&tv_start, NULL); 85 | start_ms = (tv_start.tv_sec * 1000000 + tv_start.tv_usec) / 1000; 86 | } 87 | 88 | struct timeval tv_now; 89 | gettimeofday(&tv_now, NULL); 90 | uint64_t now_ms; 91 | now_ms = (tv_now.tv_sec * 1000000 + tv_now.tv_usec) / 1000; 92 | 93 | uint32_t time_ms = now_ms - start_ms; 94 | return time_ms; 95 | } 96 | -------------------------------------------------------------------------------- /mouse_cursor_icon.c: -------------------------------------------------------------------------------- 1 | #include "lvgl/lvgl.h" 2 | 3 | const uint8_t mouse_cursor_icon_map[] = { 4 | #if LV_COLOR_DEPTH == 1 || LV_COLOR_DEPTH == 8 5 | /*Pixel format: Alpha 8 bit, Red: 3 bit, Green: 3 bit, Blue: 2 bit*/ 6 | 0x24, 0xb8, 0x24, 0xc8, 0x00, 0x13, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 7 | 0x49, 0xcc, 0xdb, 0xff, 0x49, 0xcc, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 8 | 0x49, 0xc8, 0xff, 0xff, 0xff, 0xff, 0x49, 0xe0, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 9 | 0x49, 0xcb, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x6d, 0xf3, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 10 | 0x49, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x92, 0xff, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 11 | 0x49, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x92, 0xff, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0xb6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 12 | 0x49, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb7, 0xff, 0x24, 0xab, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 13 | 0x49, 0xcb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x24, 0xbb, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 14 | 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x49, 0xd8, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 15 | 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6d, 0xef, 0x00, 0x4f, 0x00, 0x00, 16 | 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x92, 0xff, 0x00, 0x6b, 17 | 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x92, 0xf7, 0x92, 0xf8, 0x6e, 0xfb, 0x92, 0xf8, 0x6d, 0xff, 0x00, 0xb3, 18 | 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x24, 0xb7, 0x00, 0x1b, 0x00, 0x14, 0x00, 0x13, 0x00, 0x0c, 0x25, 0x07, 19 | 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6e, 0xf0, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 20 | 0x49, 0xcc, 0xff, 0xff, 0xff, 0xff, 0x49, 0xd8, 0x00, 0x78, 0x92, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xff, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 21 | 0x6d, 0xd3, 0xff, 0xff, 0x6d, 0xef, 0x00, 0x34, 0x00, 0x00, 0x49, 0xc7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x6d, 0xdc, 0x00, 0x14, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 22 | 0x49, 0xe0, 0x6d, 0xff, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x92, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb7, 0xff, 0x00, 0x78, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 23 | 0x00, 0x68, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x49, 0xd0, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0x6d, 0xd8, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 24 | 0x00, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xb7, 0xff, 0xff, 0xff, 0x92, 0xff, 0x49, 0xac, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 25 | 0x00, 0x03, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x25, 0xd7, 0x49, 0xc7, 0x00, 0x47, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 26 | #endif 27 | #if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP == 0 28 | /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit*/ 29 | 0xc3, 0x18, 0xb8, 0xe4, 0x20, 0xc8, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 30 | 0x49, 0x4a, 0xcc, 0x96, 0xb5, 0xff, 0xc7, 0x39, 0xcc, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 31 | 0xe7, 0x39, 0xc8, 0xbf, 0xff, 0xff, 0xfb, 0xde, 0xff, 0x28, 0x42, 0xe0, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x41, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 32 | 0xe7, 0x39, 0xcb, 0x3d, 0xef, 0xff, 0xff, 0xff, 0xfc, 0x3d, 0xef, 0xff, 0xcb, 0x5a, 0xf3, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 33 | 0xe7, 0x39, 0xcb, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0xff, 0x8e, 0x73, 0xff, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 34 | 0xe8, 0x41, 0xcb, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x51, 0x8c, 0xff, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xd3, 0x9c, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 35 | 0xe8, 0x41, 0xcb, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x14, 0xa5, 0xff, 0xa2, 0x10, 0xab, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 36 | 0x08, 0x42, 0xcb, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd7, 0xbd, 0xff, 0x04, 0x21, 0xbb, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 37 | 0x08, 0x42, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x59, 0xce, 0xff, 0xe8, 0x41, 0xd8, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 38 | 0x08, 0x42, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xe6, 0xff, 0xab, 0x5a, 0xef, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 39 | 0x08, 0x42, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xf7, 0xff, 0xaf, 0x7b, 0xff, 0x00, 0x00, 0x6b, 40 | 0x28, 0x42, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x7a, 0xd6, 0xff, 0x10, 0x84, 0xf7, 0xae, 0x73, 0xf8, 0x6e, 0x73, 0xfb, 0x8e, 0x73, 0xf8, 0xcb, 0x5a, 0xff, 0x61, 0x08, 0xb3, 41 | 0x28, 0x42, 0xcc, 0x7d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x59, 0xce, 0xff, 0xa2, 0x10, 0xb7, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x14, 0x00, 0x00, 0x13, 0x00, 0x00, 0x0c, 0x45, 0x29, 0x07, 42 | 0x29, 0x4a, 0xcc, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xdb, 0xde, 0xff, 0xec, 0x62, 0xff, 0x1c, 0xe7, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x0c, 0x63, 0xf0, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 43 | 0x29, 0x4a, 0xcc, 0xdf, 0xff, 0xff, 0x7d, 0xef, 0xff, 0x49, 0x4a, 0xd8, 0x00, 0x00, 0x78, 0x51, 0x8c, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x38, 0xc6, 0xff, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 44 | 0xcb, 0x5a, 0xd3, 0xdb, 0xde, 0xff, 0xec, 0x62, 0xef, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0xe7, 0x39, 0xc7, 0x5d, 0xef, 0xff, 0xff, 0xff, 0xff, 0xbe, 0xf7, 0xff, 0xaa, 0x52, 0xdc, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 45 | 0xe8, 0x41, 0xe0, 0xaa, 0x52, 0xff, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x72, 0x94, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x96, 0xb5, 0xff, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x61, 0x08, 0x04, 0x00, 0x00, 0x00, 46 | 0x00, 0x00, 0x68, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x69, 0x4a, 0xd0, 0x7d, 0xef, 0xff, 0xff, 0xff, 0xfc, 0xbe, 0xf7, 0xff, 0xaa, 0x52, 0xd8, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 47 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe4, 0x20, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0x75, 0xad, 0xff, 0xbf, 0xff, 0xff, 0x10, 0x84, 0xff, 0x86, 0x31, 0xac, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 48 | 0x41, 0x08, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x66, 0x31, 0xd7, 0xc7, 0x39, 0xc7, 0x00, 0x00, 0x47, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 49 | #endif 50 | #if LV_COLOR_DEPTH == 16 && LV_COLOR_16_SWAP != 0 51 | /*Pixel format: Alpha 8 bit, Red: 5 bit, Green: 6 bit, Blue: 5 bit BUT the 2 color bytes are swapped*/ 52 | 0x18, 0xc3, 0xb8, 0x20, 0xe4, 0xc8, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 53 | 0x4a, 0x49, 0xcc, 0xb5, 0x96, 0xff, 0x39, 0xc7, 0xcc, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 54 | 0x39, 0xe7, 0xc8, 0xff, 0xbf, 0xff, 0xde, 0xfb, 0xff, 0x42, 0x28, 0xe0, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 55 | 0x39, 0xe7, 0xcb, 0xef, 0x3d, 0xff, 0xff, 0xff, 0xfc, 0xef, 0x3d, 0xff, 0x5a, 0xcb, 0xf3, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 56 | 0x39, 0xe7, 0xcb, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbf, 0xff, 0x73, 0x8e, 0xff, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 57 | 0x41, 0xe8, 0xcb, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8c, 0x51, 0xff, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9c, 0xd3, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 58 | 0x41, 0xe8, 0xcb, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa5, 0x14, 0xff, 0x10, 0xa2, 0xab, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 59 | 0x42, 0x08, 0xcb, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xbd, 0xd7, 0xff, 0x21, 0x04, 0xbb, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 60 | 0x42, 0x08, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0x59, 0xff, 0x41, 0xe8, 0xd8, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 61 | 0x42, 0x08, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe6, 0xfc, 0xff, 0x5a, 0xab, 0xef, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 62 | 0x42, 0x08, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xbe, 0xff, 0x7b, 0xaf, 0xff, 0x00, 0x00, 0x6b, 63 | 0x42, 0x28, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd6, 0x7a, 0xff, 0x84, 0x10, 0xf7, 0x73, 0xae, 0xf8, 0x73, 0x6e, 0xfb, 0x73, 0x8e, 0xf8, 0x5a, 0xcb, 0xff, 0x08, 0x61, 0xb3, 64 | 0x42, 0x28, 0xcc, 0xef, 0x7d, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0x59, 0xff, 0x10, 0xa2, 0xb7, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x14, 0x00, 0x00, 0x13, 0x00, 0x00, 0x0c, 0x29, 0x45, 0x07, 65 | 0x4a, 0x29, 0xcc, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xde, 0xdb, 0xff, 0x62, 0xec, 0xff, 0xe7, 0x1c, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x63, 0x0c, 0xf0, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 66 | 0x4a, 0x29, 0xcc, 0xff, 0xdf, 0xff, 0xef, 0x7d, 0xff, 0x4a, 0x49, 0xd8, 0x00, 0x00, 0x78, 0x8c, 0x51, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc6, 0x38, 0xff, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 67 | 0x5a, 0xcb, 0xd3, 0xde, 0xdb, 0xff, 0x62, 0xec, 0xef, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x39, 0xe7, 0xc7, 0xef, 0x5d, 0xff, 0xff, 0xff, 0xff, 0xf7, 0xbe, 0xff, 0x52, 0xaa, 0xdc, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 68 | 0x41, 0xe8, 0xe0, 0x52, 0xaa, 0xff, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x94, 0x72, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb5, 0x96, 0xff, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x08, 0x61, 0x04, 0x00, 0x00, 0x00, 69 | 0x00, 0x00, 0x68, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x4a, 0x69, 0xd0, 0xef, 0x7d, 0xff, 0xff, 0xff, 0xfc, 0xf7, 0xbe, 0xff, 0x52, 0xaa, 0xd8, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 70 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0xe4, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xad, 0x75, 0xff, 0xff, 0xbf, 0xff, 0x84, 0x10, 0xff, 0x31, 0x86, 0xac, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 71 | 0x08, 0x41, 0x03, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x31, 0x66, 0xd7, 0x39, 0xc7, 0xc7, 0x00, 0x00, 0x47, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 72 | #endif 73 | #if LV_COLOR_DEPTH == 32 74 | 0x19, 0x19, 0x19, 0xb8, 0x1e, 0x1e, 0x1e, 0xc8, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 75 | 0x48, 0x48, 0x48, 0xcc, 0xb2, 0xb2, 0xb2, 0xff, 0x3a, 0x3a, 0x3a, 0xcc, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 76 | 0x3b, 0x3b, 0x3b, 0xc8, 0xf6, 0xf6, 0xf6, 0xff, 0xdc, 0xdc, 0xdc, 0xff, 0x43, 0x43, 0x43, 0xe0, 0x00, 0x00, 0x00, 0x3b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x0a, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 77 | 0x3b, 0x3b, 0x3b, 0xcb, 0xe6, 0xe6, 0xe6, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xe5, 0xe5, 0xe5, 0xff, 0x59, 0x59, 0x59, 0xf3, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 78 | 0x3c, 0x3c, 0x3c, 0xcb, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf5, 0xf5, 0xf5, 0xff, 0x72, 0x72, 0x72, 0xff, 0x00, 0x00, 0x00, 0x73, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 79 | 0x3d, 0x3d, 0x3d, 0xcb, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x8a, 0x8a, 0x8a, 0xff, 0x00, 0x00, 0x00, 0x90, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x99, 0x99, 0x99, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 80 | 0x3e, 0x3e, 0x3e, 0xcb, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xa2, 0xa2, 0xa2, 0xff, 0x13, 0x13, 0x13, 0xab, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 81 | 0x3f, 0x3f, 0x3f, 0xcb, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb7, 0xb7, 0xb7, 0xff, 0x1f, 0x1f, 0x1f, 0xbb, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 82 | 0x41, 0x41, 0x41, 0xcc, 0xea, 0xea, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xca, 0xca, 0xca, 0xff, 0x3d, 0x3d, 0x3d, 0xd8, 0x00, 0x00, 0x00, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 83 | 0x41, 0x41, 0x41, 0xcc, 0xea, 0xea, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xde, 0xde, 0xde, 0xff, 0x56, 0x56, 0x56, 0xef, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 84 | 0x42, 0x42, 0x42, 0xcc, 0xea, 0xea, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf3, 0xf3, 0xf3, 0xff, 0x76, 0x76, 0x76, 0xff, 0x00, 0x00, 0x00, 0x6b, 85 | 0x43, 0x43, 0x43, 0xcc, 0xea, 0xea, 0xea, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xce, 0xce, 0xce, 0xff, 0x80, 0x80, 0x80, 0xf7, 0x74, 0x74, 0x74, 0xf8, 0x6d, 0x6d, 0x6d, 0xfb, 0x72, 0x72, 0x72, 0xf8, 0x57, 0x57, 0x57, 0xff, 0x0c, 0x0c, 0x0c, 0xb3, 86 | 0x44, 0x44, 0x44, 0xcc, 0xeb, 0xeb, 0xeb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xfb, 0xfb, 0xfb, 0xff, 0xfe, 0xfe, 0xfe, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc9, 0xc9, 0xc9, 0xff, 0x13, 0x13, 0x13, 0xb7, 0x00, 0x00, 0x00, 0x1b, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x0c, 0x29, 0x29, 0x29, 0x07, 87 | 0x45, 0x45, 0x45, 0xcc, 0xe8, 0xe8, 0xe8, 0xff, 0xff, 0xff, 0xff, 0xff, 0xd9, 0xd9, 0xd9, 0xff, 0x5e, 0x5e, 0x5e, 0xff, 0xe2, 0xe2, 0xe2, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0x62, 0x62, 0x62, 0xf0, 0x00, 0x00, 0x00, 0x13, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 88 | 0x45, 0x45, 0x45, 0xcc, 0xf9, 0xf9, 0xf9, 0xff, 0xec, 0xec, 0xec, 0xff, 0x4a, 0x4a, 0x4a, 0xd8, 0x00, 0x00, 0x00, 0x78, 0x8a, 0x8a, 0x8a, 0xfb, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xc3, 0xc3, 0xc3, 0xff, 0x00, 0x00, 0x00, 0x8b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 89 | 0x58, 0x58, 0x58, 0xd3, 0xd9, 0xd9, 0xd9, 0xff, 0x5e, 0x5e, 0x5e, 0xef, 0x00, 0x00, 0x00, 0x34, 0x00, 0x00, 0x00, 0x00, 0x3b, 0x3b, 0x3b, 0xc7, 0xe9, 0xe9, 0xe9, 0xff, 0xff, 0xff, 0xff, 0xff, 0xf4, 0xf4, 0xf4, 0xff, 0x54, 0x54, 0x54, 0xdc, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 90 | 0x3e, 0x3e, 0x3e, 0xe0, 0x54, 0x54, 0x54, 0xff, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x8e, 0x8e, 0x8e, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xb0, 0xb0, 0xb0, 0xff, 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x00, 0x00, 0x0c, 0x0c, 0x0c, 0x04, 0x00, 0x00, 0x00, 0x00, 91 | 0x00, 0x00, 0x00, 0x68, 0x00, 0x00, 0x00, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x4c, 0x4c, 0x4c, 0xd0, 0xec, 0xec, 0xec, 0xff, 0xff, 0xff, 0xff, 0xfc, 0xf4, 0xf4, 0xf4, 0xff, 0x53, 0x53, 0x53, 0xd8, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 92 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1e, 0x1e, 0x1e, 0x00, 0x04, 0x04, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x6f, 0xab, 0xab, 0xab, 0xff, 0xf6, 0xf6, 0xf6, 0xff, 0x80, 0x80, 0x80, 0xff, 0x31, 0x31, 0x31, 0xac, 0x00, 0x00, 0x00, 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 93 | 0x09, 0x09, 0x09, 0x03, 0x02, 0x02, 0x02, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x2e, 0x2e, 0x2e, 0xd7, 0x38, 0x38, 0x38, 0xc7, 0x00, 0x00, 0x00, 0x47, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 94 | #endif 95 | }; 96 | 97 | lv_img_dsc_t mouse_cursor_icon = { 98 | .header.always_zero = 0, 99 | .header.w = 14, 100 | .header.h = 20, 101 | .data_size = 280 * LV_IMG_PX_SIZE_ALPHA_BYTE, 102 | .header.cf = LV_IMG_CF_TRUE_COLOR_ALPHA, 103 | .data = mouse_cursor_icon_map, 104 | }; 105 | --------------------------------------------------------------------------------