Skip to content

Commit e23b98f

Browse files
committed
Hand fix cscore
1 parent 785356c commit e23b98f

20 files changed

Lines changed: 327 additions & 290 deletions

subprojects/robotpy-cscore/pyproject.toml

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -108,10 +108,25 @@ CameraServer = "wpi/cameraserver/CameraServer.hpp"
108108

109109
# cscore
110110
cscore_cpp = "wpi/cs/cscore_cpp.hpp"
111-
cscore_oo = "wpi/cs/cscore_oo.hpp"
112-
cscore_cv = "wpi/cs/cscore_cv.hpp"
113111
cscore_runloop = "wpi/cs/cscore_runloop.hpp"
114112

113+
CvSink = "wpi/cs/CvSink.hpp"
114+
CvSource = "wpi/cs/CvSource.hpp"
115+
HttpCamera = "wpi/cs/HttpCamera.hpp"
116+
ImageSink = "wpi/cs/ImageSink.hpp"
117+
ImageSource = "wpi/cs/ImageSource.hpp"
118+
MjpegServer = "wpi/cs/MjpegServer.hpp"
119+
RawEvent = "wpi/cs/RawEvent.hpp"
120+
UsbCamera = "wpi/cs/UsbCamera.hpp"
121+
UsbCameraInfo = "wpi/cs/UsbCameraInfo.hpp"
122+
VideoCamera = "wpi/cs/VideoCamera.hpp"
123+
VideoEvent = "wpi/cs/VideoEvent.hpp"
124+
VideoListener = "wpi/cs/VideoListener.hpp"
125+
VideoMode = "wpi/cs/VideoMode.hpp"
126+
VideoProperty = "wpi/cs/VideoProperty.hpp"
127+
VideoSink = "wpi/cs/VideoSink.hpp"
128+
VideoSource = "wpi/cs/VideoSource.hpp"
129+
115130
[tool.semiwrap.export_type_casters.cscore-casters]
116131
pypackage = "cscore"
117132
includedir = ["cscore"]

subprojects/robotpy-cscore/semiwrap/CameraServer.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ classes:
2424
overloads:
2525
"":
2626
const cs::VideoSource&:
27+
const cs::VideoSource&, wpi::util::PixelFormat:
2728
std::string_view:
29+
std::string_view, wpi::util::PixelFormat:
2830
PutVideo:
2931
AddServer:
3032
overloads:

subprojects/robotpy-cscore/semiwrap/cscore_cv.yml renamed to subprojects/robotpy-cscore/semiwrap/CvSink.yml

Lines changed: 4 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,5 @@
11

