Changeset View
Changeset View
Standalone View
Standalone View
krita/image/kis_paint_device.h
Show First 20 Lines • Show All 437 Lines • ▼ Show 20 Line(s) | 368 | public: | |||
---|---|---|---|---|---|
438 | void writePlanarBytes(QVector<quint8*> planes, qint32 x, qint32 y, qint32 w, qint32 h); | 438 | void writePlanarBytes(QVector<quint8*> planes, qint32 x, qint32 y, qint32 w, qint32 h); | ||
439 | 439 | | |||
440 | /** | 440 | /** | ||
441 | * Converts the paint device to a different colorspace | 441 | * Converts the paint device to a different colorspace | ||
442 | * | 442 | * | ||
443 | * @return a command that can be used to undo the conversion. | 443 | * @return a command that can be used to undo the conversion. | ||
444 | */ | 444 | */ | ||
445 | KUndo2Command* convertTo(const KoColorSpace * dstColorSpace, | 445 | KUndo2Command* convertTo(const KoColorSpace * dstColorSpace, | ||
446 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent, | 446 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
447 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags); | 447 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags()); | ||
448 | 448 | | |||
449 | /** | 449 | /** | ||
450 | * Changes the profile of the colorspace of this paint device to the given | 450 | * Changes the profile of the colorspace of this paint device to the given | ||
451 | * profile. If the given profile is 0, nothing happens. | 451 | * profile. If the given profile is 0, nothing happens. | ||
452 | */ | 452 | */ | ||
453 | void setProfile(const KoColorProfile * profile); | 453 | void setProfile(const KoColorProfile * profile); | ||
454 | 454 | | |||
455 | /** | 455 | /** | ||
Show All 9 Lines | |||||
465 | * @param y Top coordinate of the rectangle | 465 | * @param y Top coordinate of the rectangle | ||
466 | * @param w Width of the rectangle in pixels | 466 | * @param w Width of the rectangle in pixels | ||
467 | * @param h Height of the rectangle in pixels | 467 | * @param h Height of the rectangle in pixels | ||
468 | * @param dstProfile RGB profile to use in conversion. May be 0, in which | 468 | * @param dstProfile RGB profile to use in conversion. May be 0, in which | ||
469 | * case it's up to the color strategy to choose a profile (most | 469 | * case it's up to the color strategy to choose a profile (most | ||
470 | * like sRGB). | 470 | * like sRGB). | ||
471 | */ | 471 | */ | ||
472 | virtual QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, | 472 | virtual QImage convertToQImage(const KoColorProfile *dstProfile, qint32 x, qint32 y, qint32 w, qint32 h, | ||
473 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent, | 473 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
474 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const; | 474 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags()) const; | ||
475 | 475 | | |||
476 | /** | 476 | /** | ||
477 | * Overridden method for convenience | 477 | * Overridden method for convenience | ||
478 | */ | 478 | */ | ||
479 | QImage convertToQImage(const KoColorProfile *dstProfile, | 479 | QImage convertToQImage(const KoColorProfile *dstProfile, | ||
480 | const QRect &rc, | 480 | const QRect &rc, | ||
481 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent, | 481 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
482 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const; | 482 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags()) const; | ||
483 | 483 | | |||
484 | /** | 484 | /** | ||
485 | * Create an RGBA QImage from a rectangle in the paint device. The | 485 | * Create an RGBA QImage from a rectangle in the paint device. The | ||
486 | * rectangle is defined by the parent image's bounds. | 486 | * rectangle is defined by the parent image's bounds. | ||
487 | * | 487 | * | ||
488 | * @param dstProfile RGB profile to use in conversion. May be 0, in which | 488 | * @param dstProfile RGB profile to use in conversion. May be 0, in which | ||
489 | * case it's up to the color strategy to choose a profile (most | 489 | * case it's up to the color strategy to choose a profile (most | ||
490 | * like sRGB). | 490 | * like sRGB). | ||
491 | */ | 491 | */ | ||
492 | QImage convertToQImage(const KoColorProfile * dstProfile, | 492 | QImage convertToQImage(const KoColorProfile * dstProfile, | ||
493 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent, | 493 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
494 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags) const; | 494 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags()) const; | ||
495 | 495 | | |||
496 | /** | 496 | /** | ||
497 | * Creates a paint device thumbnail of the paint device, retaining | 497 | * Creates a paint device thumbnail of the paint device, retaining | ||
498 | * the aspect ratio. The width and height of the returned device | 498 | * the aspect ratio. The width and height of the returned device | ||
499 | * won't exceed \p maxw and \p maxw, but they may be smaller. | 499 | * won't exceed \p maxw and \p maxw, but they may be smaller. | ||
500 | * | 500 | * | ||
501 | * @param maxw: maximum width | 501 | * @param maxw: maximum width | ||
502 | * @param maxh: maximum height | 502 | * @param maxh: maximum height | ||
503 | * @param rect: only this rect will be used for the thumbnail | 503 | * @param rect: only this rect will be used for the thumbnail | ||
504 | * | 504 | * | ||
505 | */ | 505 | */ | ||
506 | KisPaintDeviceSP createThumbnailDevice(qint32 w, qint32 h, QRect rect = QRect()) const; | 506 | KisPaintDeviceSP createThumbnailDevice(qint32 w, qint32 h, QRect rect = QRect()) const; | ||
507 | 507 | | |||
508 | /** | 508 | /** | ||
509 | * Creates a thumbnail of the paint device, retaining the aspect ratio. | 509 | * Creates a thumbnail of the paint device, retaining the aspect ratio. | ||
510 | * The width and height of the returned QImage won't exceed \p maxw and \p maxw, but they may be smaller. | 510 | * The width and height of the returned QImage won't exceed \p maxw and \p maxw, but they may be smaller. | ||
511 | * The colors are not corrected for display! | 511 | * The colors are not corrected for display! | ||
512 | * | 512 | * | ||
513 | * @param maxw: maximum width | 513 | * @param maxw: maximum width | ||
514 | * @param maxh: maximum height | 514 | * @param maxh: maximum height | ||
515 | * @param rect: only this rect will be used for the thumbnail | 515 | * @param rect: only this rect will be used for the thumbnail | ||
516 | */ | 516 | */ | ||
517 | QImage createThumbnail(qint32 maxw, qint32 maxh, QRect rect, | 517 | QImage createThumbnail(qint32 maxw, qint32 maxh, QRect rect, | ||
518 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent, | 518 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
519 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags); | 519 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags()); | ||
520 | 520 | | |||
521 | /** | 521 | /** | ||
522 | * Cached version of createThumbnail(qint32 maxw, qint32 maxh, const KisSelection *selection, QRect rect) | 522 | * Cached version of createThumbnail(qint32 maxw, qint32 maxh, const KisSelection *selection, QRect rect) | ||
523 | */ | 523 | */ | ||
524 | QImage createThumbnail(qint32 maxw, qint32 maxh, | 524 | QImage createThumbnail(qint32 maxw, qint32 maxh, | ||
525 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::InternalRenderingIntent, | 525 | KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(), | ||
526 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::InternalConversionFlags); | 526 | KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags()); | ||
527 | 527 | | |||
528 | /** | 528 | /** | ||
529 | * Fill c and opacity with the values found at x and y. | 529 | * Fill c and opacity with the values found at x and y. | ||
530 | * | 530 | * | ||
531 | * The color values will be transformed from the profile of | 531 | * The color values will be transformed from the profile of | ||
532 | * this paint device to the display profile. | 532 | * this paint device to the display profile. | ||
533 | * | 533 | * | ||
534 | * @return true if the operation was successful. | 534 | * @return true if the operation was successful. | ||
▲ Show 20 Lines • Show All 252 Lines • Show Last 20 Lines |