Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add width and height to encoded frame #1174

Merged
merged 1 commit into from
Nov 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion cmake/Depthai/DepthaiDeviceSideConfig.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set(DEPTHAI_DEVICE_SIDE_MATURITY "snapshot")

# "full commit hash of device side binary"
set(DEPTHAI_DEVICE_SIDE_COMMIT "30fe0b8eee71a49f5194cd3c056bf50db4e21502")
set(DEPTHAI_DEVICE_SIDE_COMMIT "97329ec22d4ef0bc4961e09c673d2c6a33bdc6d8")

# "version if applicable"
set(DEPTHAI_DEVICE_SIDE_VERSION "")
23 changes: 23 additions & 0 deletions include/depthai/pipeline/datatype/EncodedFrame.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ class EncodedFrame : public Buffer {
* Retrieves instance number
*/
unsigned int getInstanceNum() const;
/**
* Retrieves image width in pixels
*/
unsigned int getWidth() const;

/**
* Retrieves image height in pixels
*/
unsigned int getHeight() const;
/**
* Retrieves exposure time
*/
Expand Down Expand Up @@ -111,6 +120,20 @@ class EncodedFrame : public Buffer {
*/
EncodedFrame& setInstanceNum(unsigned int instance);

/**
* Specifies frame width
*
* @param width frame width
*/
EncodedFrame& setWidth(unsigned int width);

/**
* Specifies frame height
*
* @param height frame height
*/
EncodedFrame& setHeight(unsigned int height);

/**
* Specifies the encoding quality
*
Expand Down
2 changes: 1 addition & 1 deletion shared/depthai-shared
14 changes: 14 additions & 0 deletions src/pipeline/datatype/EncodedFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ EncodedFrame::EncodedFrame(std::shared_ptr<RawEncodedFrame> ptr) : Buffer(std::m
unsigned int EncodedFrame::getInstanceNum() const {
return frame.instanceNum;
}
unsigned int EncodedFrame::getWidth() const {
return frame.width;
}
unsigned int EncodedFrame::getHeight() const {
return frame.height;
}
std::chrono::microseconds EncodedFrame::getExposureTime() const {
return std::chrono::microseconds(frame.cam.exposureTimeUs);
}
Expand Down Expand Up @@ -99,6 +105,14 @@ EncodedFrame& EncodedFrame::setInstanceNum(unsigned int instanceNum) {
frame.instanceNum = instanceNum;
return *this;
}
EncodedFrame& EncodedFrame::setWidth(unsigned int width) {
frame.width = width;
return *this;
}
EncodedFrame& EncodedFrame::setHeight(unsigned int height) {
frame.height = height;
return *this;
}
EncodedFrame& EncodedFrame::setQuality(unsigned int quality) {
frame.quality = quality;
return *this;
Expand Down