Skip to content

Package: OptimizeOp

OptimizeOp

nameinstructionbranchcomplexitylinemethod
OptimizeOp()
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
OptimizeOp(double)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
OptimizeOp(double, Quality)
M: 9 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 4 C: 0
0%
M: 1 C: 0
0%
getQuality()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getScale()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
toString()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

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 OptimizeOp extends Operation
37: {
38: private double scale;
39: private Quality quality;
40:
41: /*******************************************************************************************************************
42: *
43: * Creates a version of this image which is optimized for bit-blit operations
44: * on the current display. This usually means that the image is reduced to
45: * 8-bits-per-sample, converted to the sRGB color profile and changed to the
46: * proper ColorModel and SampleModel.
47: *
48: * @param scale the scale
49: * @param quality the quality
50: *
51: ******************************************************************************************************************/
52: public OptimizeOp (final double scale, final Quality quality)
53: {
54: this.scale = scale;
55: this.quality = quality;
56: }
57:
58: /*******************************************************************************************************************
59: *
60: * See {@link #CreateOptimizedImageOp(double, Quality)}.
61: * The used interpolation type is the fastest possible, usually nearest neighbor.
62: *
63: ******************************************************************************************************************/
64: public OptimizeOp()
65: {
66: this(1.0, Quality.FASTEST);
67: }
68:
69: /*******************************************************************************************************************
70: *
71: * See {@link #CreateOptimizedImageOp(double, Quality)}.
72: * The used interpolation type is the fastest possible, usually nearest neighbor.
73: *
74: * @param scale the scale
75: *
76: ******************************************************************************************************************/
77: public OptimizeOp (final double scale)
78: {
79: this(scale, Quality.FASTEST);
80: }
81:
82: /*******************************************************************************************************************
83: *
84: *
85: ******************************************************************************************************************/
86: public double getScale()
87: {
88: return scale;
89: }
90:
91: /*******************************************************************************************************************
92: *
93: *
94: ******************************************************************************************************************/
95: public Quality getQuality()
96: {
97: return quality;
98: }
99:
100: /*******************************************************************************************************************
101: *
102: * {@inheritDoc}
103: *
104: ******************************************************************************************************************/
105: @Override
106: public String toString()
107: {
108: return "OptimizeOp(scale:" + scale + ", quality:" + quality + ")";
109: }
110: }