View Javadoc
1   /*
2    * #%L
3    * wcm.io
4    * %%
5    * Copyright (C) 2024 wcm.io
6    * %%
7    * Licensed under the Apache License, Version 2.0 (the "License");
8    * you may not use this file except in compliance with the License.
9    * You may obtain a copy of the License at
10   *
11   *      http://www.apache.org/licenses/LICENSE-2.0
12   *
13   * Unless required by applicable law or agreed to in writing, software
14   * distributed under the License is distributed on an "AS IS" BASIS,
15   * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16   * See the License for the specific language governing permissions and
17   * limitations under the License.
18   * #L%
19   */
20  package io.wcm.handler.mediasource.dam.impl.weboptimized;
21  
22  import org.jetbrains.annotations.NotNull;
23  import org.jetbrains.annotations.Nullable;
24  
25  import io.wcm.handler.media.CropDimension;
26  
27  /**
28   * Parameters for rendering a rendition.
29   */
30  public class WebOptimizedImageDeliveryParams {
31  
32    private Long width;
33    private CropDimension cropDimension;
34    private Integer rotation;
35    private Integer quality;
36  
37    /**
38     * @return Width
39     */
40    public @Nullable Long getWidth() {
41      return this.width;
42    }
43  
44    /**
45     * @param value Width
46     * @return this
47     */
48    public @NotNull WebOptimizedImageDeliveryParams width(@Nullable Long value) {
49      this.width = value;
50      return this;
51    }
52  
53    /**
54     * @return Crop dimension
55     */
56    public @Nullable CropDimension getCropDimension() {
57      return this.cropDimension;
58    }
59  
60    /**
61     * @param value Crop dimension
62     * @return this
63     */
64    public @NotNull WebOptimizedImageDeliveryParams cropDimension(@Nullable CropDimension value) {
65      this.cropDimension = value;
66      return this;
67    }
68  
69    /**
70     * @return Rotation
71     */
72    public @Nullable Integer getRotation() {
73      return this.rotation;
74    }
75  
76    /**
77     * @param value Rotation
78     * @return this
79     */
80    public @NotNull WebOptimizedImageDeliveryParams rotation(@Nullable Integer value) {
81      this.rotation = value;
82      return this;
83    }
84  
85    /**
86     * @return Quality
87     */
88    public @Nullable Integer getQuality() {
89      return this.quality;
90    }
91  
92    /**
93     * @param value Quality
94     * @return this
95     */
96    public @NotNull WebOptimizedImageDeliveryParams quality(@Nullable Integer value) {
97      this.quality = value;
98      return this;
99    }
100 
101 }