summaryrefslogtreecommitdiff
path: root/utils/raspberrypi/ctt/ctt_awb.py
AgeCommit message (Collapse)Author
2020-06-29utils: raspberrypi: ctt: Fix pycodestyle W605Laurent Pinchart
W605 invalid escape sequence '\.' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E302Laurent Pinchart
E302 expected 2 blank lines, found 0 Note that issues are still flagged, due to the use of docstrings as multi-lines comments. This will be addressed separately. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E305Laurent Pinchart
E305 expected 2 blank lines after class or function definition Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E711 and E712Laurent Pinchart
E711 comparison to None should be 'if cond is None:' E711 comparison to None should be 'if cond is not None:' E712 comparison to False should be 'if cond is False:' or 'if not cond:' E712 comparison to True should be 'if cond is True:' or 'if cond:' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E222Laurent Pinchart
E222 multiple spaces after operator Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E228Laurent Pinchart
E228 missing whitespace around modulo operator Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E225Laurent Pinchart
E225 missing whitespace around operator Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E203Laurent Pinchart
E203 whitespace before ':' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-13utils: raspberrypi: ctt: Fix pycodestyle E231Laurent Pinchart
E231 missing whitespace after ',' E231 missing whitespace after ':' Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: David Plowman <david.plowman@raspberrypi.com>
2020-05-11libcamera: utils: Raspberry Pi Camera Tuning ToolNaushir Patuck
Initial implementation of the Raspberry Pi (BCM2835) Camera Tuning Tool. All code is licensed under the BSD-2-Clause terms. Copyright (c) 2019-2020 Raspberry Pi Trading Ltd. Signed-off-by: Naushir Patuck <naush@raspberrypi.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
">const uint8_t *planeAddr(unsigned int plane) const; uint8_t *planeAddr(unsigned int plane); }; CameraBuffer::Private::Private(CameraBuffer *cameraBuffer, buffer_handle_t camera3Buffer, int flags) : Extensible::Private(cameraBuffer), handle_(camera3Buffer), numPlanes_(0), valid_(false) { bufferManager_ = cros::CameraBufferManager::GetInstance(); bufferManager_->Register(camera3Buffer); numPlanes_ = bufferManager_->GetNumPlanes(camera3Buffer); switch (numPlanes_) { case 1: { int ret = bufferManager_->Lock(handle_, 0, 0, 0, 0, 0, &mem.addr); if (ret) { LOG(HAL, Error) << "Single plane buffer mapping failed"; return; } break; } case 2: case 3: { int ret = bufferManager_->LockYCbCr(handle_, 0, 0, 0, 0, 0, &mem.ycbcr); if (ret) { LOG(HAL, Error) << "YCbCr buffer mapping failed"; return; } break; } default: LOG(HAL, Error) << "Invalid number of planes: " << numPlanes_; return; } valid_ = true; } CameraBuffer::Private::~Private() { bufferManager_->Unlock(handle_); bufferManager_->Deregister(handle_); } unsigned int CameraBuffer::Private::numPlanes() const { return bufferManager_->GetNumPlanes(handle_); } Span<uint8_t> CameraBuffer::Private::plane(unsigned int plane) { void *addr; switch (numPlanes()) { case 1: addr = mem.addr; break; default: switch (plane) { case 1: addr = mem.ycbcr.y; break; case 2: addr = mem.ycbcr.cb; break; case 3: addr = mem.ycbcr.cr; break; } } return { static_cast<uint8_t *>(addr), bufferManager_->GetPlaneSize(handle_, plane) }; } size_t CameraBuffer::Private::jpegBufferSize(size_t maxJpegBufferSize) const { return bufferManager_->GetPlaneSize(handle_, 0); } PUBLIC_CAMERA_BUFFER_IMPLEMENTATION