2-
extra_includes:
3-
- opencv2/core/core.hpp
4-
- cvnp/cvnp.h
5-
6-
functions:
7-
CS_PutSourceFrame:
8-
ignore: true
9-
CS_GrabSinkFrame:
10-
ignore: true
11-
CS_GrabSinkFrameTimeout:
12-
ignore: true
13-
CS_GrabSinkFrameCpp:
14-
ignore: true
15-
CS_GrabSinkFrameTimeoutCpp:
16-
ignore: true
17-
CS_PutSourceFrameCpp:
18-
ignore: true
19-
PutSourceFrame:
20-
ignore: true
21-
GrabSinkFrame:
22-
ignore: true
23-
GrabSinkFrameTimeout:
24-
ignore: true
252
classes:
26-
wpi::cs::CvSource:
27-
doc: A source for user code to provide OpenCV images as video frames.
28-
force_no_trampoline: true
29-
methods:
30-
CvSource:
31-
overloads:
32-
"":
33-
ignore: true
34-
std::string_view, const VideoMode&:
35-
std::string_view, VideoMode::PixelFormat, int, int, int:
36-
PutFrame:
373
wpi::cs::CvSink:
384
doc: A sink for user code to accept video frames as OpenCV images.
395
force_no_trampoline: true
@@ -45,13 +11,17 @@ classes:
4511
std::string_view:
4612
std::string_view, std::function<void (uint64_t time)>:
4713
ignore: true
14+
std::string_view, wpi::util::PixelFormat:
4815
GrabFrame:
4916
cpp_code: |
5017
[](wpi::cs::CvSink &self, cv::Mat& image, double timeout) -> std::tuple<uint64_t, cv::Mat> {
5118
py::gil_scoped_release unlock;
5219
auto result = self.GrabFrame(image, timeout);
5320
return std::make_tuple(result, image);
5421
}
22+
GrabFrameDirect:
23+
GrabFrameDirectLastTime:
24+
GrabFrameNoTimeoutDirect:
5525
GrabFrameNoTimeout:
5626
cpp_code: |
5727
[](wpi::cs::CvSink &self, cv::Mat& image) -> std::tuple<uint64_t, cv::Mat> {
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
classes:
2+
wpi::cs::CvSource:
3+
doc: A source for user code to provide OpenCV images as video frames.
4+
force_no_trampoline: true
5+
methods:
6+
CvSource:
7+
overloads:
8+
"":
9+
ignore: true
10+
std::string_view, const VideoMode&:
11+
std::string_view, VideoMode::PixelFormat, int, int, int:
12+
std::string_view, wpi::util::PixelFormat, int, int, int:
13+
PutFrame:
14+
overloads:
15+
cv::Mat&:
16+
cv::Mat&, wpi::util::PixelFormat, bool:
17+
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
classes:
2+
wpi::cs::HttpCamera:
3+
force_no_trampoline: true
4+
constants:
5+
- wpi::cs::HttpCamera::HttpCameraKind::kUnknown
6+
enums:
7+
HttpCameraKind:
8+
methods:
9+
HttpCamera:
10+
overloads:
11+
std::string_view, std::string_view, HttpCameraKind:
12+
std::string_view, const char*, HttpCameraKind:
13+
std::string_view, const std::string&, HttpCameraKind:
14+
std::string_view, std::span<const std::string>, HttpCameraKind:
15+
std::string_view, std::initializer_list<T>, HttpCameraKind:
16+
ignore: true
17+
GetHttpCameraKind:
18+
SetUrls:
19+
overloads:
20+
std::span<const std::string>:
21+
std::initializer_list<T>:
22+
ignore: true
23+
GetUrls:
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
2+
classes:
3+
wpi::cs::ImageSink:
4+
force_no_trampoline: true
5+
methods:
6+
SetDescription:
7+
GetError:
8+
SetEnabled:
9+
ImageSink:
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
classes:
2+
3+
wpi::cs::ImageSource:
4+
force_no_trampoline: true
5+
methods:
6+
NotifyError:
7+
SetConnected:
8+
SetDescription:
9+
CreateProperty:
10+
CreateIntegerProperty:
11+
CreateBooleanProperty:
12+
CreateStringProperty:
13+
SetEnumPropertyChoices:
14+
overloads:
15+
const VideoProperty&, std::span<const std::string>:
16+
const VideoProperty&, std::initializer_list<T>:
17+
ignore: true
18+
ImageSource:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
2+
classes:
3+
wpi::cs::MjpegServer:
4+
force_no_trampoline: true
5+
methods:
6+
MjpegServer:
7+
overloads:
8+
"":
9+
std::string_view, std::string_view, int:
10+
std::string_view, int:
11+
GetListenAddress:
12+
GetPort:
13+
SetResolution:
14+
SetFPS:
15+
SetCompression:
16+
SetDefaultCompression:
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
classes:
2+
wpi::cs::RawEvent:
3+
attributes:
4+
kind:
5+
ignore: true
6+
sourceHandle:
7+
ignore: true
8+
sinkHandle:
9+
ignore: true
10+
name:
11+
ignore: true
12+
mode:
13+
ignore: true
14+
propertyHandle:
15+
ignore: true
16+
propertyKind:
17+
ignore: true
18+
value:
19+
ignore: true
20+
valueStr:
21+
ignore: true
22+
listener:
23+
ignore: true
24+
enums:
25+
Kind:
26+
ignore: true
27+
methods:
28+
RawEvent:
29+
overloads:
30+
"":
31+
ignore: true
32+
RawEvent::Kind:
33+
ignore: true
34+
std::string_view, CS_Handle, RawEvent::Kind:
35+
ignore: true
36+
std::string_view, CS_Source, const VideoMode&:
37+
ignore: true
38+
std::string_view, CS_Source, RawEvent::Kind, CS_Property, CS_PropertyKind, int, std::string_view:
39+
ignore: true
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
classes:
2+
wpi::cs::UsbCamera:
3+
force_no_trampoline: true
4+
methods:
5+
UsbCamera:
6+
overloads:
7+
"":
8+
std::string_view, int:
9+
std::string_view, std::string_view:
10+
EnumerateUsbCameras:
11+
SetPath:
12+
GetPath:
13+
GetInfo:
14+
SetConnectVerbose:

0 commit comments

Comments
 (0)