rawTherapee/rtgui/rtsurface.h
Pandagrapher 1c85926200 Creates an RTImage cache
Fixes:
- Fixes GUI issue on Windows (GDI handles limit reached)
- Fixes an incorrect icon name in Perspective tool
- Adds robustness RTScalable::loadSurfaceFromIcon function
2022-09-02 19:15:42 +02:00

57 lines
1.6 KiB
C++

/*
* This file is part of RawTherapee.
*
* Copyright (c) 2018 Jean-Christophe FRISCH <natureh.510@gmail.com>
* Copyright (c) 2022 Pierre CABRERA <pierre.cab@gmail.com>
*
* RawTherapee is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* RawTherapee is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#pragma once
#include "rtscalable.h"
/**
* @brief A custom class in order to handle Hi-DPI surface.
*/
class RTSurface final : public RTScalable
{
public:
enum RTSurfaceType {
InvalidType = 1,
IconType = 2,
PNGType = 3,
SVGType = 4
};
private:
double dpiBack; // Used to identify dpi change
int scaleBack; // Used to identify scale change
RTSurfaceType type;
Glib::ustring name;
Gtk::IconSize icon_size;
Cairo::RefPtr<Cairo::ImageSurface> surface;
public:
RTSurface();
explicit RTSurface(const Glib::ustring &icon_name, const Gtk::IconSize iconSize);
explicit RTSurface(const Glib::ustring &fname);
int getWidth();
int getHeight();
bool hasSurface();
Cairo::RefPtr<Cairo::ImageSurface> get();
void updateSurface();
};