Skip to content

Commit

Permalink
Merge pull request luxonis#1174 from luxonis/encframe_add_width_height
Browse files Browse the repository at this point in the history
Add width and height to encoded frame
  • Loading branch information
asahtik authored Nov 15, 2024
2 parents 869d0ee + 0a65ae4 commit 9994eb3
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 2 deletions.
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

0 comments on commit 9994eb3

Please sign in to comment.