summaryrefslogtreecommitdiff
path: root/test/signal.cpp
AgeCommit message (Expand)Author
2020-01-22test: signal: Add additional disconnection tests for ObjectLaurent Pinchart
2020-01-07test: signal: Test connecting to non-void slotsLaurent Pinchart
2019-07-11test: signal: Extend Signal test with multi-inheritance reeiverLaurent Pinchart
2019-04-27test: signal: Exercise the signal delivery code paths for ObjectLaurent Pinchart
2019-02-13libcamera: signal: Disconnect signal automatically on slot deletionLaurent Pinchart
2019-01-08test: Add signal/slot testLaurent Pinchart
plain)
1
2
3
4
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
36
/* SPDX-License-Identifier: LGPL-2.1-or-later */
/*
 * Copyright (C) 2020, Google Inc.
 *
 * thumbnailer.h - Simple image thumbnailer
 */
#ifndef __ANDROID_JPEG_THUMBNAILER_H__
#define __ANDROID_JPEG_THUMBNAILER_H__

#include <libcamera/geometry.h>

#include "libcamera/internal/buffer.h"
#include "libcamera/internal/formats.h"

class Thumbnailer
{
public:
	Thumbnailer();

	void configure(const libcamera::Size &sourceSize,
		       libcamera::PixelFormat pixelFormat);
	void createThumbnail(const libcamera::FrameBuffer &source,
			     std::vector<unsigned char> *dest);
	const libcamera::Size &size() const { return targetSize_; }

private:
	libcamera::Size computeThumbnailSize() const;

	libcamera::PixelFormat pixelFormat_;
	libcamera::Size sourceSize_;
	libcamera::Size targetSize_;

	bool valid_;
};

#endif /* __ANDROID_JPEG_THUMBNAILER_H__ */