mirror of
https://git.libcamera.org/libcamera/libcamera.git
synced 2025-07-23 16:45:07 +03:00
Configure the thumbnailer based on the thumbnail parameters given by the android request metadata. Only the thumbnail encoder needs to be configured, and since it is only used at post-processing time, move the configuration out of the post-processor constructor and into the processing step. Also set the following android result metadata tags: - ANDROID_JPEG_THUMBNAIL_SIZE - ANDROID_JPEG_THUMBNAIL_QUALITY Signed-off-by: Paul Elder <paul.elder@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
34 lines
835 B
C++
34 lines
835 B
C++
/* 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,
|
|
const libcamera::Size &targetSize,
|
|
std::vector<unsigned char> *dest);
|
|
const libcamera::PixelFormat &pixelFormat() const { return pixelFormat_; }
|
|
|
|
private:
|
|
libcamera::PixelFormat pixelFormat_;
|
|
libcamera::Size sourceSize_;
|
|
|
|
bool valid_;
|
|
};
|
|
|
|
#endif /* __ANDROID_JPEG_THUMBNAILER_H__ */
|