diff --git a/.clang-format b/.clang-format
new file mode 100644
index 0000000000000000000000000000000000000000..a7d1ab4520d43799960c01833035dcd71ceda16e
--- /dev/null
+++ b/.clang-format
@@ -0,0 +1,70 @@
+BasedOnStyle: WebKit
+IndentWidth: 4
+ColumnLimit: 100
+
+Language: Cpp
+Standard: c++20
+DerivePointerAlignment: false
+
+PointerAlignment: Left
+ReferenceAlignment: Right
+
+SortIncludes: CaseSensitive
+
+AccessModifierOffset: -4
+
+AlignAfterOpenBracket: true
+AlignArrayOfStructures: Left
+AlignConsecutiveAssignments: None
+AlignConsecutiveBitFields: None
+AlignConsecutiveDeclarations: None
+AlignConsecutiveMacros: None
+AlignEscapedNewlines: Left
+AlignOperands: AlignAfterOperator
+AlignTrailingComments: true
+
+BreakBeforeBinaryOperators: NonAssignment
+BreakBeforeBraces: Attach
+BreakBeforeConceptDeclarations: true
+BreakBeforeTernaryOperators: false
+BreakConstructorInitializers: AfterColon
+BreakInheritanceList: AfterColon
+BreakStringLiterals: true
+
+AllowAllArgumentsOnNextLine: false
+AllowAllParametersOfDeclarationOnNextLine: false
+AllowShortBlocksOnASingleLine: Empty
+AllowShortCaseLabelsOnASingleLine: false
+AllowShortEnumsOnASingleLine: false
+AllowShortFunctionsOnASingleLine: Empty
+AllowShortIfStatementsOnASingleLine: false
+AllowShortLambdasOnASingleLine: Empty
+AllowShortLoopsOnASingleLine: false
+
+AlwaysBreakTemplateDeclarations: Yes
+EmptyLineBeforeAccessModifier: Always
+
+BinPackParameters: true
+ReflowComments: true
+
+ShortNamespaceLines: 0
+NamespaceIndentation: All
+FixNamespaceComments: true
+
+SpaceBeforeRangeBasedForLoopColon: true
+SpaceBeforeSquareBrackets: true
+SpaceInEmptyBlock: false
+SpaceInEmptyParentheses: false
+SpacesBeforeTrailingComments: 1
+SpacesInAngles: Leave
+SpacesInConditionalStatement: false
+SpacesInContainerLiterals: true
+SpacesInLineCommentPrefix:
+  Minimum: 1
+  Maximum: -1
+SpacesInParentheses: false
+
+TabWidth: 4
+UseTab: Never
+
+UseCRLF: false
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 2f70c78f105d3a080a3c482de91000dc23ec0e1d..9166150fad7419a039cafcfe7aa28e7e1e66ff91 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -4,6 +4,7 @@ project(vkcv)
 # cmake options
 option(BUILD_MODULES "Enables building VkCV as shared libraries" ON)
 option(BUILD_PROJECTS "Enables building the VkCV projects" ON)
+option(BUILD_CLANG_FORMAT "Enables formatting the source code" ON)
 option(BUILD_DOXYGEN_DOCS "Enables building the VkCV doxygen documentation" OFF)
 option(BUILD_SHARED "Enables building VkCV as shared libraries" OFF)
 option(BUILD_VMA_VULKAN_VERSION "Enforce a specific Vulkan version for VMA" OFF)
@@ -15,6 +16,7 @@ endif()
 message(STATUS "Options:")
 message(" - BUILD_MODULES: ${BUILD_MODULES}")
 message(" - BUILD_PROJECTS: ${BUILD_PROJECTS}")
+message(" - BUILD_CLANG_FORMAT: ${BUILD_CLANG_FORMAT}")
 message(" - BUILD_DOXYGEN_DOCS: ${BUILD_DOXYGEN_DOCS}")
 message(" - BUILD_SHARED: ${BUILD_SHARED}")
 
diff --git a/config/Sources.cmake b/config/Sources.cmake
index 2efd34c3e0158082ee539413431278aeb41e1a1c..f0fd0ed758ee8b7f4d8ce0940babf0e1142e6b60 100644
--- a/config/Sources.cmake
+++ b/config/Sources.cmake
@@ -112,4 +112,17 @@ set(vkcv_sources
 		
 		${vkcv_include}/vkcv/BlitDownsampler.hpp
 		${vkcv_source}/vkcv/BlitDownsampler.cpp
+		
+		${vkcv_include}/vkcv/Sampler.hpp
+		
+		${vkcv_include}/vkcv/Result.hpp
 )
+
+if (BUILD_CLANG_FORMAT)
+	message(STATUS "Clang-Format: ON")
+	
+	# add clang-format as target if installed
+	include(${vkcv_config}/ext/ClangFormat.cmake)
+else()
+	message(STATUS "Clang-Format: OFF")
+endif()
diff --git a/config/ext/ClangFormat.cmake b/config/ext/ClangFormat.cmake
new file mode 100644
index 0000000000000000000000000000000000000000..723fd7a9f52d19d2d1c3b0279eee243fa11afe91
--- /dev/null
+++ b/config/ext/ClangFormat.cmake
@@ -0,0 +1,11 @@
+
+if (EXISTS "/usr/bin/clang-format")
+	# note the option ALL which allows to format the source together with the application
+	add_custom_target( clang_format ALL
+			COMMAND /usr/bin/clang-format -style=file --sort-includes -i ${vkcv_sources}
+			WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
+			COMMENT "Formatting code with Clang-Format"
+			VERBATIM )
+else ()
+	message(WARNING "Doxygen need to be installed to generate the doxygen documentation")
+endif ()