Differential D14589 Diff 39128 plugins/filters/convertheightnormalmap/kis_convert_height_to_normal_map_filter.cpp
Changeset View
Changeset View
Standalone View
Standalone View
plugins/filters/convertheightnormalmap/kis_convert_height_to_normal_map_filter.cpp
Show First 20 Lines • Show All 140 Lines • ▼ Show 20 Line(s) | |||||
141 | } | 141 | } | ||
142 | 142 | | |||
143 | QRect KisConvertHeightToNormalMapFilter::neededRect(const QRect &rect, const KisFilterConfigurationSP _config, int lod) const | 143 | QRect KisConvertHeightToNormalMapFilter::neededRect(const QRect &rect, const KisFilterConfigurationSP _config, int lod) const | ||
144 | { | 144 | { | ||
145 | KisLodTransformScalar t(lod); | 145 | KisLodTransformScalar t(lod); | ||
146 | 146 | | |||
147 | QVariant value; | 147 | QVariant value; | ||
148 | /** | 148 | /** | ||
149 | * NOTE: integer devision by two is done on purpose, | 149 | * NOTE: integer division by two is done on purpose, | ||
150 | * because the kernel size is always odd | 150 | * because the kernel size is always odd | ||
151 | */ | 151 | */ | ||
152 | const int halfWidth = _config->getProperty("horizRadius", value) ? KisEdgeDetectionKernel::kernelSizeFromRadius(t.scale(value.toFloat())) / 2 : 5; | 152 | const int halfWidth = _config->getProperty("horizRadius", value) ? KisEdgeDetectionKernel::kernelSizeFromRadius(t.scale(value.toFloat())) / 2 : 5; | ||
153 | const int halfHeight = _config->getProperty("vertRadius", value) ? KisEdgeDetectionKernel::kernelSizeFromRadius(t.scale(value.toFloat())) / 2 : 5; | 153 | const int halfHeight = _config->getProperty("vertRadius", value) ? KisEdgeDetectionKernel::kernelSizeFromRadius(t.scale(value.toFloat())) / 2 : 5; | ||
154 | 154 | | |||
155 | return rect.adjusted(-halfWidth * 2, -halfHeight * 2, halfWidth * 2, halfHeight * 2); | 155 | return rect.adjusted(-halfWidth * 2, -halfHeight * 2, halfWidth * 2, halfHeight * 2); | ||
156 | } | 156 | } | ||
157 | 157 | | |||
Show All 13 Lines |