Changeset View
Changeset View
Standalone View
Standalone View
krita/ui/tests/kis_prescaled_projection_test.cpp
Show First 20 Lines • Show All 172 Lines • ▼ Show 20 Line(s) | 159 | { | |||
---|---|---|---|---|---|
173 | layer->paintDevice()->convertFromQImage(qimage, 0); | 173 | layer->paintDevice()->convertFromQImage(qimage, 0); | ||
174 | 174 | | |||
175 | KisPrescaledProjection projection; | 175 | KisPrescaledProjection projection; | ||
176 | KisCoordinatesConverter converter; | 176 | KisCoordinatesConverter converter; | ||
177 | 177 | | |||
178 | converter.setImage(image); | 178 | converter.setImage(image); | ||
179 | projection.setCoordinatesConverter(&converter); | 179 | projection.setCoordinatesConverter(&converter); | ||
180 | projection.setMonitorProfile(0, | 180 | projection.setMonitorProfile(0, | ||
181 | KoColorConversionTransformation::InternalRenderingIntent, | 181 | KoColorConversionTransformation::internalRenderingIntent(), | ||
182 | KoColorConversionTransformation::InternalConversionFlags); | 182 | KoColorConversionTransformation::internalConversionFlags()); | ||
183 | projection.setImage(image); | 183 | projection.setImage(image); | ||
184 | 184 | | |||
185 | // pixel-for-pixel, at 100% zoom | 185 | // pixel-for-pixel, at 100% zoom | ||
186 | converter.setResolution(image->xRes(), image->yRes()); | 186 | converter.setResolution(image->xRes(), image->yRes()); | ||
187 | 187 | | |||
188 | testProjectionScenario(projection, &converter, "pixel_for_pixel"); | 188 | testProjectionScenario(projection, &converter, "pixel_for_pixel"); | ||
189 | 189 | | |||
190 | } | 190 | } | ||
Show All 17 Lines | 194 | { | |||
208 | layer->paintDevice()->convertFromQImage(qimage, 0); | 208 | layer->paintDevice()->convertFromQImage(qimage, 0); | ||
209 | 209 | | |||
210 | KisPrescaledProjection projection; | 210 | KisPrescaledProjection projection; | ||
211 | KisCoordinatesConverter converter; | 211 | KisCoordinatesConverter converter; | ||
212 | 212 | | |||
213 | converter.setImage(image); | 213 | converter.setImage(image); | ||
214 | projection.setCoordinatesConverter(&converter); | 214 | projection.setCoordinatesConverter(&converter); | ||
215 | projection.setMonitorProfile(0, | 215 | projection.setMonitorProfile(0, | ||
216 | KoColorConversionTransformation::InternalRenderingIntent, | 216 | KoColorConversionTransformation::internalRenderingIntent(), | ||
217 | KoColorConversionTransformation::InternalConversionFlags); | 217 | KoColorConversionTransformation::internalConversionFlags()); | ||
218 | projection.setImage(image); | 218 | projection.setImage(image); | ||
219 | 219 | | |||
220 | testProjectionScenario(projection, &converter, "120dpi"); | 220 | testProjectionScenario(projection, &converter, "120dpi"); | ||
221 | 221 | | |||
222 | } | 222 | } | ||
223 | 223 | | |||
224 | //#include <valgrind/callgrind.h> | 224 | //#include <valgrind/callgrind.h> | ||
225 | 225 | | |||
Show All 14 Lines | 227 | { | |||
240 | image->addNode(layer, image->rootLayer(), 0); | 240 | image->addNode(layer, image->rootLayer(), 0); | ||
241 | 241 | | |||
242 | KisPrescaledProjection projection; | 242 | KisPrescaledProjection projection; | ||
243 | 243 | | |||
244 | KisCoordinatesConverter converter; | 244 | KisCoordinatesConverter converter; | ||
245 | converter.setImage(image); | 245 | converter.setImage(image); | ||
246 | projection.setCoordinatesConverter(&converter); | 246 | projection.setCoordinatesConverter(&converter); | ||
247 | projection.setMonitorProfile(0, | 247 | projection.setMonitorProfile(0, | ||
248 | KoColorConversionTransformation::InternalRenderingIntent, | 248 | KoColorConversionTransformation::internalRenderingIntent(), | ||
249 | KoColorConversionTransformation::InternalConversionFlags); | 249 | KoColorConversionTransformation::internalConversionFlags()); | ||
250 | projection.setImage(image); | 250 | projection.setImage(image); | ||
251 | 251 | | |||
252 | // Emulate "Use same aspect as pixels" | 252 | // Emulate "Use same aspect as pixels" | ||
253 | converter.setResolution(image->xRes(), image->yRes()); | 253 | converter.setResolution(image->xRes(), image->yRes()); | ||
254 | 254 | | |||
255 | converter.setZoom(1.0); | 255 | converter.setZoom(1.0); | ||
256 | 256 | | |||
257 | KisUpdateInfoSP info = projection.updateCache(image->bounds()); | 257 | KisUpdateInfoSP info = projection.updateCache(image->bounds()); | ||
Show All 39 Lines | 285 | PrescaledProjectionTester() { | |||
297 | converter.setResolution(100, 100); | 297 | converter.setResolution(100, 100); | ||
298 | converter.setZoom(1.); | 298 | converter.setZoom(1.); | ||
299 | converter.setImage(image); | 299 | converter.setImage(image); | ||
300 | converter.setCanvasWidgetSize(QSize(100,100)); | 300 | converter.setCanvasWidgetSize(QSize(100,100)); | ||
301 | converter.setDocumentOffset(QPoint(100,100)); | 301 | converter.setDocumentOffset(QPoint(100,100)); | ||
302 | 302 | | |||
303 | projection.setCoordinatesConverter(&converter); | 303 | projection.setCoordinatesConverter(&converter); | ||
304 | projection.setMonitorProfile(0, | 304 | projection.setMonitorProfile(0, | ||
305 | KoColorConversionTransformation::InternalRenderingIntent, | 305 | KoColorConversionTransformation::internalRenderingIntent(), | ||
306 | KoColorConversionTransformation::InternalConversionFlags); | 306 | KoColorConversionTransformation::internalConversionFlags()); | ||
307 | projection.setImage(image); | 307 | projection.setImage(image); | ||
308 | projection.notifyCanvasSizeChanged(QSize(100,100)); | 308 | projection.notifyCanvasSizeChanged(QSize(100,100)); | ||
309 | projection.notifyZoomChanged(); | 309 | projection.notifyZoomChanged(); | ||
310 | } | 310 | } | ||
311 | 311 | | |||
312 | QImage sourceImage; | 312 | QImage sourceImage; | ||
313 | KisImageSP image; | 313 | KisImageSP image; | ||
314 | KisPaintLayerSP layer; | 314 | KisPaintLayerSP layer; | ||
▲ Show 20 Lines • Show All 161 Lines • Show Last 20 Lines |