diff --git a/photon-core/src/dev/native/cpp/devmain.cpp b/photon-core/src/dev/native/cpp/devmain.cpp index 69f8136930..5b4065a1d7 100644 --- a/photon-core/src/dev/native/cpp/devmain.cpp +++ b/photon-core/src/dev/native/cpp/devmain.cpp @@ -1,16 +1,34 @@ -#include "test.h" +/* + * Copyright (C) Photon Vision. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include #include #include #include -#include +#include "test.h" int main() { - - cv::Mat mat = cv::imread("/home/matt/Documents/GitHub/photonvision/test-resources/testimages/2022/WPI/FarLaunchpad13ft10in.png"); + cv::Mat mat = cv::imread( + "/home/matt/Documents/GitHub/photonvision/test-resources/testimages/2022/" + "WPI/FarLaunchpad13ft10in.png"); - printf("DevMain! mat size %i %i\n", mat.rows, mat.cols); + std::printf("DevMain! mat size %i %i\n", mat.rows, mat.cols); - return 1; -} \ No newline at end of file + return 1; +} diff --git a/photon-core/src/main/native/cpp/test.cpp b/photon-core/src/main/native/cpp/test.cpp index 203a2f8f8e..e42ed323cc 100644 --- a/photon-core/src/main/native/cpp/test.cpp +++ b/photon-core/src/main/native/cpp/test.cpp @@ -1,16 +1,34 @@ +/* + * Copyright (C) Photon Vision. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include "test.h" +#include + #include #include #include -#include - int some_test() { - - cv::Mat mat = cv::imread("/home/matt/Documents/GitHub/photonvision/test-resources/testimages/2022/WPI/FarLaunchpad13ft10in.png"); + cv::Mat mat = cv::imread( + "/home/matt/Documents/GitHub/photonvision/test-resources/testimages/2022/" + "WPI/FarLaunchpad13ft10in.png"); - printf("mat size %i %i\n", mat.rows, mat.cols); + std::printf("mat size %i %i\n", mat.rows, mat.cols); - return 1; -} \ No newline at end of file + return 1; +} diff --git a/photon-core/src/main/native/include/test.h b/photon-core/src/main/native/include/test.h index 4e3098346f..ae673c990a 100644 --- a/photon-core/src/main/native/include/test.h +++ b/photon-core/src/main/native/include/test.h @@ -1,2 +1,19 @@ +/* + * Copyright (C) Photon Vision. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #pragma once int some_test(); diff --git a/photon-core/src/main/native/jni/TestJni.cpp b/photon-core/src/main/native/jni/TestJni.cpp index 6e8f36bd5a..38da552c57 100644 --- a/photon-core/src/main/native/jni/TestJni.cpp +++ b/photon-core/src/main/native/jni/TestJni.cpp @@ -1,8 +1,22 @@ +/* + * Copyright (C) Photon Vision. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + #include extern "C" { - JNIEXPORT jint JNICALL - some_native_function() { - return 0; - } -} \ No newline at end of file +JNIEXPORT jint JNICALL some_native_function(void) { return 0; } +} // extern "C" diff --git a/photon-core/src/test/native/cpp/devmain.cpp b/photon-core/src/test/native/cpp/devmain.cpp index b003512ea7..8384921a68 100644 --- a/photon-core/src/test/native/cpp/devmain.cpp +++ b/photon-core/src/test/native/cpp/devmain.cpp @@ -1,7 +1,25 @@ +/* + * Copyright (C) Photon Vision. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#include + #include "test.h" -#include int main(int argc, char** argv) { - printf("hello!\n"); - return some_test(); -} \ No newline at end of file + std::printf("hello!\n"); + return some_test(); +} diff --git a/photon-lib/build.gradle b/photon-lib/build.gradle index 6b6cec8dec..02b468d11b 100644 --- a/photon-lib/build.gradle +++ b/photon-lib/build.gradle @@ -22,7 +22,9 @@ ext { ] main_native_libs = [ - "wpilib_shared", "apriltag_shared", "opencv_shared" + "wpilib_shared", + "apriltag_shared", + "opencv_shared" ] dev_native_libs = [] diff --git a/photon-targeting/build.gradle b/photon-targeting/build.gradle index 5e8af89ee4..0d14b6737f 100644 --- a/photon-targeting/build.gradle +++ b/photon-targeting/build.gradle @@ -6,7 +6,9 @@ ext { nativeName = "photontargeting" main_native_libs = [ - "wpilib_shared", "apriltag_shared", "opencv_shared" + "wpilib_shared", + "apriltag_shared", + "opencv_shared" ] test_native_libs = [