summaryrefslogtreecommitdiff
path: root/subprojects/libyuv.wrap
AgeCommit message (Expand)Author
2022-09-30libcamera: Add missing SPDX headers for miscellaneous CC0-1.0 contentsLaurent Pinchart
2021-02-04subprojects: Add libyuv and built if -Dandroid=enabledHirokazu Honda
href='#n5'>5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2021, Google Inc.
 *
 * post_processor_yuv.h - Post Processor using libyuv
 */

#pragma once

#include "../post_processor.h"

#include <libcamera/geometry.h>

class PostProcessorYuv : public PostProcessor
{
public:
	PostProcessorYuv() = default;

	int configure(const libcamera::StreamConfiguration &incfg,
		      const libcamera::StreamConfiguration &outcfg) override;
	void process(Camera3RequestDescriptor::StreamBuffer *streamBuffer) override;

private:
	bool isValidBuffers(const libcamera::FrameBuffer &source,
			    const CameraBuffer &destination) const;
	void calculateLengths(const libcamera::StreamConfiguration &inCfg,
			      const libcamera::StreamConfiguration &outCfg);

	libcamera::Size sourceSize_;
	libcamera::Size destinationSize_;
	unsigned int sourceLength_[2] = {};
	unsigned int destinationLength_[2] = {};
	unsigned int sourceStride_[2] = {};
	unsigned int destinationStride_[2] = {};
};