2017-07-21 18:21:34 +02:00
|
|
|
/******************************************************************************
|
|
|
|
* QSkinny - Copyright (C) 2016 Uwe Rathmann
|
|
|
|
* This file may be used under the terms of the QSkinny License, Version 1.0
|
|
|
|
*****************************************************************************/
|
|
|
|
|
|
|
|
#ifndef QSK_GRAPHIC_TEXTURE_FACTORY_H
|
|
|
|
#define QSK_GRAPHIC_TEXTURE_FACTORY_H
|
|
|
|
|
|
|
|
#include "QskColorFilter.h"
|
2018-08-03 08:15:28 +02:00
|
|
|
#include "QskGraphic.h"
|
2018-10-04 16:15:42 +02:00
|
|
|
|
2018-07-19 14:10:48 +02:00
|
|
|
#include <qquickimageprovider.h>
|
2017-07-21 18:21:34 +02:00
|
|
|
|
|
|
|
class QSK_EXPORT QskGraphicTextureFactory : public QQuickTextureFactory
|
|
|
|
{
|
2018-08-03 08:15:28 +02:00
|
|
|
public:
|
2017-07-21 18:21:34 +02:00
|
|
|
QskGraphicTextureFactory();
|
|
|
|
QskGraphicTextureFactory( const QskGraphic&, const QSize& size );
|
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
~QskGraphicTextureFactory() override;
|
2017-07-21 18:21:34 +02: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 17:32:25 +02:00
|
|
|
QSGTexture* createTexture( QQuickWindow* ) const override;
|
|
|
|
QSize textureSize() const override;
|
|
|
|
int textureByteCount() const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-07-31 17:32:25 +02:00
|
|
|
QImage image() const override;
|
2017-07-21 18:21:34 +02:00
|
|
|
|
2018-08-03 08:15:28 +02:00
|
|
|
private:
|
2022-03-24 08:08:40 +01:00
|
|
|
Q_DISABLE_COPY( QskGraphicTextureFactory )
|
|
|
|
|
2017-07-21 18:21:34 +02:00
|
|
|
QskGraphic m_graphic;
|
|
|
|
QskColorFilter m_colorFilter;
|
|
|
|
QSize m_size;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|