Skip to content

Package: ScaleOp

ScaleOp

nameinstructionbranchcomplexitylinemethod
ScaleOp(double)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
ScaleOp(double, Quality)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
ScaleOp(double, double)
M: 0 C: 6
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 2
100%
M: 0 C: 1
100%
ScaleOp(double, double, Quality)
M: 0 C: 12
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 5
100%
M: 0 C: 1
100%
getQuality()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getXScale()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
getYScale()
M: 0 C: 3
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
toString()
M: 0 C: 8
100%
M: 0 C: 0
100%
M: 0 C: 1
100%
M: 0 C: 1
100%
M: 0 C: 1
100%

Coverage

1: /*
2: * *********************************************************************************************************************
3: *
4: * Mistral: open source imaging engine
5: * http://tidalwave.it/projects/mistral
6: *
7: * Copyright (C) 2003 - 2023 by Tidalwave s.a.s. (http://tidalwave.it)
8: *
9: * *********************************************************************************************************************
10: *
11: * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with
12: * the License. You may obtain a copy of the License at
13: *
14: * http://www.apache.org/licenses/LICENSE-2.0
15: *
16: * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on
17: * an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the
18: * specific language governing permissions and limitations under the License.
19: *
20: * *********************************************************************************************************************
21: *
22: * git clone https://bitbucket.org/tidalwave/mistral-src
23: * git clone https://github.com/tidalwave-it/mistral-src
24: *
25: * *********************************************************************************************************************
26: */
27: package it.tidalwave.image.op;
28:
29: import it.tidalwave.image.Quality;
30:
31: /***********************************************************************************************************************
32: *
33: * @author Fabrizio Giudici
34: *
35: **********************************************************************************************************************/
36: public class ScaleOp extends Operation
37: {
38: private final double xScale;
39: private final double yScale;
40: private final Quality quality;
41:
42: /*******************************************************************************************************************
43: *
44: * Creates a scaled image. This method allows to choose the desired interpolation
45: * algorithm.
46: *
47: * @param xScale the horizontal scale
48: * @param yScale the vertical scale
49: * @param quality the quality
50: *
51: ******************************************************************************************************************/
52: public ScaleOp (final double xScale, final double yScale, final Quality quality)
53: {
54: this.xScale = xScale;
55: this.yScale = yScale;
56: this.quality = quality;
57: }
58:
59: /*******************************************************************************************************************
60: *
61: * Creates a scaled image. The quality is the fastest.
62: *
63: * @param scale the scale
64: * @return the scaled image
65: *
66: ******************************************************************************************************************/
67: public ScaleOp (final double scale)
68: {
69: this(scale, scale, Quality.FASTEST);
70: }
71:
72: /*******************************************************************************************************************
73: *
74: * Creates a scaled image. The quality is the fastest.
75: *
76: * @param hScale the horizontal scale
77: * @param vScale the vertical scale
78: * @return the scaled image
79: *
80: ******************************************************************************************************************/
81: public ScaleOp (final double hScale, final double vScale)
82: {
83: this(hScale, vScale, Quality.FASTEST);
84: }
85:
86: /*******************************************************************************************************************
87: *
88: * Creates a scaled image. This method allows to choose the desired interpolation
89: * algorithm.
90: *
91: * @param scale the scale
92: * @param quality the quality
93: * @return the scaled image
94: *
95: ******************************************************************************************************************/
96: public ScaleOp (final double scale, final Quality quality)
97: {
98: this(scale, scale, quality);
99: }
100:
101: /*******************************************************************************************************************
102: *
103: *
104: ******************************************************************************************************************/
105: public double getXScale()
106: {
107: return xScale;
108: }
109:
110: /*******************************************************************************************************************
111: *
112: *
113: ******************************************************************************************************************/
114: public double getYScale()
115: {
116: return yScale;
117: }
118:
119: /*******************************************************************************************************************
120: *
121: *
122: ******************************************************************************************************************/
123: public Quality getQuality()
124: {
125: return quality;
126: }
127:
128: /*******************************************************************************************************************
129: *
130: * {@inheritDoc}
131: *
132: ******************************************************************************************************************/
133: @Override
134: public String toString()
135: {
136: return "ScaleOp(xScale:" + xScale + ", yScale:" + yScale + ", quality:" + quality + ")";
137: }
138: }