Skip to content

Commit

Permalink
core: Add 14-bit format support
Browse files Browse the repository at this point in the history
Add a 14-bit entry to the supported format table.

Signed-off-by: Csaba Nagy
  • Loading branch information
schoolpost authored and naushir committed Sep 16, 2024
1 parent d7a1a13 commit cea7388
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 1 deletion.
4 changes: 4 additions & 0 deletions core/options.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ static const std::map<libcamera::PixelFormat, unsigned int> bayer_formats =
{ libcamera::formats::SGRBG12_CSI2P, 12 },
{ libcamera::formats::SBGGR12_CSI2P, 12 },
{ libcamera::formats::SGBRG12_CSI2P, 12 },
{ libcamera::formats::SRGGB14_CSI2P, 14 },
{ libcamera::formats::SGRBG14_CSI2P, 14 },
{ libcamera::formats::SBGGR14_CSI2P, 14 },
{ libcamera::formats::SGBRG14_CSI2P, 14 },
{ libcamera::formats::SRGGB16, 16 },
{ libcamera::formats::SGRBG16, 16 },
{ libcamera::formats::SBGGR16, 16 },
Expand Down
2 changes: 2 additions & 0 deletions core/rpicam_app.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ static libcamera::PixelFormat mode_to_pixel_format(Mode const &mode)
{ Mode(0, 0, 10, true), libcamera::formats::SBGGR10_CSI2P },
{ Mode(0, 0, 12, false), libcamera::formats::SBGGR12 },
{ Mode(0, 0, 12, true), libcamera::formats::SBGGR12_CSI2P },
{ Mode(0, 0, 14, false), libcamera::formats::SBGGR14 },
{ Mode(0, 0, 14, true), libcamera::formats::SBGGR14_CSI2P },
};

auto it = std::find_if(table.begin(), table.end(), [&mode] (auto &m) { return mode.bit_depth == m.first.bit_depth && mode.packed == m.first.packed; });
Expand Down
3 changes: 2 additions & 1 deletion core/rpicam_app.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ class RPiCamApp
std::string fmt = format.toString();
unsigned int mode_depth = fmt.find("8") != std::string::npos ? 8 :
fmt.find("10") != std::string::npos ? 10 :
fmt.find("12") != std::string::npos ? 12 : 16;
fmt.find("12") != std::string::npos ? 12 :
fmt.find("14") != std::string::npos ? 14 : 16;
return mode_depth;
}
libcamera::Size size;
Expand Down

0 comments on commit cea7388

Please sign in to comment.