This repository has been archived by the owner on Aug 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 621
Python c api update #1552
Open
JonathanESantos
wants to merge
315
commits into
microsoft:develop
Choose a base branch
from
JonathanESantos:python_c_api_update
base: develop
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Python c api update #1552
Changes from all commits
Commits
Show all changes
315 commits
Select commit
Hold shift + click to select a range
e2e4059
Python k4a api: Adding __repr__() functions to structs in order to pr…
JonathanESantos f42a5c4
Python k4a api: Adding a check that the required dlls are in the _lib…
JonathanESantos 5070cf7
Python k4a api: Adding the rest of the bindings for the functions tha…
JonathanESantos f65758a
Python k4a: Adding tests to call the functions in the dll.
JonathanESantos c9f4bef
Python k4a: Adding missing enum in color resolution, and adding tests…
JonathanESantos bce53d8
Python k4a: Changing @unittest.skip to @unittest.expectedfail for tho…
JonathanESantos f83b712
Python k4a: Updating docs. Removing platform tag in building the k4a …
JonathanESantos 3f6bd9d
Python API: Renaming enums and structs to Python naming convention.
JonathanESantos 715bbe6
Python API: Moving all internal files and symbols into the _bindings/…
JonathanESantos 3975dea
Python API: Moving handle structs from _k4a.py back to _k4atypes.py s…
JonathanESantos 3035f3a
Renaming modules inside _bindings subpackage to not include underscor…
JonathanESantos 33ec27a
Python api: Adding Device class which corresponds to a device with a …
JonathanESantos 6b57ecb
Python API: Adding capture and image classes to encapsulate capture a…
JonathanESantos 2e89eee
Python API: Bug in Image class was missing a height_pixels in one lin…
JonathanESantos e939095
Python API: Adding Calibration and Transformation wrapper classes.
JonathanESantos e02b436
Python API: Renaming a test file.
JonathanESantos 33dda28
Python API: Adding more tests to test the Device, Capture, Image, and…
JonathanESantos 15bc738
Python API: Fixing transformation functions and their tests.
JonathanESantos e966425
Python API: Adding example code that makes use of the Python API.
JonathanESantos 43c6123
Python API: Adding docstrings *.py files and a Doxygen settings file …
JonathanESantos c17ebbf
Python API: Adding a main page to the documentation, and fixing a bug…
JonathanESantos 053709b
Python API: Adding lines in build_wheel.ps1 to generate the documenta…
JonathanESantos b294cde
Making minor changes to get this k4a package to work in both Windows …
JonathanESantos 1ac1abe
Forgot to commit the minor changes to get this k4a package to work in…
JonathanESantos aabef2e
Python API: Specifying specific library names that the python code wi…
JonathanESantos d1b46ce
Python API: Modifying the build_wheel.csh script to look for libdepth…
JonathanESantos ebd650e
Python API: Updating building.md for clarity.
JonathanESantos 3d66cba
Python API: Fixing bug in tests that causes failure in some of the te…
JonathanESantos a5f6512
Fix broken Linux build.
JonathanESantos b4df263
k4a: ninja clangformat made these formatting changes.
JonathanESantos 065f5c0
k4a.c: Undo a broken "fix" which prevents validating any fps mode set.
JonathanESantos 940caef
Re-inserting the check if fps is less than the minimum allowed.
JonathanESantos 1b34c44
Doxygen comments for C/C++ refactor
AntonClaytonBursch ac68044
Disable FPS dropdown in viewer while playing.
AntonClaytonBursch d3c2ded
Merge pull request #6 from AntonClaytonBursch/user/jonsanto/Task5501_…
AntonClaytonBursch 09116ab
Commit ac680444 was overriden by a PR merge, so, this fixes that.
AntonClaytonBursch 4554b8a
ninja clangformat changes only, needed to build without errors.
JonathanESantos aa14110
Doxygen comments for C/C++ refactor
AntonClaytonBursch 073be8a
Disable FPS dropdown in viewer while playing.
AntonClaytonBursch 356b834
Fix broken Linux build.
JonathanESantos 93d5eed
k4a: ninja clangformat made these formatting changes.
JonathanESantos 3ecdabb
k4a.c: Undo a broken "fix" which prevents validating any fps mode set.
JonathanESantos bc550a4
Re-inserting the check if fps is less than the minimum allowed.
JonathanESantos 465a68e
Commit ac680444 was overriden by a PR merge, so, this fixes that.
AntonClaytonBursch e9b83d5
ninja clangformat changes only, needed to build without errors.
JonathanESantos ef27ec4
Python API: Adding UNSUPPORTED values to enums EStatus, EBufferStatus…
JonathanESantos ea71d39
Python API: Removing EFramePerSecond enum.
JonathanESantos 94b9220
Python API: Removing EDepthMode enum.
JonathanESantos 101fed9
Python API: Renaming depth_mode to depth_mode_id for consistency with…
JonathanESantos 6a15d37
Python API: Removing EColorResolution enum.
JonathanESantos 7eca2ba
Python API: Renaming color_resolution to color_mode_id for consistenc…
JonathanESantos e0012bd
Removing pre-defined DeviceConfiguration static instances. They shoul…
JonathanESantos f879302
Adding new API functions to the ctypes layer.
JonathanESantos 6b6c183
Python API: Adding the new functions to the higher-level Python API.
JonathanESantos a26aa25
Refactored C# wrapper and examples.
AntonClaytonBursch 9cb0c4e
meaningful mode usage in example
AntonClaytonBursch 60e0475
SDK C API: Removing doxygen output files. These files should not be c…
JonathanESantos 97117a0
SDK C API: Fixing docstrings for added C functions and structs.
JonathanESantos 1ee1ea3
SDK C API: ninja clangformat changes only.
JonathanESantos 0cba901
SDK C API: Fixing comments and reverting from int to enum in color_ft…
JonathanESantos d14e4fb
SDK C API: Moving header file from transformation.h to transformation…
JonathanESantos 15afadd
SDK C API: Adding K4A_CAPABILITY_MICROPHONE as a device capability.
JonathanESantos fe3ac1d
record/sdk/record.cpp: Removing unnecessary cast in line 53.
JonathanESantos 1f5939a
revert c++ changes (should be done in this branch)
AntonClaytonBursch 9e7f737
Fixing C# to C communication.
AntonClaytonBursch 4e0d9da
SDK C/C++ API: The following changes are made:
JonathanESantos de5dca1
new C# classes and native methods are commented properly
AntonClaytonBursch f1588a3
Commented the C# examples to describe how to use the new modes.
AntonClaytonBursch 6389930
C internal: Changing k4a_fps_t enum values from 0, 1, 2, 3 to 0, 5, 1…
JonathanESantos e08dba1
SDK C API: Refactoring k4a.c and k4ainternal/modes.h so that the mode…
JonathanESantos 9aeef03
SDK internal implementation: Replacing magic numbers with their enums…
JonathanESantos 8d2ac66
SDK C API: Fixing bug in the k4a_get_color_mode(), k4a_get_depth_mode…
JonathanESantos 113c22c
SDK C API: Changing type of min_range and max_range in k4a_depth_mode…
JonathanESantos 1b412dc
SDK internal: Replacing magic numbers with their enum equivalents.
JonathanESantos 59dde4d
matroska_read.cpp: Replacing valuedouble with valueint for values tha…
JonathanESantos aed550f
k4aviewer: Fixing an issue where introducing an invalid FPS enum disp…
JonathanESantos 4db14b2
k4arecorder: Fixing code that is using mode ID as parameter into k4a_…
JonathanESantos 8807788
k4aviewer: Reverting static variable to a class member variable.
JonathanESantos 20cc940
Functional Tests: Fixing functional tests that broke because of not s…
JonathanESantos 76446fd
k4ainternal/modes.h: Renaming _DEPTH16 to DEPTH16 to avoid C conventi…
JonathanESantos e2e7aa6
Merge pull request #8 from AntonClaytonBursch/api-update-codereviewfixes
AntonClaytonBursch 98d6c8e
changes to match up to c/c++ api revisions
AntonClaytonBursch 783f5d3
Merge branch 'api-update' into python_c_api_update
JonathanESantos 30fd24f
Python API: Accomodating changes in C API.
JonathanESantos 0e4e8cb
Python API: Modifying examples to accommodate the 0 FPS mode.
JonathanESantos 76eb58b
update c# sdk and examples for c/c++ api revisions
AntonClaytonBursch 591e068
Remove old enums
AntonClaytonBursch 84a0474
update C# tests
AntonClaytonBursch dd00133
quick fix to a TODO
AntonClaytonBursch b6728e8
cleaning up the examples
AntonClaytonBursch 611f9b1
cleaning up the examples
AntonClaytonBursch 7c87302
examples query for modes
AntonClaytonBursch 87bdef7
Python API: Adding some more unit tests. Removing non-constant device…
JonathanESantos d81ea68
Python API: Functional test has typo in class name.
JonathanESantos 128701c
added query for capabilities using get device info
AntonClaytonBursch aab55af
clangformat changes, and deleting a file that should not be checked in.
JonathanESantos 7781405
minor fixes to examples
AntonClaytonBursch 78ad873
Merge branch 'api-update' of https://github.com/AntonClaytonBursch/Az…
AntonClaytonBursch 865b885
more minor fixes to examples
AntonClaytonBursch 837a88f
quick clang format error in streaming example
AntonClaytonBursch 73fd5f3
Adding a conversion function to go from k4a_fps_t to fps.
JonathanESantos 86f26af
Reverting converting from k4a_fps_t to uint32_t back to a function ca…
JonathanESantos 85454c4
Fixing an issue with multidevice.cpp that could prevent an FPS value …
JonathanESantos 1c8b1fa
Simplifying parsing the --fps parameter and converting to k4a_fps_t e…
JonathanESantos e4e674a
Making the capabilities field of the k4a_device_info_t a union so tha…
JonathanESantos 9fbf341
Putting const qualifier in k4atypes.hpp for new Device class function…
JonathanESantos 00ba928
Moving definition of usb vendor id and product ids into its own heade…
JonathanESantos e36c235
Moving k4a static depth modes, color modes, and fps modes into its ow…
JonathanESantos 3c1dafe
Removing stale comments in k4a.c.
JonathanESantos 34774df
Merge pull request #10 from AntonClaytonBursch/user/jonsanto/Code_Rev…
AntonClaytonBursch dafa1c6
code revisions
AntonClaytonBursch dada33a
moved get device mode ids into seperate functions in the examples
AntonClaytonBursch 1b1e170
Fixing build errors in Linux that were introduced when k4a_device_inf…
JonathanESantos f621de3
get mode id from mode info structs in get mode ids functions in examples
AntonClaytonBursch e4dc595
Merge branch 'api-update' of https://github.com/AntonClaytonBursch/Az…
AntonClaytonBursch 561fde4
Fixing a misnamed variable in fastpointcloud/main.cpp.
JonathanESantos 8fb98b5
change for code revision
AntonClaytonBursch 4d28a5d
More code review changes.
AntonClaytonBursch 2e809dd
Adding docstrings to k4a_device_capabilities_t enum.
JonathanESantos 34e7f8f
Merge branch 'api-update' into python_c_api_update
JonathanESantos 42386f4
Updating Python API to accommodate k4a_device_info_t having bit fields.
JonathanESantos 22d75ff
make device mode infos classes properties private set and stub device…
AntonClaytonBursch eca753e
Merge branch 'api-update' of https://github.com/AntonClaytonBursch/Az…
AntonClaytonBursch 8448b40
fixed some minor bugs in c/c++ examples
AntonClaytonBursch 4db172a
another quick fix to c/c++ examples
AntonClaytonBursch 295cb8c
refactor documentation
AntonClaytonBursch e62aea0
changed rafactor.md to use only printf instead of cout and endl
AntonClaytonBursch b345150
quick change to refactor.md summary
AntonClaytonBursch 8e5182e
fixes to c# unit tests
AntonClaytonBursch 7164eb7
final fix of c# unit tests
AntonClaytonBursch 2e2c4b3
Fixed recording bugs. This is my final commit! So long and thank fo…
AntonClaytonBursch b3597b1
Merge branch 'api-update' into python_c_api_update
JonathanESantos 9ab914d
Adding a logging callback binding so that log messages generated with…
JonathanESantos e6eda93
Add K4A_RESULT_UNSUPPORTED to result enums.
AntonClaytonBursch 7e3b39f
Structs for device, color, depth. Enum for calibration. Functions to …
AntonClaytonBursch e478638
Updates examples, src, tests and tools to use new config and color an…
AntonClaytonBursch 6c62a6c
Added fps mode structs and functions.
AntonClaytonBursch 7dab373
Updated code to reflect change to using fps mode.
AntonClaytonBursch ee5e537
Moded color, depth and fps enums from k4a/k4atypes.h to k4ainternal/m…
AntonClaytonBursch 332ae5c
Updated c++ wrapper to use new color and depth modes.
AntonClaytonBursch 8d40c99
Updated C++ wrapper with get device, depth, color and fps functions. …
AntonClaytonBursch 322baf3
Update k4arecord/types.h and examples to use color, depth and fps mod…
AntonClaytonBursch 6865376
added depth range to k4a_depth_mode_info, updated get color/depth/fps…
AntonClaytonBursch a5393fe
Update k4astaticimageproperties.h to use k4a.hpp instead of k4a.h
AntonClaytonBursch fd07923
Quick fix: forgot to add K4A_EXPORT to get mode and mode count functi…
AntonClaytonBursch 192cfe6
examples, tests, tools refactored to use new get mode functions
AntonClaytonBursch 1594447
quick comments fix in calibration example and updates to color_ft tes…
AntonClaytonBursch 6f55b57
Changed get modes loops for fps, color and depth.
AntonClaytonBursch f0908d2
Viewer mode selection from radio to comboboxes
AntonClaytonBursch 5c9c33a
using mode info types instead of mode info type index
AntonClaytonBursch 6ce6d3c
refactor to use mode info instead of mode id
AntonClaytonBursch 0ab7e57
using depth/color/fps mode info instead of mode id
AntonClaytonBursch 3b8801e
mode id changes and GUI cleanup
AntonClaytonBursch 5c9d3c0
revert back from using device mode info to device mode id for fps/col…
AntonClaytonBursch 3d457de
Use constants defined in usb_cmd_priv.h to set the vendor id and devi…
AntonClaytonBursch c85e045
Used const for color/depth/fps mode info initializers.
AntonClaytonBursch 3460e84
Passing depth mode info down to point cloud viewer. Moved static k4a…
AntonClaytonBursch 041246b
color, depth and fps mode infos saved in and parsed from recordings
AntonClaytonBursch 65139c9
Initialize the size and version of the mode structs
AntonClaytonBursch 8584442
Moved K4A_MSFT_VID, K4A_RGB_PID and K4A_DEPTH_PID to usbcommand.h. A…
AntonClaytonBursch 5d2c356
error handling for saving modes and device info in recording
AntonClaytonBursch 05f0e14
color, depth, fps mode info and device info saved in and parse from r…
AntonClaytonBursch 82dd43e
Fixing K4A build errors in src/record/internal/matroska_read.cpp abou…
JonathanESantos c4ed4c4
SDK: docstring changes for Doxygen to run without errors.
JonathanESantos 8d3579e
linked k4a_math in viewer
AntonClaytonBursch 4d57968
Recording description from mode info saved in recording (or legacy de…
AntonClaytonBursch 29c8286
K4A API: Adding to docstrings that functions may return status of UNS…
JonathanESantos 080b1f9
k4aviewer: Removing audio support. To turn on audio support, in tools…
JonathanESantos 3fbab3c
k4aviewer: Removing support for audio and clangformat wants to format…
JonathanESantos e3e2266
Use modes for k4arecorder
AntonClaytonBursch 146b234
Recorder mode option listed.
AntonClaytonBursch a271255
working on recorder command line validation
AntonClaytonBursch 96b73b2
k4arecorder: Minor editing.
JonathanESantos e988971
k4a: Adding functional tests for calling the added functions in k4a.h.
JonathanESantos a4a099a
Removing commented-out code.
JonathanESantos d1c200d
k4a: Fixing a test in depth_ft.
JonathanESantos 08b85c8
Update main.cpp
JonathanESantos 2c9e861
Update main.cpp
JonathanESantos 77a0a40
Update main.cpp
JonathanESantos c2db238
Update main.cpp
JonathanESantos 9b8ae64
Update main.cpp
JonathanESantos b5fcf68
validate recorder cmd options
AntonClaytonBursch 0e4de17
finished validating recording cmd options
AntonClaytonBursch 5d325c5
Fixed get fps mode in recorder.
AntonClaytonBursch 9fde5be
Doxygen comments for C/C++ refactor
AntonClaytonBursch 07193f9
Disable FPS dropdown in viewer while playing.
AntonClaytonBursch e1c393f
Fix broken Linux build.
JonathanESantos 349e14f
k4a: ninja clangformat made these formatting changes.
JonathanESantos 39f8437
k4a.c: Undo a broken "fix" which prevents validating any fps mode set.
JonathanESantos 42ba8f3
Re-inserting the check if fps is less than the minimum allowed.
JonathanESantos 1f5d048
Commit ac680444 was overriden by a PR merge, so, this fixes that.
AntonClaytonBursch f46a100
Refactored C# wrapper and examples.
AntonClaytonBursch b42a27b
meaningful mode usage in example
AntonClaytonBursch 558744e
revert c++ changes (should be done in this branch)
AntonClaytonBursch 5e354ac
Fixing C# to C communication.
AntonClaytonBursch 8ea22e8
new C# classes and native methods are commented properly
AntonClaytonBursch afd1921
Commented the C# examples to describe how to use the new modes.
AntonClaytonBursch c704ad6
changes to match up to c/c++ api revisions
AntonClaytonBursch 13aa685
update c# sdk and examples for c/c++ api revisions
AntonClaytonBursch cdcd065
Remove old enums
AntonClaytonBursch d93b007
update C# tests
AntonClaytonBursch e443e74
quick fix to a TODO
AntonClaytonBursch 648d9a1
ninja clangformat changes only, needed to build without errors.
JonathanESantos 0807d04
SDK C API: Removing doxygen output files. These files should not be c…
JonathanESantos b4e4796
SDK C API: Fixing docstrings for added C functions and structs.
JonathanESantos cb939aa
SDK C API: ninja clangformat changes only.
JonathanESantos 8db6bab
SDK C API: Fixing comments and reverting from int to enum in color_ft…
JonathanESantos 7f7c487
SDK C API: Moving header file from transformation.h to transformation…
JonathanESantos 7a8d2c6
SDK C API: Adding K4A_CAPABILITY_MICROPHONE as a device capability.
JonathanESantos 58f7749
record/sdk/record.cpp: Removing unnecessary cast in line 53.
JonathanESantos 4852cf6
SDK C/C++ API: The following changes are made:
JonathanESantos 74146b2
C internal: Changing k4a_fps_t enum values from 0, 1, 2, 3 to 0, 5, 1…
JonathanESantos 92fefd4
SDK C API: Refactoring k4a.c and k4ainternal/modes.h so that the mode…
JonathanESantos b7da1a7
SDK internal implementation: Replacing magic numbers with their enums…
JonathanESantos c3c8de0
SDK C API: Fixing bug in the k4a_get_color_mode(), k4a_get_depth_mode…
JonathanESantos f98c3cf
SDK C API: Changing type of min_range and max_range in k4a_depth_mode…
JonathanESantos f16af72
SDK internal: Replacing magic numbers with their enum equivalents.
JonathanESantos a2443c3
matroska_read.cpp: Replacing valuedouble with valueint for values tha…
JonathanESantos c68fd41
k4aviewer: Fixing an issue where introducing an invalid FPS enum disp…
JonathanESantos b8e2cf6
k4arecorder: Fixing code that is using mode ID as parameter into k4a_…
JonathanESantos d33e786
k4aviewer: Reverting static variable to a class member variable.
JonathanESantos 8da0798
Functional Tests: Fixing functional tests that broke because of not s…
JonathanESantos cd78df2
k4ainternal/modes.h: Renaming _DEPTH16 to DEPTH16 to avoid C conventi…
JonathanESantos ef57ab9
cleaning up the examples
AntonClaytonBursch 313686c
examples query for modes
AntonClaytonBursch 638fbd0
added query for capabilities using get device info
AntonClaytonBursch 3a9d29a
minor fixes to examples
AntonClaytonBursch 708bd79
clangformat changes, and deleting a file that should not be checked in.
JonathanESantos 8ea7069
more minor fixes to examples
AntonClaytonBursch 5adee35
quick clang format error in streaming example
AntonClaytonBursch 938c1f6
Adding a conversion function to go from k4a_fps_t to fps.
JonathanESantos f4a7835
Reverting converting from k4a_fps_t to uint32_t back to a function ca…
JonathanESantos 13d103c
Fixing an issue with multidevice.cpp that could prevent an FPS value …
JonathanESantos 2c6c3c7
Simplifying parsing the --fps parameter and converting to k4a_fps_t e…
JonathanESantos b25dcc5
Making the capabilities field of the k4a_device_info_t a union so tha…
JonathanESantos 2bf8ab6
Putting const qualifier in k4atypes.hpp for new Device class function…
JonathanESantos 141901e
Moving definition of usb vendor id and product ids into its own heade…
JonathanESantos 0abb5f2
Moving k4a static depth modes, color modes, and fps modes into its ow…
JonathanESantos ee5596d
Removing stale comments in k4a.c.
JonathanESantos 2ed3382
code revisions
AntonClaytonBursch 516186b
moved get device mode ids into seperate functions in the examples
AntonClaytonBursch 776453d
get mode id from mode info structs in get mode ids functions in examples
AntonClaytonBursch d8f8161
Fixing build errors in Linux that were introduced when k4a_device_inf…
JonathanESantos acfda75
Fixing a misnamed variable in fastpointcloud/main.cpp.
JonathanESantos 74b9009
change for code revision
AntonClaytonBursch 8982502
More code review changes.
AntonClaytonBursch f88df9a
Adding docstrings to k4a_device_capabilities_t enum.
JonathanESantos 705f7a2
Manually resolved merge conflicts below.
JonathanESantos 3217f6c
For setting a logger callback in python, making the context a PyObjec…
JonathanESantos 1fb283b
Removing doxygen output files. They should not be tracked.
JonathanESantos File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -304,3 +304,4 @@ __pycache__/ | |
/.settings | ||
*.project | ||
*.cproject | ||
/doxygen/Doxyfile.in.modified |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,299 @@ | ||
# Changes to the Kinect SDK API surface | ||
|
||
The following changes have been made to the Kinect SDK API surface (k4a.h, k4atypes.h) so camera manufacturers may provide | ||
their own implementation of the Kinect SDK that will work with their cameras. The key change is switching from enums that identify | ||
color resolution, depth mode and framerate, to structs that contain information about color mode, depth mode and fps mode. All | ||
devices must support a depth sensor, but color, microphone and IMU sensors are not required. | ||
|
||
## Changes to k4atypes.h | ||
|
||
1. The following enums have been changed: | ||
|
||
k4a_result_t Added K4A_RESULT_UNSUPPORTED Returned when function requires unsupported sensor. | ||
k4a_buffer_result_t Added K4A_BUFFER_RESULT_UNSUPPORTED Returned when buffer function requires unsupported sensor. | ||
k4a_wait_result_t Added K4A_WAIT_RESULT_UNSUPPORTED Returned when wait function requires unsupported sensor. | ||
|
||
|
||
2. The following enums have been moved: | ||
|
||
k4a_color_resolution_t Moved to include/k4ainternal/modes.h Is no longer a part of the API surface. | ||
k4a_depth_mode_t Moved to include/k4ainternal/modes.h Is no longer a part of the API surface. | ||
k4a_fps_t Moved to include/k4ainternal/modes.h Is no longer a part of the API surface. | ||
|
||
|
||
3. The following enum has been added: | ||
|
||
k4a_device_capabilities_t Indicates which sensors(color, depth, IMU, microphone) are supported by a device. | ||
|
||
|
||
4. The following structs have been added: | ||
|
||
k4a_device_info_t Contains the size and version of the struct as well as vendor id, device id and | ||
capabilities(color, depth, IMU, microphone). | ||
|
||
k4a_color_mode_info_t Contains the size and version of the struct as well as mode id, width, height, native format, | ||
horizontal/vertical fov and min/max fps. | ||
|
||
k4a_depth_mode_info_t Contains the size and version of the struct as well as mode id, whether to capture passive IR only, | ||
width, height, native format, horizontal/vertical fov, min/max fps and min/max range. | ||
|
||
k4a_fps_mode_info_t Contains the size and version of the struct as well as mode id and fps. | ||
|
||
|
||
5. The following structs have been changed: | ||
|
||
k4a_calibration_t k4a_color_resolution_t color_resolution is now uint32_t color_mode_id. | ||
k4a_depth_mode_t depth_mode is now uint32_t depth_mode_id. | ||
|
||
k4a_device_configuration_t k4a_color_resolution_t color_resolution is now uint32_t color_mode_id. | ||
k4a_depth_mode_t depth_mode is now uint32_t depth_mode_id. | ||
k4a_fps_t camera_fps is now uint32_t fps_mode_id. | ||
|
||
|
||
4. The following #define have been added: | ||
|
||
K4A_INIT_STRUCT(T, S) Used to safely init the new device info and color/depth/fps mode info structs. | ||
K4A_ABI_VERSION Indicates the ABI version that is used in the new device info and color/depth/fps mode info structs. | ||
|
||
|
||
5. The following static const has been changed: | ||
|
||
K4A_DEVICE_CONFIG_INIT_DISABLE_ALL The fps_mode_id is set to 0, which means off. The color_mode_id and depth_mode_id is | ||
also set to 0, which means they are also both off. To start a device, either the | ||
color_mode_id or the depth_mode_id must not be set to 0 and the fps_mode_id must not be | ||
set to 0. To set the color_mode_id, depth_mode_id and fps_mode_id, use the new device get mode and | ||
modes count functions added to k4a.h. | ||
|
||
|
||
### Changes to k4a.h | ||
|
||
1. The following functions have been added: | ||
|
||
k4a_result_t k4a_device_get_info(k4a_device_t device_handle, k4a_device_info_t *device_info) | ||
|
||
k4a_result_t k4a_device_get_color_mode_count(k4a_device_t device_handle, uint32_t *mode_count) | ||
k4a_result_t k4a_device_get_depth_mode_count(k4a_device_t device_handle, uint32_t *mode_count) | ||
k4a_result_t k4a_device_get_fps_mode_count(k4a_device_t device_handle, uint32_t *mode_count) | ||
|
||
k4a_result_t k4a_device_get_color_mode(k4a_device_t device_handle, uint32_t mode_index, k4a_color_mode_info_t *mode_info) | ||
k4a_result_t k4a_device_get_depth_mode(k4a_device_t device_handle, uint32_t mode_index, k4a_depth_mode_info_t *mode_info) | ||
k4a_result_t k4a_device_get_fps_mode(k4a_device_t device_handle, uint32_t mode_index, k4a_fps_mode_info_t *mode_info) | ||
|
||
2. The following functions have been changed: | ||
|
||
k4a_result_t k4a_device_get_calibration(k4a_device_t device_handle, | ||
const k4a_depth_mode_t depth_mode is now const uint32_t depth_mode_id, | ||
const k4a_color_resolution_t color_resolution is now const uint32_t color_mode_id, | ||
k4a_calibration_t *calibration) | ||
|
||
k4a_result_t k4a_calibration_get_from_raw(char *raw_calibration, | ||
size_t raw_calibration_size, | ||
const k4a_depth_mode_t depth_mode is now const uint32_t depth_mode_id, | ||
const k4a_color_resolution_t color_resolution is now const uint32_t color_mode_id, | ||
k4a_calibration_t *calibration) | ||
|
||
#### Using the new get device info and get color/depth/fps mode info functions added to k4a.h. | ||
|
||
1. Using k4a_device_get_info: | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
k4a_device_t device = NULL; | ||
if (K4A_RESULT_SUCCEEDED != k4a_device_open(0, &device)) | ||
{ | ||
printf("0: Failed to open device"); | ||
exit(-1); | ||
} | ||
|
||
k4a_device_info_t device_info = { sizeof(k4a_device_info_t), K4A_ABI_VERSION, 0 }; | ||
|
||
if (!k4a_device_get_info(device, &device_info) == K4A_RESULT_SUCCEEDED) | ||
{ | ||
printf("Failed to get device info\n"); | ||
exit(-1); | ||
} | ||
|
||
bool hasDepthDevice = (device_info.capabilities.bitmap.bHasDepth == 1); | ||
bool hasColorDevice = (device_info.capabilities.bitmap.bHasColor == 1); | ||
|
||
if(hasDepthDevice) | ||
{ | ||
printf("The device has a depth sensor.\n"); | ||
} | ||
|
||
if(hasColorDevice) | ||
{ | ||
printf("The device has a color sensor.\n"); | ||
} | ||
} | ||
|
||
|
||
2. Using k4a_device_get_color_mode with k4a_device_get_color_mode_count: | ||
|
||
int math_get_common_factor(int width, int height) | ||
{ | ||
return (height == 0) ? width : math_get_common_factor(height, width % height); | ||
} | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
k4a_device_t device = NULL; | ||
if (K4A_RESULT_SUCCEEDED != k4a_device_open(0, &device)) | ||
{ | ||
printf("0: Failed to open device"); | ||
exit(-1); | ||
} | ||
|
||
k4a_device_info_t device_info = { sizeof(k4a_device_info_t), K4A_ABI_VERSION, 0 }; | ||
|
||
if (!k4a_device_get_info(device, &device_info) == K4A_RESULT_SUCCEEDED) | ||
{ | ||
printf("Failed to get device info\n"); | ||
exit(-1); | ||
} | ||
|
||
bool hasColorDevice = (device_info.capabilities.bitmap.bHasColor == 1); | ||
|
||
if(!hasColorDevice) | ||
{ | ||
printf("The device does not have a color sensor.\n"); | ||
exit(-1); | ||
} | ||
|
||
uint32_t color_mode_count = 0; | ||
|
||
if (!K4A_SUCCEEDED(k4a_device_get_color_mode_count(device, &color_mode_count))) | ||
{ | ||
printf("Failed to get color mode count.\n"); | ||
exit(-1); | ||
} | ||
|
||
k4a_color_mode_info_t color_mode_info = { sizeof(k4a_color_mode_info_t), K4A_ABI_VERSION, 0 }; | ||
|
||
for (uint32_t c = 0; c < color_mode_count; c++) | ||
{ | ||
if (k4a_device_get_color_mode(device, c, &color_mode_info) == K4A_RESULT_SUCCEEDED) | ||
{ | ||
int width = static_cast<int>(color_mode_info.width); | ||
int height = static_cast<int>(color_mode_info.height); | ||
int common_factor = math_get_common_factor(width, height); | ||
|
||
printf("\t"); | ||
printf("[%u] = ", c); | ||
printf("\t"); | ||
if(height < 1000) | ||
{ | ||
printf(" "); | ||
} | ||
printf("%up", height); | ||
printf("\t"); | ||
printf("%i:", width/common_factor); | ||
printf("%i", height/common_factor); | ||
printf("\n"); | ||
} | ||
} | ||
} | ||
|
||
|
||
3. Using k4a_device_get_depth_mode with k4a_device_get_depth_mode_count: | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
k4a_device_t device = NULL; | ||
if (K4A_RESULT_SUCCEEDED != k4a_device_open(0, &device)) | ||
{ | ||
printf("0: Failed to open device"); | ||
exit(-1); | ||
} | ||
|
||
k4a_device_info_t device_info = { sizeof(k4a_device_info_t), K4A_ABI_VERSION, 0 }; | ||
|
||
if (!k4a_device_get_info(device, &device_info) == K4A_RESULT_SUCCEEDED) | ||
{ | ||
printf("Failed to get device info\n"); | ||
exit(-1); | ||
} | ||
|
||
bool hasDepthDevice = (device_info.capabilities.bitmap.bHasDepth == 1); | ||
|
||
if(!hasDepthDevice) | ||
{ | ||
printf("The device does not have a depth sensor.\n"); | ||
exit(-1); | ||
} | ||
|
||
uint32_t depth_mode_count = 0; | ||
|
||
if (!K4A_SUCCEEDED(k4a_device_get_depth_mode_count(device, &depth_mode_count))) | ||
{ | ||
printf("Failed to get depth mode count.\n"); | ||
exit(-1); | ||
} | ||
|
||
k4a_depth_mode_info_t depth_mode_info = { sizeof(k4a_depth_mode_info_t), K4A_ABI_VERSION, 0 }; | ||
|
||
for (uint32_t d = 0; d < depth_mode_count; d++) | ||
{ | ||
if (k4a_device_get_depth_mode(device, d, &depth_mode_info) == K4A_RESULT_SUCCEEDED) | ||
{ | ||
int width = static_cast<int>(depth_mode_info.width); | ||
int height = static_cast<int>(depth_mode_info.height); | ||
float fov = depth_mode_info.horizontal_fov; | ||
|
||
printf("\t"); | ||
printf("[%u] = ", d); | ||
printf("\t"); | ||
if (depth_mode_info.passive_ir_only) | ||
{ | ||
printf("Passive IR"); | ||
printf("\n"); | ||
} | ||
else | ||
{ | ||
if (width < 1000) | ||
{ | ||
printf(" "); | ||
} | ||
printf("%ix", width); | ||
if (height < 1000) | ||
{ | ||
printf(" "); | ||
} | ||
printf("%i, ", height); | ||
printf("%f Deg", fov); | ||
} | ||
} | ||
} | ||
} | ||
|
||
|
||
4. Using k4a_device_get_fps_mode with k4a_device_get_fps_mode_count: | ||
|
||
int main(int argc, char **argv) | ||
{ | ||
k4a_device_t device = NULL; | ||
if (K4A_RESULT_SUCCEEDED != k4a_device_open(0, &device)) | ||
{ | ||
printf("0: Failed to open device"); | ||
exit(-1); | ||
} | ||
|
||
uint32_t fps_mode_count = 0; | ||
|
||
if (!K4A_SUCCEEDED(k4a_device_get_fps_mode_count(device, &fps_mode_count))) | ||
{ | ||
printf("Failed to get fps mode count.\n"); | ||
exit(-1); | ||
} | ||
|
||
k4a_fps_mode_info_t fps_mode_info = { sizeof(k4a_fps_mode_info_t), K4A_ABI_VERSION, 0 }; | ||
|
||
for (uint32_t f = 0; f < fps_mode_count; f++) | ||
{ | ||
if (k4a_device_get_fps_mode(device, f, &fps_mode_info) == K4A_RESULT_SUCCEEDED) | ||
{ | ||
printf("\t%up\n", fps_mode_info.fps); | ||
} | ||
} | ||
} | ||
|
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should have additional formatting to make the document easier to read. ie using
code blocks
for code, enum definitions, and struct definitions.