2017-07-21 16:21:34 +00:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
2023-04-06 07:23:37 +00:00
|
|
|
* SPDX-License-Identifier: BSD-3-Clause
|
2017-07-21 16:21:34 +00:00
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QSK_GRAPHIC_TEXTURE_FACTORY_H
|
|
|
|
#define QSK_GRAPHIC_TEXTURE_FACTORY_H
|
|
|
|
|
|
|
|
#include "QskColorFilter.h"
|
2018-08-03 06:15:28 +00:00
|
|
|
#include "QskGraphic.h"
|
2018-10-04 14:15:42 +00:00
|
|
|
|
2018-07-19 12:10:48 +00:00
|
|
|
#include <qquickimageprovider.h>
|
2017-07-21 16:21:34 +00:00
|
|
|
|
|
|
|
class QSK_EXPORT QskGraphicTextureFactory : public QQuickTextureFactory
|
|
|
|
{
|
2018-08-03 06:15:28 +00:00
|
|
|
public:
|
2017-07-21 16:21:34 +00:00
|
|
|
QskGraphicTextureFactory();
|
|
|
|
QskGraphicTextureFactory( const QskGraphic&, const QSize& size );
|
|
|
|
|
2018-07-31 15:32:25 +00:00
|
|
|
~QskGraphicTextureFactory() override;
|
2017-07-21 16:21:34 +00:00
|
|
|
|
|
|
|
void setGraphic( const QskGraphic& );
|
|
|
|
QskGraphic graphic() const;
|
|
|
|
|
|
|
|
void setColorFilter( const QskColorFilter& );
|
|
|
|
const QskColorFilter& colorFilter() const;
|
|
|
|
|
|
|
|
void setSize( const QSize& size );
|
|
|
|
QSize size() const;
|
|
|
|
|
2018-07-31 15:32:25 +00:00
|
|
|
QSGTexture* createTexture( QQuickWindow* ) const override;
|
|
|
|
QSize textureSize() const override;
|
|
|
|
int textureByteCount() const override;
|
2017-07-21 16:21:34 +00:00
|
|
|
|
2018-07-31 15:32:25 +00:00
|
|
|
QImage image() const override;
|
2017-07-21 16:21:34 +00:00
|
|
|
|
2018-08-03 06:15:28 +00:00
|
|
|
private:
|
2022-03-24 07:08:40 +00:00
|
|
|
Q_DISABLE_COPY( QskGraphicTextureFactory )
|
|
|
|
|
2017-07-21 16:21:34 +00:00
|
|
|
QskGraphic m_graphic;
|
|
|
|
QskColorFilter m_colorFilter;
|
|
|
|
QSize m_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|