Skip to content

Commit

Permalink
Run lint
Browse files Browse the repository at this point in the history
  • Loading branch information
mcm001 committed Dec 24, 2023
1 parent 5ac9f68 commit 8040993
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 25 deletions.
32 changes: 25 additions & 7 deletions photon-core/src/dev/native/cpp/devmain.cpp
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

#include <cstdio>

#include <opencv2/core.hpp>
#include <opencv2/core/mat.hpp>
#include <opencv2/imgcodecs.hpp>

#include <stdio.h>
#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;
}
return 1;
}
32 changes: 25 additions & 7 deletions photon-core/src/main/native/cpp/test.cpp
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

#include "test.h"

#include <cstdio>

#include <opencv2/core.hpp>
#include <opencv2/core/mat.hpp>
#include <opencv2/imgcodecs.hpp>

#include <stdio.h>

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;
}
return 1;
}
17 changes: 17 additions & 0 deletions photon-core/src/main/native/include/test.h
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

#pragma once
int some_test();
24 changes: 19 additions & 5 deletions photon-core/src/main/native/jni/TestJni.cpp
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

#include <jni.h>

extern "C" {
JNIEXPORT jint JNICALL
some_native_function() {
return 0;
}
}
JNIEXPORT jint JNICALL some_native_function(void) { return 0; }
} // extern "C"
26 changes: 22 additions & 4 deletions photon-core/src/test/native/cpp/devmain.cpp
Original file line number Diff line number Diff line change
@@ -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 <https://www.gnu.org/licenses/>.
*/

#include <cstdio>

#include "test.h"
#include <stdio.h>

int main(int argc, char** argv) {
printf("hello!\n");
return some_test();
}
std::printf("hello!\n");
return some_test();
}
4 changes: 3 additions & 1 deletion photon-lib/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ ext {
]

main_native_libs = [
"wpilib_shared", "apriltag_shared", "opencv_shared"
"wpilib_shared",
"apriltag_shared",
"opencv_shared"
]

dev_native_libs = []
Expand Down
4 changes: 3 additions & 1 deletion photon-targeting/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 8040993

Please sign in to comment.