LMMS
Loading...
Searching...
No Matches
juce_ScaledImage.h
Go to the documentation of this file.
1/*
2 ==============================================================================
3
4 This file is part of the JUCE library.
5 Copyright (c) 2022 - Raw Material Software Limited
6
7 JUCE is an open source library subject to commercial or open-source
8 licensing.
9
10 By using JUCE, you agree to the terms of both the JUCE 7 End-User License
11 Agreement and JUCE Privacy Policy.
12
13 End User License Agreement: www.juce.com/juce-7-licence
14 Privacy Policy: www.juce.com/juce-privacy-policy
15
16 Or: You may also use this code under the terms of the GPL v3 (see
17 www.gnu.org/licenses).
18
19 JUCE IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL WARRANTIES, WHETHER
20 EXPRESSED OR IMPLIED, INCLUDING MERCHANTABILITY AND FITNESS FOR PURPOSE, ARE
21 DISCLAIMED.
22
23 ==============================================================================
24*/
25
26namespace juce
27{
28
45{
46public:
49 ScaledImage() = default;
50
54 explicit ScaledImage (const Image& imageIn)
55 : ScaledImage (imageIn, 1.0) {}
56
65 ScaledImage (const Image& imageIn, double scaleIn)
66 : image (imageIn), scaleFactor (scaleIn) {}
67
69 Image getImage() const { return image; }
70
72 double getScale() const { return scaleFactor; }
73
75 Rectangle<double> getScaledBounds() const { return image.getBounds().toDouble() / scaleFactor; }
76
77private:
79 double scaleFactor = 1.0;
80};
81
82} // namespace juce
Definition juce_Image.h:58
Definition juce_Rectangle.h:67
double scaleFactor
Definition juce_ScaledImage.h:79
double getScale() const
Definition juce_ScaledImage.h:72
Image getImage() const
Definition juce_ScaledImage.h:69
ScaledImage(const Image &imageIn, double scaleIn)
Definition juce_ScaledImage.h:65
ScaledImage()=default
Rectangle< double > getScaledBounds() const
Definition juce_ScaledImage.h:75
ScaledImage(const Image &imageIn)
Definition juce_ScaledImage.h:54
Image image
Definition juce_ScaledImage.h:78
#define JUCE_API
Definition juce_StandardHeader.h:152
Definition carla_juce.cpp:31