A non-owning span is sufficient, so use that instead of a vector. Signed-off-by: Barnabás Pőcze <barnabas.pocze@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
30 lines
616 B
C++
30 lines
616 B
C++
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
|
/*
|
|
* Copyright (C) 2022, Ideas on Board Oy
|
|
*
|
|
* SDL Texture
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include <libcamera/base/span.h>
|
|
|
|
#include <SDL2/SDL.h>
|
|
|
|
#include "../common/image.h"
|
|
|
|
class SDLTexture
|
|
{
|
|
public:
|
|
SDLTexture(const SDL_Rect &rect, uint32_t pixelFormat, const int stride);
|
|
virtual ~SDLTexture();
|
|
int create(SDL_Renderer *renderer);
|
|
virtual void update(libcamera::Span<const libcamera::Span<const uint8_t>> data) = 0;
|
|
SDL_Texture *get() const { return ptr_; }
|
|
|
|
protected:
|
|
SDL_Texture *ptr_;
|
|
const SDL_Rect rect_;
|
|
const uint32_t pixelFormat_;
|
|
const int stride_;
|
|
};
|