...
 
Commits (78)
......@@ -2,23 +2,35 @@ SET(PREFIX_ext_lcms2 "${EXTPREFIX}" )
if (MINGW)
ExternalProject_Add( ext_lcms2
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/lcms2-2.9.tar.gz
URL_MD5 8de1b7724f578d2995c8fdfa35c3ad0e
URL http://files.kde.org/krita/build/dependencies/lcms2-2.10.tar.gz
URL_MD5 c5f915d681325e0767e40187799f23b1
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/lcms2-9.diff
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/lcms2-10.diff
INSTALL_DIR ${PREFIX_ext_lcms2}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_lcms2} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DBUILD_TESTS=FALSE -DBUILD_UTILS=FALSE -DBUILD_STATIC=FALSE
UPDATE_COMMAND ""
DEPENDS ext_patch
)
elseif (ANDROID)
ExternalProject_Add( ext_lcms2
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/lcms2-2.10.tar.gz
URL_MD5 c5f915d681325e0767e40187799f23b1
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/lcms2-10.diff
INSTALL_DIR ${PREFIX_ext_lcms2}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_lcms2} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DBUILD_TESTS=FALSE -DBUILD_UTILS=FALSE -DBUILD_STATIC=FALSE -DBUILD_PLUGINS=FALSE
UPDATE_COMMAND ""
)
else ()
ExternalProject_Add( ext_lcms2
DOWNLOAD_DIR ${EXTERNALS_DOWNLOAD_DIR}
URL http://files.kde.org/krita/build/dependencies/lcms2-2.9.tar.gz
URL_MD5 8de1b7724f578d2995c8fdfa35c3ad0e
URL http://files.kde.org/krita/build/dependencies/lcms2-2.10.tar.gz
URL_MD5 c5f915d681325e0767e40187799f23b1
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/lcms2-9.diff
PATCH_COMMAND ${PATCH_COMMAND} -p1 -i ${CMAKE_CURRENT_SOURCE_DIR}/lcms2-10.diff
INSTALL_DIR ${PREFIX_ext_lcms2}
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${PREFIX_ext_lcms2} -DCMAKE_BUILD_TYPE=${GLOBAL_BUILD_TYPE} ${GLOBAL_PROFILE} -DBUILD_TESTS=FALSE -DBUILD_UTILS=FALSE -DBUILD_STATIC=FALSE
......
commit e346c86dea71e995623f3a1702ff4ade847c16c7
commit 5f0c7d33243388e0fc840c5e2aba49e1c6147a21
Author: Boudewijn Rempt <boud@valdyas.org>
Date: Thu Jan 4 11:49:42 2018 +0100
Date: Tue Jun 2 12:49:24 2020 +0200
Add cmake build system to lcms 2.9
Add cmake build system
diff --git a/CMakeLists.txt b/CMakeLists.txt
new file mode 100644
index 0000000..735dd7a
index 0000000..213c808
--- /dev/null
+++ b/CMakeLists.txt
@@ -0,0 +1,22 @@
@@ -0,0 +1,25 @@
+project(lcms2)
+
+option(BUILD_TESTS "build the test executable" OFF)
+option(BUILD_STATIC "build the static library" OFF)
+option(BUILD_UTILS "build the utilities executables" OFF)
+option(BUILD_PLUGINS "build the plugins" ON)
+
+set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
+
......@@ -26,17 +27,19 @@ index 0000000..735dd7a
+)
+
+add_subdirectory(src)
+
+if(BUILD_TESTS)
+ add_subdirectory(testbed)
+endif(BUILD_TESTS)
+
+if(BUILD_UTILS)
+ add_subdirectory(utils)
+endif(BUILD_UTILS)
diff --git a/include/lcms2.h b/include/lcms2.h
index 9e7ee4c..4ee1b7b 100644
index 99e0308..3056533 100644
--- a/include/lcms2.h
+++ b/include/lcms2.h
@@ -215,15 +215,14 @@ typedef int cmsBool;
@@ -225,15 +225,14 @@ typedef int cmsBool;
#endif // CMS_USE_BIG_ENDIAN
......@@ -56,10 +59,10 @@ index 9e7ee4c..4ee1b7b 100644
# else
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
new file mode 100644
index 0000000..ac575c7
index 0000000..a8a0640
--- /dev/null
+++ b/src/CMakeLists.txt
@@ -0,0 +1,64 @@
@@ -0,0 +1,82 @@
+# some configure checks:
+if(WIN32)
+ if(MSVC)
......@@ -108,7 +111,25 @@ index 0000000..ac575c7
+ cmsalpha.c
+)
+
+include_directories(${CMAKE_BINARY_DIR})
+if (BUILD_PLUGINS)
+ set(lcms_SRCS ${lcms_SRCS}
+ ../plugins/fast_float/src/fast_16_tethra.c
+ ../plugins/fast_float/src/fast_8_curves.c
+ ../plugins/fast_float/src/fast_8_matsh.c
+ ../plugins/fast_float/src/fast_8_matsh_sse.c
+ ../plugins/fast_float/src/fast_8_tethra.c
+ ../plugins/fast_float/src/fast_float_15bits.c
+ ../plugins/fast_float/src/fast_float_15mats.c
+ ../plugins/fast_float/src/fast_float_cmyk.c
+ ../plugins/fast_float/src/fast_float_curves.c
+ ../plugins/fast_float/src/fast_float_matsh.c
+ ../plugins/fast_float/src/fast_float_separate.c
+ ../plugins/fast_float/src/fast_float_sup.c
+ ../plugins/fast_float/src/fast_float_tethra.c
+ )
+endif()
+
+include_directories(${CMAKE_BINARY_DIR} ../plugins/fast_float/include)
+
+add_library(lcms SHARED ${lcms_SRCS})
+set_target_properties(lcms PROPERTIES OUTPUT_NAME "lcms2"
......@@ -135,21 +156,8 @@ index 0000000..ca9008b
+add_executable(testcms testcms2.c testplugin.c zoo_icc.c)
+target_link_libraries(testcms lcms_static)
+set_target_properties(testcms PROPERTIES COMPILE_FLAGS -DCMS_STATIC)
diff --git a/testbed/testcms2.c b/testbed/testcms2.c
index 5bd5447..ff650f2 100644
--- a/testbed/testcms2.c
+++ b/testbed/testcms2.c
@@ -28,7 +28,7 @@
#include "testcms2.h"
// On Visual Studio, use debug CRT
-#ifdef _MSC_VER
+#ifdef _WIN32
# include "crtdbg.h"
# include <io.h>
#endif
diff --git a/testbed/zoo_icc.c b/testbed/zoo_icc.c
index f68861c..fdd0b7c 100755
index a220db7..b5e253a 100755
--- a/testbed/zoo_icc.c
+++ b/testbed/zoo_icc.c
@@ -27,6 +27,11 @@
......
uniform vec4 fragColor;
uniform sampler2D texture0;
in vec4 v_textureCoordinate;
out vec4 resultFragmentColor;
void main(void)
{
resultFragmentColor = fragColor * vec4(vec3(1.0 - texture(texture0, v_textureCoordinate.xy)), 1.0);
}
......@@ -13,5 +13,6 @@
<file>simple_texture_legacy.frag</file>
<file>solid_color.frag</file>
<file>solid_color_legacy.frag</file>
<file>overlay_inverted.frag</file>
</qresource>
</RCC>
......@@ -354,6 +354,7 @@ xsi:schemaLocation="http://www.kde.org/standards/kxmlgui/1.0 http://www.kde.org
<Action name="settings_dockers_menu"/>
<Separator/>
<Action name="theme_menu"/>
<Action name="style_menu"/>
<Separator/>
<!-- `Configure Shortcuts` was moved into main configuration menu -->
<!-- <Action name="options_configure_keybinding"/> -->
......
......@@ -1608,6 +1608,16 @@
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="style_menu">
<icon></icon>
<text>&amp;Styles</text>
<whatsThis></whatsThis>
<toolTip>Styles</toolTip>
<iconText>Styles</iconText>
<shortcut></shortcut>
<isCheckable>false</isCheckable>
<statusTip></statusTip>
</Action>
<Action name="settings_active_author">
<icon>im-user</icon>
<text>Active Author Profile</text>
......
......@@ -14,7 +14,7 @@
<developer_name xml:lang="et">Krita sihtasutus</developer_name>
<developer_name xml:lang="eu">Krita Fundazioa</developer_name>
<developer_name xml:lang="fi">Krita Foundation</developer_name>
<developer_name xml:lang="fr">La Fondation Krita</developer_name>
<developer_name xml:lang="fr">La fondation Krita</developer_name>
<developer_name xml:lang="gl">Fundación Krita</developer_name>
<developer_name xml:lang="ia">Krita Foundation (Fundatiomn de Krita)</developer_name>
<developer_name xml:lang="id">Asas Krita</developer_name>
......@@ -171,7 +171,7 @@
<p xml:lang="et">Krita on üks paremaid valikuid kontseptuaalkunsti, koomiksite, tekstuuride ja digitaalmaalide loomiseks. Krita toetab paljusid värviruume, näiteks RGB ja CMYK 8 ja 16 täisarvulise bitiga kanali kohta, samuti 16 ja 32 ujukomabitiga kanali kohta.</p>
<p xml:lang="eu">Krita aukera bikaina da kontzeptuzko artea, komikiak, errendatzeko ehundurak eta «matte» margolanak sortzeko. Kritak kolore-espazio ugari onartzen ditu hala nola GBU eta CMYK, 8 eta 16 biteko osoko kanaletan, baita 16 eta 32 biteko koma-higikorreko kanaletan.</p>
<p xml:lang="fi">Krita on hyvä valinta konseptikuvituksen, sarjakuvien, pintakuvioiden ja maalausten luomiseen. Krita tukee useita väriavaruuksia kuten RGB:tä ja CMYK:ta 8 ja 16 bitin kokonaisluku- samoin kuin 16 ja 32 bitin liukulukukanavin.</p>
<p xml:lang="fr">Krita est un très bon choix pour créer des concepts arts, des bandes-dessinées, des textures de rendu et des peintures. Krita prend en charge plusieurs espaces de couleurs comme RVB et CMJN avec les canaux de 8 et 16 bits entiers ainsi que les canaux de 16 et 32 bits flottants.</p>
<p xml:lang="fr">Krita est un très bon choix pour créer des concepts arts, des bandes-dessinées, des textures de rendu et des peintures. Krita prend en charge plusieurs espaces de couleurs comme « RVB » et « CMJN » avec les canaux de 8 et 16 bits entiers ainsi que les canaux de 16 et 32 bits flottants.</p>
<p xml:lang="gl">Krita é unha gran opción para crear arte conceptual, texturas para renderización e pinturas mate. Krita permite usar moitos espazos de cores como RGB e CMYK con canles de 8 e 16 bits, así como canles de coma flotante de 16 e 32 bits.</p>
<p xml:lang="ia">Krita es un grande selection pro crear arte de concepto, comics, texturas pro rendering e picturas opac. Krita supporta multe spatios de colores como RGB e CMYK con canales de integer a 8 e 16 bits, como anque canales floating point a 16 e 32 bits.</p>
<p xml:lang="id">Krita adalah pilihan yang cocok untuk menciptakan konsep seni, komik, tekstur untuk rendering dan lukisan matte. Krita mendukung banyak ruang warna seperti RGB dan CMYK pada channel integer 8 dan 16 bit, serta channel floating point 16 dan 32 bit.</p>
......@@ -236,6 +236,7 @@
<caption xml:lang="es">Krita es un completo estudio de dibujo digital</caption>
<caption xml:lang="et">Krita on rohkete võimalustega digitaalkunstistuudio</caption>
<caption xml:lang="eu">Krita pintura-digital lantegi osoa bat da</caption>
<caption xml:lang="fr">Krita est un studio d'art numérique complet.</caption>
<caption xml:lang="it">Krita è uno studio d'arte digitale completo</caption>
<caption xml:lang="ko">Krita는 다기능 디지털 예술 스튜디오입니다</caption>
<caption xml:lang="nl">Krita is een digitale schilderstudio vol mogelijkheden</caption>
......@@ -257,6 +258,7 @@
<caption xml:lang="es">La ventana de bienvenida también le proporciona ahora las últimas noticias sobre Krita</caption>
<caption xml:lang="et">Käivitusaken jagab nüüd ka Krita värskemaid uudiseid</caption>
<caption xml:lang="eu">Abioko leihoak orain Krita-ri buruzko albiste berrienak ematen dizkizu</caption>
<caption xml:lang="fr">Maintenant, la fenêtre de démarrage vous donne aussi les dernières informations concernant Krita</caption>
<caption xml:lang="it">La finestra di avvio ora fornisce anche le ultime novità su Krita</caption>
<caption xml:lang="ko">시작 창에서 Krita의 최신 소식을 볼 수 있습니다</caption>
<caption xml:lang="nl">Het opstartvenster geeft u nu ook you het laatste nieuws over Krita</caption>
......@@ -278,6 +280,7 @@
<caption xml:lang="es">Existen unos diez inmensamente potentes motores de pinceles</caption>
<caption xml:lang="et">Üle kümne ääretult võimeka pintslimootori</caption>
<caption xml:lang="eu">Hamarretik gora isipu motor ikaragarri ahaltsu daude</caption>
<caption xml:lang="fr">Il y a plus de 10 moteurs de brosse, tous extrêmement puissants</caption>
<caption xml:lang="it">Ci sono oltre dieci motori di pennelli incredibilmente potenti</caption>
<caption xml:lang="ko">10가지 종류의 강력한 브러시 엔진을 사용할 수 있습니다</caption>
<caption xml:lang="nl">Er zijn meer dan tien immens krachtige penseelengines</caption>
......@@ -298,6 +301,7 @@
<caption xml:lang="es">Cree y use gamas para proporcionar a sus imágenes un aspecto coherente</caption>
<caption xml:lang="et">Värviulatuse maskide loomine ja kasutamine piltidele kooskõlalise välimuse andmiseks</caption>
<caption xml:lang="eu">Sortu eta erabili gama-maskarak zure irudiei izaera koherentea emateko</caption>
<caption xml:lang="fr">Créer et utiiser les masques de Gamut pour donner à vos images une apparence cohérente</caption>
<caption xml:lang="it">Crea e utilizza maschere gamut per dare alle tue immagini un aspetto coerente</caption>
<caption xml:lang="ko">색역 마스크를 만들고 사용할 수 있습니다</caption>
<caption xml:lang="nl">Maak en gebruik gamut-maskers om uw afbeeldingen een coherent gevoel te geven</caption>
......@@ -318,6 +322,7 @@
<caption xml:lang="es">¿Trabaja con animación? Krita proporciona todo lo necesario para la animación manual tradicional</caption>
<caption xml:lang="et">Sind huvitab animatsioon? Krita pakub kõike, mida läheb tarvis traditsioonilise käsitsi loodud animatsiooni jaoks</caption>
<caption xml:lang="eu">Animaziorako? Krita-k ohiko eskuz-marraztutako animazioetarako behar duzun guztia dakar</caption>
<caption xml:lang="fr">Vous réalisez des animations ? Krita vous fournit tout ce dont vous avez besoin pour l'animation traditionnelle et dessinée à la main</caption>
<caption xml:lang="it">Per le animazioni? Krita fornisce tutto ciò che ti server per l'animazione tradizionale, disegnata a mano</caption>
<caption xml:lang="ko">애니메이션을 만들 계획이 있으신가요? Krita를 통해서 수작업 애니메이션을 작업할 수 있습니다</caption>
<caption xml:lang="nl">Naar animatie? Krita biedt alles wat u nodig hebt voor traditionele, met de hand getekende animatie</caption>
......@@ -339,6 +344,7 @@
<caption xml:lang="es">Si está empezando con el dibujo digital, dispone de un extenso y actualizado manual</caption>
<caption xml:lang="et">Kui oled digitaalkunstis alles uustulnuk, on meil välja pakkuda mahukas ajakohane käsiraamat</caption>
<caption xml:lang="eu">Pintura digitalean berria bazara, gaurkotutako eskuliburu zabal bat dago</caption>
<caption xml:lang="fr">Si vous êtes nouveau en art graphique, il y a un manuel à jour et très fourni</caption>
<caption xml:lang="it">Se sei nuovo del disegno digitale è disponibile un manuale completo e aggiornato</caption>
<caption xml:lang="ko">디지털 페인팅을 처음 시작하시거나, Krita의 기능을 더 알아 보려면 사용 설명서를 참조하십시오</caption>
<caption xml:lang="nl">Als u nieuw bent in digitaal schilderen, dan is er een uitgebreide, bijgewerkte handleiding.</caption>
......
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="../light_animation_play.png"
sodipodi:docname="dark_python.svg"
inkscape:version="1.0 (6e3e5246a0, 2020-05-07)"
id="svg6190"
height="22"
width="22"
version="1.1">
<sodipodi:namedview
inkscape:document-rotation="0"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:snap-bbox="true"
inkscape:current-layer="svg6190"
inkscape:window-maximized="1"
inkscape:window-y="34"
inkscape:window-x="72"
inkscape:cy="11.8982"
inkscape:cx="11.405336"
inkscape:zoom="60.68262"
showgrid="true"
id="namedview4440"
inkscape:window-height="2089"
inkscape:window-width="3768"
inkscape:pageshadow="2"
inkscape:pageopacity="0"
guidetolerance="10"
gridtolerance="10"
objecttolerance="10"
borderopacity="1"
bordercolor="#666666"
pagecolor="#ffffff">
<inkscape:grid
id="grid3250"
type="xygrid" />
</sodipodi:namedview>
<metadata
id="metadata6196">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:date>2015</dc:date>
<dc:creator>
<cc:Agent>
<dc:title>Timothée Giet</dc:title>
</cc:Agent>
</dc:creator>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs6194" />
<path
id="rect12"
style="fill:#373737;fill-opacity:1;stroke-width:0.476881"
d="m 10.986152,1.693434 c -2.6419309,0 -4.76881,1.0634398 -4.76881,2.384405 v 1.8800632 l 4.775026,0.018807 -0.02007,0.4855411 H 3.8329364 c -1.3209646,0 -2.3844046,2.1268795 -2.3844046,4.7688107 0,2.64193 1.06344,4.768807 2.3844046,4.768807 H 5.740476 c 0,-1.202141 0.073615,-2.11196 0.2493316,-2.814832 0.1757184,-0.702869 0.4624441,-1.207361 0.8834493,-1.544166 0.8420075,-0.673609 2.0861095,-0.648122 3.8744201,-0.648122 2.026753,0 3.295721,-0.02708 4.000898,-0.54943 0.352588,-0.261178 0.598255,-0.647959 0.764449,-1.2844437 0.166191,-0.6364857 0.241854,-1.5141935 0.241854,-2.6964645 h 0.477103 c 0,1.20214 -0.07358,2.1122133 -0.257597,2.8169592 -0.184017,0.704746 -0.489618,1.212152 -0.941767,1.547076 -0.904303,0.669857 -2.258187,0.643087 -4.28494,0.643087 -1.7883106,0 -2.9284363,0.02515 -3.576684,0.543764 -0.3241261,0.259298 -0.5590533,0.649069 -0.7186428,1.287433 -0.1595922,0.638363 -0.235011,1.516868 -0.235011,2.699139 v 2.384408 c 0,1.320962 2.1268792,2.38448 4.7688108,2.38448 2.64193,0 4.768806,-1.063518 4.768806,-2.38448 V 16.48521 L 11,16.486113 V 16 h 7.13944 c 1.320967,0 2.384407,-2.126876 2.384407,-4.768807 0,-2.6419306 -1.06344,-4.7688101 -2.384404,-4.7688101 h -2.384484 v -2.384393 c 0,-1.3209653 -2.126876,-2.384405 -4.768807,-2.384405 z M 8.356901,3.1955696 c 0.00212,-6.1e-6 0.00424,-6.1e-6 0.00635,0 0.4872707,-1.8e-5 0.8822873,0.3949981 0.8822689,0.8822694 C 9.2454991,4.5650773 8.8504954,4.9600453 8.3632542,4.9600273 7.8760462,4.9600031 7.4810895,4.5650472 7.4810655,4.077839 7.4810361,3.5930773 7.8721311,3.1990993 8.3568807,3.1955696 Z m 5.245674,14.3065094 c 0.0021,-9e-6 0.0043,-9e-6 0.0064,0 0.487208,2.4e-5 0.882165,0.394977 0.882189,0.882188 1.7e-5,0.487238 -0.394951,0.882242 -0.882189,0.882266 -0.487272,2.1e-5 -0.882287,-0.394995 -0.882266,-0.882266 9e-6,-0.484732 0.391095,-0.878662 0.875811,-0.882188 z"
sodipodi:nodetypes="sscccssscsssssccscssssssscccssscsssccccssscsscss" />
</svg>
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
version="1.1"
width="22"
height="22"
id="svg6190"
inkscape:version="1.0 (6e3e5246a0, 2020-05-07)"
sodipodi:docname="light_python.svg"
inkscape:export-filename="../light_animation_play.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90">
<sodipodi:namedview
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1"
objecttolerance="10"
gridtolerance="10"
guidetolerance="10"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:window-width="2275"
inkscape:window-height="1644"
id="namedview4440"
showgrid="true"
inkscape:zoom="60.68262"
inkscape:cx="14.741948"
inkscape:cy="11.084622"
inkscape:window-x="1178"
inkscape:window-y="101"
inkscape:window-maximized="0"
inkscape:current-layer="svg6190"
inkscape:snap-bbox="true"
inkscape:snap-bbox-edge-midpoints="true"
inkscape:document-rotation="0">
<inkscape:grid
type="xygrid"
id="grid3250" />
</sodipodi:namedview>
<metadata
id="metadata6196">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title />
<dc:date>2015</dc:date>
<dc:creator>
<cc:Agent>
<dc:title>Timothée Giet</dc:title>
</cc:Agent>
</dc:creator>
<cc:license
rdf:resource="http://creativecommons.org/licenses/by-sa/4.0/" />
</cc:Work>
<cc:License
rdf:about="http://creativecommons.org/licenses/by-sa/4.0/">
<cc:permits
rdf:resource="http://creativecommons.org/ns#Reproduction" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#Distribution" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Notice" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#Attribution" />
<cc:permits
rdf:resource="http://creativecommons.org/ns#DerivativeWorks" />
<cc:requires
rdf:resource="http://creativecommons.org/ns#ShareAlike" />
</cc:License>
</rdf:RDF>
</metadata>
<defs
id="defs6194" />
<path
sodipodi:nodetypes="sscccssscsssssccscssssssscccssscsssccccssscsscss"
d="m 10.986152,1.693434 c -2.6419309,0 -4.76881,1.0634398 -4.76881,2.384405 v 1.8800632 l 4.775026,0.018807 -0.02007,0.4855411 H 3.8329364 c -1.3209646,0 -2.3844046,2.1268795 -2.3844046,4.7688107 0,2.64193 1.06344,4.768807 2.3844046,4.768807 H 5.740476 c 0,-1.202141 0.073615,-2.11196 0.2493316,-2.814832 0.1757184,-0.702869 0.4624441,-1.207361 0.8834493,-1.544166 0.8420075,-0.673609 2.0861095,-0.648122 3.8744201,-0.648122 2.026753,0 3.295721,-0.02708 4.000898,-0.54943 0.352588,-0.261178 0.598255,-0.647959 0.764449,-1.2844437 0.166191,-0.6364857 0.241854,-1.5141935 0.241854,-2.6964645 h 0.477103 c 0,1.20214 -0.07358,2.1122133 -0.257597,2.8169592 -0.184017,0.704746 -0.489618,1.212152 -0.941767,1.547076 -0.904303,0.669857 -2.258187,0.643087 -4.28494,0.643087 -1.7883106,0 -2.9284363,0.02515 -3.576684,0.543764 -0.3241261,0.259298 -0.5590533,0.649069 -0.7186428,1.287433 -0.1595922,0.638363 -0.235011,1.516868 -0.235011,2.699139 v 2.384408 c 0,1.320962 2.1268792,2.38448 4.7688108,2.38448 2.64193,0 4.768806,-1.063518 4.768806,-2.38448 V 16.48521 L 11,16.486113 V 16 h 7.13944 c 1.320967,0 2.384407,-2.126876 2.384407,-4.768807 0,-2.6419306 -1.06344,-4.7688101 -2.384404,-4.7688101 h -2.384484 v -2.384393 c 0,-1.3209653 -2.126876,-2.384405 -4.768807,-2.384405 z M 8.356901,3.1955696 c 0.00212,-6.1e-6 0.00424,-6.1e-6 0.00635,0 0.4872707,-1.8e-5 0.8822873,0.3949981 0.8822689,0.8822694 C 9.2454991,4.5650773 8.8504954,4.9600453 8.3632542,4.9600273 7.8760462,4.9600031 7.4810895,4.5650472 7.4810655,4.077839 7.4810361,3.5930773 7.8721311,3.1990993 8.3568807,3.1955696 Z m 5.245674,14.3065094 c 0.0021,-9e-6 0.0043,-9e-6 0.0064,0 0.487208,2.4e-5 0.882165,0.394977 0.882189,0.882188 1.7e-5,0.487238 -0.394951,0.882242 -0.882189,0.882266 -0.487272,2.1e-5 -0.882287,-0.394995 -0.882266,-0.882266 9e-6,-0.484732 0.391095,-0.878662 0.875811,-0.882188 z"
style="fill:#cacaca;fill-opacity:1;stroke-width:0.476881"
id="rect12" />
<g
inkscape:label="Capa 1"
id="layer1"
transform="translate(-19.784894,-1031.1484)" />
</svg>
......@@ -155,5 +155,7 @@
<file>light_ratio.svg</file>
<file>dark_bundle_archive.svg</file>
<file>light_bundle_archive.svg</file>
<file>dark_python.svg</file>
<file>light_python.svg</file>
</qresource>
</RCC>
......@@ -264,10 +264,6 @@ qreal KoMarker::maxInset(qreal strokeWidth) const
result = qMax(KisAlgebra2D::norm(shapesBounds.bottomLeft()), result);
result = qMax(KisAlgebra2D::norm(shapesBounds.bottomRight()), result);
if (d->coordinateSystem == StrokeWidth) {
result *= strokeWidth;
}
return result;
}
......
......@@ -305,7 +305,8 @@ QRectF KoPathShape::boundingRect() const
QRectF bb = transform.map(pathStroke(pen)).boundingRect();
#endif
QRectF bb = transform.mapRect(kisGrowRect(outline().boundingRect(), outlineSweepWidth));
// add 10% extra update area around the doubled insets
QRectF bb = transform.mapRect(kisGrowRect(outline().boundingRect(), 1.1 * 0.5 * outlineSweepWidth));
if (shadow()) {
KoInsets insets;
......@@ -1327,6 +1328,9 @@ void KoPathShape::setMarker(KoMarker *marker, KoFlake::MarkerPosition pos)
} else {
d->markersNew[pos] = marker;
}
notifyChanged();
shapeChangedPriv(StrokeChanged);
}
KoMarker *KoPathShape::marker(KoFlake::MarkerPosition pos) const
......
......@@ -59,13 +59,13 @@ void KoPathShapeMarkerCommand::redo()
{
KUndo2Command::redo();
Q_FOREACH (KoPathShape *shape, m_d->shapes) {
shape->update();
const QRectF oldDirtyRect = shape->boundingRect();
shape->setMarker(m_d->marker.data(), m_d->position);
// we have no GUI for selection auto-filling yet! So just enable it!
shape->setAutoFillMarkers(true);
shape->update();
shape->updateAbsolute(oldDirtyRect | shape->boundingRect());
}
}
......@@ -75,11 +75,12 @@ void KoPathShapeMarkerCommand::undo()
auto markerIt = m_d->oldMarkers.begin();
auto autoFillIt = m_d->oldAutoFillMarkers.begin();
Q_FOREACH (KoPathShape *shape, m_d->shapes) {
shape->update();
const QRectF oldDirtyRect = shape->boundingRect();
shape->setMarker((*markerIt).data(), m_d->position);
shape->setAutoFillMarkers(*autoFillIt);
shape->update();
shape->updateAbsolute(oldDirtyRect | shape->boundingRect());
++markerIt;
++autoFillIt;
}
}
......
......@@ -29,7 +29,7 @@
<path
id="path4209"
d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.2) translate(7.4, 1)" />
</marker>
<marker
......@@ -43,7 +43,7 @@
<path
id="path4206"
d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.4) translate(7.4, 1)" />
</marker>
<marker
......@@ -57,7 +57,7 @@
<path
id="path4203"
d="M -2.5,-1.0 C -2.5,1.7600000 -4.7400000,4.0 -7.5,4.0 C -10.260000,4.0 -12.5,1.7600000 -12.5,-1.0 C -12.5,-3.7600000 -10.260000,-6.0 -7.5,-6.0 C -4.7400000,-6.0 -2.5,-3.7600000 -2.5,-1.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.8) translate(7.4, 1)" />
</marker>
<marker
......@@ -71,7 +71,7 @@
<path
id="path4157"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.2) rotate(180) translate(6,0)" />
</marker>
<marker
......@@ -85,7 +85,7 @@
<path
id="path4154"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.2) translate(6,0)" />
</marker>
<marker
......@@ -99,7 +99,7 @@
<path
id="path4151"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.4) rotate(180) translate(10,0)" />
</marker>
<marker
......@@ -113,7 +113,7 @@
<path
id="path4148"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.4) translate(10,0)" />
</marker>
<marker
......@@ -127,7 +127,7 @@
<path
id="path4145"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.8) rotate(180) translate(12.5,0)" />
</marker>
<marker
......@@ -141,7 +141,7 @@
<path
id="path4142"
d="M 0.0,0.0 L 5.0,-5.0 L -12.5,0.0 L 5.0,5.0 L 0.0,0.0 z "
style="fill-rule:evenodd;stroke:none;stroke-opacity:1;fill:#000000;fill-opacity:1"
style="fill-rule:evenodd;stroke:#000000;stroke-width:2.8;stroke-opacity:1;fill:#000000;fill-opacity:1"
transform="scale(0.8) translate(12.5,0)" />
</marker>
</defs>
......
......@@ -615,7 +615,7 @@ KoShape *KoSvgTextShapeFactory::createShape(const KoProperties *params, KoDocume
KoSvgTextShape *shape = new KoSvgTextShape();
shape->setShapeId(KoSvgTextShape_SHAPEID);
QString svgText = params->stringProperty("svgText", "<text>Lorem ipsum dolor sit amet, consectetur adipiscing elit.</text>");
QString svgText = params->stringProperty("svgText", i18nc("Default text for the text shape", "<text>Placeholder Text</text>"));
QString defs = params->stringProperty("defs" , "<defs/>");
QRectF shapeRect = QRectF(0, 0, 200, 60);
QVariant rect = params->property("shapeRect");
......
......@@ -472,8 +472,8 @@ QTransform mapToRectInverse(const QRectF &rect)
{
return
QTransform::fromTranslate(-rect.x(), -rect.y()) *
QTransform::fromScale(rect.width() > 0 ? 1.0 / rect.width() : 0.0,
rect.height() > 0 ? 1.0 / rect.height() : 0.0);
QTransform::fromScale(rect.width() != 0 ? 1.0 / rect.width() : 0.0,
rect.height() != 0 ? 1.0 / rect.height() : 0.0);
}
bool fuzzyMatrixCompare(const QTransform &t1, const QTransform &t2, qreal delta) {
......
......@@ -28,6 +28,7 @@
// HACK! please refactor out!
#include "kis_simple_stroke_strategy.h"
#include "kis_abstract_projection_plane.h"
KisNodePropertyListCommand::KisNodePropertyListCommand(KisNodeSP node, KisBaseNode::PropertyList newPropertyList)
......@@ -45,17 +46,17 @@ KisNodePropertyListCommand::KisNodePropertyListCommand(KisNodeSP node, KisBaseNo
void KisNodePropertyListCommand::redo()
{
const KisBaseNode::PropertyList propsBefore = m_node->sectionModelProperties();
const QRect oldExtent = m_node->extent();
const QRect oldExtent = m_node->projectionPlane()->tightUserVisibleBounds();
m_node->setSectionModelProperties(m_newPropertyList);
doUpdate(propsBefore, m_node->sectionModelProperties(), oldExtent | m_node->extent());
doUpdate(propsBefore, m_node->sectionModelProperties(), oldExtent | m_node->projectionPlane()->tightUserVisibleBounds());
}
void KisNodePropertyListCommand::undo()
{
const KisBaseNode::PropertyList propsBefore = m_node->sectionModelProperties();
const QRect oldExtent = m_node->extent();
const QRect oldExtent = m_node->projectionPlane()->tightUserVisibleBounds();
m_node->setSectionModelProperties(m_oldPropertyList);
doUpdate(propsBefore, m_node->sectionModelProperties(), oldExtent | m_node->extent());
doUpdate(propsBefore, m_node->sectionModelProperties(), oldExtent | m_node->projectionPlane()->tightUserVisibleBounds());
}
bool checkOnionSkinChanged(const KisBaseNode::PropertyList &oldPropertyList,
......
......@@ -401,14 +401,13 @@ QDomDocument KisAslLayerStyleSerializer::formXmlDocument() const
w.writeBoolean("enab", outerGlow->effectEnabled());
w.writeEnum("Md ", "BlnM", compositeOpToBlendMode(outerGlow->blendMode()));
if (outerGlow->fillType() == psd_fill_gradient && outerGlow->gradient()) {
KoSegmentGradient *segmentGradient = dynamic_cast<KoSegmentGradient*>(outerGlow->gradient().data());
KoStopGradient *stopGradient = dynamic_cast<KoStopGradient*>(outerGlow->gradient().data());
if (segmentGradient) {
if (segmentGradient && segmentGradient->valid()) {
w.writeSegmentGradient("Grad", segmentGradient);
} else if (stopGradient) {
} else if (stopGradient && stopGradient->valid()) {
w.writeStopGradient("Grad", stopGradient);
} else {
warnKrita << "WARNING: OG: Unknown gradient type!";
......@@ -449,14 +448,13 @@ QDomDocument KisAslLayerStyleSerializer::formXmlDocument() const
w.writeBoolean("enab", innerGlow->effectEnabled());
w.writeEnum("Md ", "BlnM", compositeOpToBlendMode(innerGlow->blendMode()));
if (innerGlow->fillType() == psd_fill_gradient && innerGlow->gradient()) {
KoSegmentGradient *segmentGradient = dynamic_cast<KoSegmentGradient*>(innerGlow->gradient().data());
KoStopGradient *stopGradient = dynamic_cast<KoStopGradient*>(innerGlow->gradient().data());
if (segmentGradient) {
if (segmentGradient && innerGlow->gradient()->valid()) {
w.writeSegmentGradient("Grad", segmentGradient);
} else if (stopGradient) {
} else if (stopGradient && innerGlow->gradient()->valid()) {
w.writeStopGradient("Grad", stopGradient);
} else {
warnKrita << "WARNING: IG: Unknown gradient type!";
......@@ -594,7 +592,7 @@ QDomDocument KisAslLayerStyleSerializer::formXmlDocument() const
KoSegmentGradient *segmentGradient = dynamic_cast<KoSegmentGradient*>(gradientOverlay->gradient().data());
KoStopGradient *stopGradient = dynamic_cast<KoStopGradient*>(gradientOverlay->gradient().data());
if (gradientOverlay->effectEnabled() && (segmentGradient || stopGradient)) {
if (gradientOverlay->effectEnabled() && ((segmentGradient && segmentGradient->valid()) || (stopGradient && stopGradient->valid()))) {
w.enterDescriptor("GrFl", "", "GrFl");
w.writeBoolean("enab", gradientOverlay->effectEnabled());
......@@ -657,13 +655,14 @@ QDomDocument KisAslLayerStyleSerializer::formXmlDocument() const
if (stroke->fillType() == psd_fill_solid_color) {
w.writeColor("Clr ", stroke->color());
} else if (stroke->fillType() == psd_fill_gradient) {
}
else if (stroke->fillType() == psd_fill_gradient) {
KoSegmentGradient *segmentGradient = dynamic_cast<KoSegmentGradient*>(stroke->gradient().data());
KoStopGradient *stopGradient = dynamic_cast<KoStopGradient*>(stroke->gradient().data());
if (segmentGradient) {
if (segmentGradient && segmentGradient->valid()) {
w.writeSegmentGradient("Grad", segmentGradient);
} else if (stopGradient) {
} else if (stopGradient && stopGradient->valid()) {
w.writeStopGradient("Grad", stopGradient);
} else {
warnKrita << "WARNING: Stroke: Unknown gradient type!";
......
......@@ -239,8 +239,10 @@ bool KisBaseNode::check(const KoProperties & properties) const
}
QImage KisBaseNode::createThumbnail(qint32 w, qint32 h)
QImage KisBaseNode::createThumbnail(qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode)
{
Q_UNUSED(aspectRatioMode);
try {
QImage image(w, h, QImage::Format_ARGB32);
image.fill(0);
......@@ -251,9 +253,10 @@ QImage KisBaseNode::createThumbnail(qint32 w, qint32 h)
}
QImage KisBaseNode::createThumbnailForFrame(qint32 w, qint32 h, int time)
QImage KisBaseNode::createThumbnailForFrame(qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode)
{
Q_UNUSED(time)
Q_UNUSED(aspectRatioMode);
return createThumbnail(w, h);
}
......
......@@ -334,7 +334,7 @@ public:
* type cannot generate a thumbnail. If the requested size is too
* big, return a null QImage.
*/
virtual QImage createThumbnail(qint32 w, qint32 h);
virtual QImage createThumbnail(qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
/**
* @return a thumbnail in requested size for the defined timestamp.
......@@ -343,7 +343,7 @@ public:
* current node type cannot generate a thumbnail. If the requested
* size is too big, return a null QImage.
*/
virtual QImage createThumbnailForFrame(qint32 w, qint32 h, int time);
virtual QImage createThumbnailForFrame(qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio);
/**
* Ask this node to re-read the pertinent settings from the krita
......
......@@ -157,3 +157,55 @@ QRect KisSelectionEmptyBounds::bounds() const
{
return QRect(0, 0, 0, 0);
}
/******************************************************************/
/* KisWrapAroundBoundsWrapper */
/******************************************************************/
struct Q_DECL_HIDDEN KisWrapAroundBoundsWrapper::Private
{
KisDefaultBoundsBaseSP base;
QRect bounds;
};
KisWrapAroundBoundsWrapper::KisWrapAroundBoundsWrapper(KisDefaultBoundsBaseSP base, QRect bounds)
: m_d(new Private())
{
m_d->base = base;
m_d->bounds = bounds;
}
KisWrapAroundBoundsWrapper::~KisWrapAroundBoundsWrapper()
{
}
QRect KisWrapAroundBoundsWrapper::bounds() const
{
return m_d->bounds;
}
bool KisWrapAroundBoundsWrapper::wrapAroundMode() const
{
return true;
}
int KisWrapAroundBoundsWrapper::currentLevelOfDetail() const
{
return m_d->base->currentLevelOfDetail();
}
int KisWrapAroundBoundsWrapper::currentTime() const
{
return m_d->base->currentTime();
}
bool KisWrapAroundBoundsWrapper::externalFrameActive() const
{
return m_d->base->externalFrameActive();
}
void *KisWrapAroundBoundsWrapper::sourceCookie() const
{
return m_d->base->sourceCookie();
}
......@@ -26,9 +26,11 @@
class KisDefaultBounds;
class KisSelectionDefaultBounds;
class KisSelectionEmptyBounds;
class KisWrapAroundBoundsWrapper;
typedef KisSharedPtr<KisDefaultBounds> KisDefaultBoundsSP;
typedef KisSharedPtr<KisSelectionDefaultBounds> KisSelectionDefaultBoundsSP;
typedef KisSharedPtr<KisSelectionEmptyBounds> KisSelectionEmptyBoundsSP;
typedef KisSharedPtr<KisWrapAroundBoundsWrapper> KisWrapAroundBoundsWrapperSP;
class KRITAIMAGE_EXPORT KisDefaultBounds : public KisDefaultBoundsBase
{
......@@ -82,4 +84,32 @@ public:
QRect bounds() const override;
};
/**
* @brief The KisWrapAroundBoundsWrapper class
* wrapper around a KisDefaultBoundsBaseSP to enable
* wraparound. Used for patterns.
*/
class KRITAIMAGE_EXPORT KisWrapAroundBoundsWrapper : public KisDefaultBoundsBase
{
public:
KisWrapAroundBoundsWrapper(KisDefaultBoundsBaseSP base, QRect bounds);
~KisWrapAroundBoundsWrapper() override;
QRect bounds() const override;
bool wrapAroundMode() const override;
int currentLevelOfDetail() const override;
int currentTime() const override;
bool externalFrameActive() const override;
void * sourceCookie() const override;
protected:
friend class KisPaintDeviceTest;
private:
Q_DISABLE_COPY(KisWrapAroundBoundsWrapper)
struct Private;
const QScopedPointer<Private> m_d;
};
#endif // KIS_DEFAULT_BOUNDS_H
......@@ -54,6 +54,7 @@
#include <KoCompositeOpRegistry.h>
#include <floodfill/kis_scanline_fill.h>
#include "kis_selection_filters.h"
#include <kis_perspectivetransform_worker.h>
KisFillPainter::KisFillPainter()
: KisPainter()
......@@ -133,6 +134,31 @@ void KisFillPainter::fillRect(qint32 x1, qint32 y1, qint32 w, qint32 h, const Ko
fillRect(x1, y1, w, h, patternLayer, QRect(offset.x(), offset.y(), pattern->width(), pattern->height()));
}
void KisFillPainter::fillRect(const QRect &rc, const KoPatternSP pattern, const QTransform transform)
{
if (!pattern) return;
if (!pattern->valid()) return;
if (!device()) return;
if (rc.width() < 1) return;
if (rc.height() < 1) return;
KisPaintDeviceSP patternLayer = new KisPaintDevice(device()->compositionSourceColorSpace(), pattern->name());
patternLayer->convertFromQImage(pattern->pattern(), 0);
fillRect(rc.x(), rc.y(), rc.width(), rc.height(), patternLayer, QRect(0, 0, pattern->width(), pattern->height()), transform);
}
void KisFillPainter::fillRect(qint32 x1, qint32 y1, qint32 w, qint32 h, const KisPaintDeviceSP device, const QRect& deviceRect, const QTransform transform)
{
KisPaintDeviceSP wrapped = device;
wrapped->setDefaultBounds(new KisWrapAroundBoundsWrapper(wrapped->defaultBounds(), deviceRect));
KisPerspectiveTransformWorker worker = KisPerspectiveTransformWorker(this->device(), transform, this->progressUpdater());
worker.runPartialDst(device, this->device(), QRect(x1, y1, w, h));
addDirtyRect(QRect(x1, y1, w, h));
}
void KisFillPainter::fillRect(qint32 x1, qint32 y1, qint32 w, qint32 h, const KisPaintDeviceSP device, const QRect& deviceRect)
{
const QRect &patternRect = deviceRect;
......@@ -225,7 +251,7 @@ void KisFillPainter::fillColor(int startX, int startY, KisPaintDeviceSP sourceDe
}
}
void KisFillPainter::fillPattern(int startX, int startY, KisPaintDeviceSP sourceDevice)
void KisFillPainter::fillPattern(int startX, int startY, KisPaintDeviceSP sourceDevice, QTransform patternTransform)
{
genericFillStart(startX, startY, sourceDevice);
......@@ -233,7 +259,7 @@ void KisFillPainter::fillPattern(int startX, int startY, KisPaintDeviceSP source
KisPaintDeviceSP filled = device()->createCompositionSourceDevice();
Q_CHECK_PTR(filled);
KisFillPainter painter(filled);
painter.fillRect(0, 0, m_width, m_height, pattern());
painter.fillRect(QRect(0, 0, m_width, m_height), pattern(), patternTransform);
painter.end();
genericFillEnd(filled);
......
......@@ -108,6 +108,8 @@ public:
/**
* Fill a rectangle with a certain pattern. The pattern is repeated if it does not fit the
* entire rectangle.
*
* This one uses blitting and thus makes use of proper composition.
*/
void fillRect(qint32 x1, qint32 y1, qint32 w, qint32 h, const KisPaintDeviceSP device, const QRect& deviceRect);
......@@ -116,6 +118,24 @@ public:
*/
void fillRect(const QRect& rc, const KoPatternSP pattern, const QPoint &offset = QPoint());
/**
* @brief fillRect
* Fill a rectangle with a certain pattern. The pattern is repeated if it does not fit the
* entire rectangle. Differs from other functions that it uses a transform, does not support
* composite ops in turn.
* @param rc rectangle to fill.
* @param pattern pattern to use.
* @param transform transformation to apply to the pattern.
*/
void fillRect(const QRect& rc, const KoPatternSP pattern, const QTransform transform);
/**
* Fill a rectangle with a certain pattern. The pattern is repeated if it does not fit the
* entire rectangle.
*
* This one supports transforms, but does not use blitting.
*/
void fillRect(qint32 x1, qint32 y1, qint32 w, qint32 h, const KisPaintDeviceSP device, const QRect& deviceRect, const QTransform transform);
/**
* Fill the specified area with the output of the generator plugin that is configured
* in the generator parameter
......@@ -145,8 +165,9 @@ public:
* @param startY the Y position where the floodfill starts
* @param sourceDevice the sourceDevice that determines the area that
* is floodfilled if sampleMerged is on
* @param patternTransform transform applied to the pattern;
*/
void fillPattern(int startX, int startY, KisPaintDeviceSP sourceDevice);
void fillPattern(int startX, int startY, KisPaintDeviceSP sourceDevice, QTransform patternTransform = QTransform());
/**
* Returns a selection mask for the floodfill starting at the specified position.
......
......@@ -1402,7 +1402,6 @@ void KisImage::setResolution(double xres, double yres)
{
m_d->xres = xres;
m_d->yres = yres;
m_d->signalRouter.emitNotification(ResolutionChangedSignal);
}
QPointF KisImage::documentToPixel(const QPointF &documentCoord) const
......
......@@ -141,8 +141,8 @@ void KisIndirectPaintingSupport::mergeToLayer(KisNodeSP layer, KisPostExecutionU
void KisIndirectPaintingSupport::mergeToLayerImpl(KisPaintDeviceSP dst, KisPostExecutionUndoAdapter *undoAdapter, const KUndo2MagicString &transactionText, int timedID, bool cleanResources)
{
/**
* We do not apply selection here, because it has already
* been taken into account in a tool code
* Brushes don't apply the selection, we apply that during the indirect
* painting merge operation. It is cheaper calculation-wise.
*/
KisPainter gc(dst);
setupTemporaryPainter(&gc);
......@@ -176,4 +176,7 @@ void KisIndirectPaintingSupport::releaseResources()
{
d->temporaryTarget = 0;
d->selection = 0;
d->compositeOp = COMPOSITE_OVER;
d->compositeOpacity = OPACITY_OPAQUE_U8;
d->channelFlags.clear();
}
......@@ -896,7 +896,7 @@ QRect KisLayer::needRectForOriginal(const QRect &rect) const
return needRect;
}
QImage KisLayer::createThumbnail(qint32 w, qint32 h)
QImage KisLayer::createThumbnail(qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode)
{
if (w == 0 || h == 0) {
return QImage();
......@@ -905,12 +905,12 @@ QImage KisLayer::createThumbnail(qint32 w, qint32 h)
KisPaintDeviceSP originalDevice = original();
return originalDevice ?
originalDevice->createThumbnail(w, h, 1,
originalDevice->createThumbnail(w, h, aspectRatioMode, 1,
KoColorConversionTransformation::internalRenderingIntent(),
KoColorConversionTransformation::internalConversionFlags()) : QImage();
}
QImage KisLayer::createThumbnailForFrame(qint32 w, qint32 h, int time)
QImage KisLayer::createThumbnailForFrame(qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode)
{
if (w == 0 || h == 0) {
return QImage();
......@@ -924,7 +924,7 @@ QImage KisLayer::createThumbnailForFrame(qint32 w, qint32 h, int time)
KisPaintDeviceSP targetDevice = new KisPaintDevice(colorSpace());
KisKeyframeSP keyframe = channel->activeKeyframeAt(time);
channel->fetchFrame(keyframe, targetDevice);
return targetDevice->createThumbnail(w, h, 1,
return targetDevice->createThumbnail(w, h, aspectRatioMode, 1,
KoColorConversionTransformation::internalRenderingIntent(),
KoColorConversionTransformation::internalConversionFlags());
}
......
......@@ -246,9 +246,9 @@ public:
*/
QRect exactBounds() const override;
QImage createThumbnail(qint32 w, qint32 h) override;
QImage createThumbnail(qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio) override;
QImage createThumbnailForFrame(qint32 w, qint32 h, int time) override;
QImage createThumbnailForFrame(qint32 w, qint32 h, int time, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio) override;
/**
* Return a tight rectange, where the contents of the layer
......
......@@ -180,9 +180,6 @@ void KisMask::Private::initSelectionImpl(KisSelectionSP copyFrom, KisLayerSP par
*/
selection = new KisSelection(*copyFrom);
selection->setDefaultBounds(new KisSelectionDefaultBounds(parentPaintDevice));
if (copyFrom->hasShapeSelection()) {
delete selection->flatten();
}
} else if (copyFromDevice) {
KritaUtils::DeviceCopyMode copyMode =
q->inherits("KisFilterMask") || q->inherits("KisTransparencyMask") ?
......@@ -464,13 +461,13 @@ QRect KisMask::nonDependentExtent() const
return QRect();
}
QImage KisMask::createThumbnail(qint32 w, qint32 h)
QImage KisMask::createThumbnail(qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode)
{
KisPaintDeviceSP originalDevice =
selection() ? selection()->projection() : 0;
return originalDevice ?
originalDevice->createThumbnail(w, h, 1,
originalDevice->createThumbnail(w, h, aspectRatioMode, 1,
KoColorConversionTransformation::internalRenderingIntent(),
KoColorConversionTransformation::internalConversionFlags()) : QImage();
}
......
......@@ -187,7 +187,7 @@ public:
QRect needRect(const QRect &rect, PositionToFilthy pos = N_FILTHY) const override;
QRect changeRect(const QRect &rect, PositionToFilthy pos = N_FILTHY) const override;
QImage createThumbnail(qint32 w, qint32 h) override;
QImage createThumbnail(qint32 w, qint32 h, Qt::AspectRatioMode aspectRatioMode = Qt::IgnoreAspectRatio) override;
void testingInitSelection(const QRect &rect, KisLayerSP parentLayer);
......
......@@ -1785,6 +1785,17 @@ QImage KisPaintDevice::createThumbnail(qint32 w, qint32 h, qreal oversample, KoC
return m_d->cache()->createThumbnail(size.width(), size.height(), oversample, renderingIntent, conversionFlags);
}
QImage KisPaintDevice::createThumbnail(qint32 maxw, qint32 maxh,
Qt::AspectRatioMode aspectRatioMode,
qreal oversample, KoColorConversionTransformation::Intent renderingIntent,
KoColorConversionTransformation::ConversionFlags conversionFlags)
{
const QRect deviceExtent = extent();
const QSize thumbnailSize = deviceExtent.size().scaled(maxw, maxh, aspectRatioMode);
return createThumbnail(thumbnailSize.width(), thumbnailSize.height(),
oversample, renderingIntent, conversionFlags);
}
KisHLineIteratorSP KisPaintDevice::createHLineIteratorNG(qint32 x, qint32 y, qint32 w)
{
m_d->cache()->invalidate();
......
......@@ -580,6 +580,16 @@ public:
KoColorConversionTransformation::Intent renderingIntent = KoColorConversionTransformation::internalRenderingIntent(),
KoColorConversionTransformation::ConversionFlags conversionFlags = KoColorConversionTransformation::internalConversionFlags());
/**
* Cached version of createThumbnail that also adjusts aspect ratio of the
* thumbnail to fit the extents of the paint device.
*/
QImage createThumbnail(qint32 maxw, qint32 maxh,
Qt::AspectRatioMode aspectRatioMode,
qreal oversample = 1,