Guide to ResourceImage scaling and filtering 02/39502/9
authorAndrew Cox <andrew.cox@partner.samsung.com>
Tue, 12 May 2015 11:13:53 +0000 (12:13 +0100)
committerAndrew Cox <andrew.cox@partner.samsung.com>
Thu, 28 May 2015 16:38:54 +0000 (17:38 +0100)
Change-Id: Iebfb162b73d201477497353317d0868b2a67e460
Signed-off-by: Andrew Cox <andrew.cox@partner.samsung.com>
28 files changed:
build/tizen/docs/dali_doxygen.css
docs/content/figures/image-scaling/cards.jpg [new file with mode: 0644]
docs/content/figures/image-scaling/concept-rectangles.svg [new file with mode: 0644]
docs/content/figures/image-scaling/dog.jpg [new file with mode: 0644]
docs/content/figures/image-scaling/door.jpg [new file with mode: 0644]
docs/content/figures/image-scaling/example-fitting-mode-options.svg [new file with mode: 0644]
docs/content/figures/image-scaling/example-scale-to-fill-problem.svg [new file with mode: 0644]
docs/content/figures/image-scaling/example-scale-to-fill-sequence.svg [new file with mode: 0644]
docs/content/figures/image-scaling/gallery-large-12.jpg [new file with mode: 0644]
docs/content/figures/image-scaling/liberty.jpg [new file with mode: 0644]
docs/content/figures/image-scaling/phone-transparent-screen.png [new file with mode: 0644]
docs/content/figures/image-scaling/phone.png [new file with mode: 0644]
docs/content/images/image-scaling/concept-rectangles.jpg [new file with mode: 0644]
docs/content/images/image-scaling/demo-fitting-sampling.jpg [new file with mode: 0644]
docs/content/images/image-scaling/demo-sampling-modes.jpg [new file with mode: 0644]
docs/content/images/image-scaling/example-scale-to-fill-problem.jpg [new file with mode: 0644]
docs/content/images/image-scaling/example-scale-to-fill-sequence.jpg [new file with mode: 0644]
docs/content/images/image-scaling/fitting-mode-options.jpg [new file with mode: 0644]
docs/content/images/image-scaling/sampling_modes_box.png [new file with mode: 0644]
docs/content/images/image-scaling/sampling_modes_box_then_linear.png [new file with mode: 0644]
docs/content/images/image-scaling/sampling_modes_box_then_nearest.png [new file with mode: 0644]
docs/content/images/image-scaling/sampling_modes_linear.png [new file with mode: 0644]
docs/content/images/image-scaling/sampling_modes_nearest.png [new file with mode: 0644]
docs/content/images/image-scaling/sampling_modes_no_filter.png [new file with mode: 0644]
docs/content/main.md
docs/content/programming-guide/image-actor.h
docs/content/shared-javascript-and-cpp-documentation/resource-image-scaling.md [new file with mode: 0644]
docs/content/shared-javascript-and-cpp-documentation/texture-compression.md

index 9bc0ef4..4b68ddf 100644 (file)
@@ -3,3 +3,7 @@
    text-align: left;
    margin-left: 50px;
 }
+
+div.image img {
+  max-width: 50em;
+}
diff --git a/docs/content/figures/image-scaling/cards.jpg b/docs/content/figures/image-scaling/cards.jpg
new file mode 100644 (file)
index 0000000..9af5d02
Binary files /dev/null and b/docs/content/figures/image-scaling/cards.jpg differ
diff --git a/docs/content/figures/image-scaling/concept-rectangles.svg b/docs/content/figures/image-scaling/concept-rectangles.svg
new file mode 100644 (file)
index 0000000..0b4cebc
--- /dev/null
@@ -0,0 +1,909 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+   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:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1052.3622"
+   height="744.09448"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="concept-rectangles.svg"
+   inkscape:export-filename="/tmp/page.png"
+   inkscape:export-xdpi="89.269394"
+   inkscape:export-ydpi="89.269394">
+  <defs
+     id="defs4">
+    <marker
+       inkscape:stockid="DotL"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="DotL"
+       style="overflow:visible">
+      <path
+         id="path4335"
+         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:#000000;stroke-width:1.0pt"
+         transform="scale(0.8) translate(7.4, 1)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow2Mend"
+       style="overflow:visible;">
+      <path
+         id="path4301"
+         style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+         d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+         transform="scale(0.6) rotate(180) translate(0,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow2Lend"
+       style="overflow:visible;">
+      <path
+         id="path4295"
+         style="fill-rule:evenodd;stroke-width:0.62500000;stroke-linejoin:round;"
+         d="M 8.7185878,4.0337352 L -2.2072895,0.016013256 L 8.7185884,-4.0017078 C 6.9730900,-1.6296469 6.9831476,1.6157441 8.7185878,4.0337352 z "
+         transform="scale(1.1) rotate(180) translate(1,0)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow1Lend"
+       orient="auto"
+       refY="0.0"
+       refX="0.0"
+       id="Arrow1Lend"
+       style="overflow:visible;">
+      <path
+         id="path4277"
+         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:#000000;stroke-width:1.0pt;"
+         transform="scale(0.8) rotate(180) translate(12.5,0)" />
+    </marker>
+    <linearGradient
+       id="linearGradient5404"
+       osb:paint="gradient">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop5406" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop5408" />
+    </linearGradient>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-0"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path4301-1"
+         style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-1"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path4301-7"
+         style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-2"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path4301-75"
+         style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-08"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path4301-71"
+         style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)" />
+    </marker>
+    <marker
+       inkscape:stockid="Arrow2Mend"
+       orient="auto"
+       refY="0"
+       refX="0"
+       id="Arrow2Mend-5"
+       style="overflow:visible">
+      <path
+         inkscape:connector-curvature="0"
+         id="path4301-6"
+         style="fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
+         d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
+         transform="scale(-0.6,-0.6)" />
+    </marker>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.45254834"
+     inkscape:cx="743.41974"
+     inkscape:cy="837.71772"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1920"
+     inkscape:window-height="1158"
+     inkscape:window-x="1200"
+     inkscape:window-y="418"
+     inkscape:window-maximized="1"
+     objecttolerance="4"
+     gridtolerance="4">
+    <inkscape:grid
+       type="xygrid"
+       id="grid3181"
+       empspacing="4"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true"
+       spacingx="32px"
+       spacingy="32px" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <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:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-308.2677)">
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/image-scaling/cards.jpg"
+       xlink:href="cards.jpg"
+       y="-387.63782"
+       x="160"
+       id="image4157"
+       height="256"
+       width="256"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30"
+       width="128"
+       height="192.00003"
+       x="128"
+       y="636.36212"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-3"
+       width="1.0498172e-05"
+       height="192"
+       x="191.99998"
+       y="188.36218"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.63730645;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-0"
+       width="96.000015"
+       height="1.7800441e-05"
+       x="143.99998"
+       y="508.36218"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-31"
+       width="192"
+       height="192"
+       x="512"
+       y="188.36212"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.14999795;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-34"
+       width="95.999939"
+       height="95.999954"
+       x="560"
+       y="460.36221"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-4"
+       width="128"
+       height="192.00003"
+       x="544"
+       y="636.36212"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.27617979;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 224,284.36215 c 256,0 256,0 256,0"
+       id="path4268"
+       inkscape:connector-curvature="0"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 288,732.36221 c 224,0 224,0 224,0"
+       id="path4268-0"
+       inkscape:connector-curvature="0"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 280.67645,508.36215 c 224,0 247.40075,3e-5 247.40075,3e-5"
+       id="path4268-4"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-mid:none;marker-end:none"
+       d="m 352,-99.6378 c 0,159.99998 0,383.99998 0,383.99998"
+       id="path5307"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-mid:url(#DotL)"
+       d="m 320,-99.6378 0,607.99998"
+       id="path5879"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 688.3995,508.36218 c 224,0 239.6005,0 239.6005,0"
+       id="path4268-4-4"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 704,732.36218 96,0 0,-224"
+       id="path6099"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ccc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 736,284.36218 64,0 0,224 0,0 0,0"
+       id="path6101"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ccccc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-4-1"
+       width="96"
+       height="96"
+       x="960"
+       y="460.32184"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-31-3"
+       width="256"
+       height="256"
+       x="160"
+       y="-387.63782"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 864,508.36218 c 0,-511.9999802 0,-735.99998 0,-735.99998 l -416,0"
+       id="path6157"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ccc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/image-scaling/cards.jpg"
+       xlink:href="cards.jpg"
+       y="636.36243"
+       x="1423.9999"
+       id="image4157-4-5"
+       height="96.000244"
+       width="96.000244"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 1088,508.36218 c 72.8302,0 192,0 192,0"
+       id="path4268-4-4-9"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot6201"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(128,1044.2677)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion6203"><rect
+           id="rect6205"
+           width="132.37465"
+           height="33.093662"
+           x="1085.7874"
+           y="-436.24619" /></flowRegion><flowPara
+         id="flowPara6207" /></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot6415"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(128,1044.2677)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion6417"><rect
+           id="rect6419"
+           width="129.22287"
+           height="96.129211"
+           x="-3.1517775"
+           y="-119.49255" /></flowRegion><flowPara
+         id="flowPara6421" /></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot6423"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(128,1044.2677)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion6425"><rect
+           id="rect6427"
+           width="129.22287"
+           height="111.8881"
+           x="0"
+           y="-117.91666" /></flowRegion><flowPara
+         id="flowPara6429"
+         style="font-weight:normal">Requested Size</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot6431"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(-44.87499,5.9402098)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion6433"><rect
+           id="rect6435"
+           width="168.25861"
+           height="49.914528"
+           x="193.83432"
+           y="-119.49255" /></flowRegion><flowPara
+         id="flowPara6437">Raw size (e.)</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot6439"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(128,1044.2677)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion6441"><rect
+           id="rect6443"
+           width="256"
+           height="89.944725"
+           x="352"
+           y="-119.90552"
+           ry="0" /></flowRegion><flowPara
+         id="flowPara6445">Target for fitting</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot6447"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(114.89062,696.48284)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion6449"><rect
+           id="rect6451"
+           width="130.3277"
+           height="34.676437"
+           x="830.49335"
+           y="-116.34077" /></flowRegion><flowPara
+         id="flowPara6453">Fitted Size</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot6455"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(285.45703,886.12794)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion6457"><rect
+           id="rect6459"
+           width="192"
+           height="52.511868"
+           x="1090.3438"
+           y="-113.69655" /></flowRegion><flowPara
+         id="flowPara6461">Scaled Pixels</flowPara></flowRoot>    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:6.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-3-0"
+       width="1.4271966"
+       height="8.0063074e-11"
+       x="192"
+       y="-3.6378176"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-30-31-3-4"
+       width="256"
+       height="256"
+       x="480"
+       y="-131.63782"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.35555581;stroke-dasharray:4.19999981, 12.59999943;stroke-dashoffset:0"
+       id="rect6501-6"
+       width="320"
+       height="1184"
+       x="448"
+       y="-163.63782"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:4.2;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.35555581000000003;stroke-dasharray:4.2,12.6;stroke-dashoffset:0"
+       id="rect6501"
+       width="192"
+       height="1024"
+       x="96"
+       y="-35.637817"
+       ry="0"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot6521"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(128,1044.2677)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion6523"><rect
+           id="rect6525"
+           width="16.714825"
+           height="34.543972"
+           x="603.96234"
+           y="-92.761055" /></flowRegion><flowPara
+         id="flowPara6527" /></flowRoot>    <path
+       style="fill:none;stroke:#000000;stroke-width:4.27617979;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-end:url(#Arrow2Mend)"
+       d="m 224,-3.6378202 c 192,0 199.26801,0 199.26801,0"
+       id="path4268-1"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-mid:none;marker-end:none"
+       d="m 384,-99.63782 c 0,95.9999998 0,95.9999998 0,95.9999998"
+       id="path5307-3"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="cc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 800,284.36218 c 0,-287.9999802 0,-287.9999802 0,-287.9999802 l -32,0"
+       id="path6571"
+       inkscape:connector-curvature="0"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker-mid:none;marker-end:none"
+       d="m 448,-291.6378 c 832,0 736,-2e-5 736,-2e-5 l 0,800"
+       id="path6573"
+       inkscape:connector-curvature="0"
+       sodipodi:nodetypes="ccc"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/image-scaling/cards.jpg"
+       xlink:href="cards.jpg"
+       y="444.36243"
+       x="1407.9999"
+       id="image4157-0"
+       height="128.00024"
+       width="128.00024"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/image-scaling/cards.jpg"
+       xlink:href="cards.jpg"
+       y="124.36218"
+       x="1344"
+       id="image4157-4"
+       height="256"
+       width="256"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot7007"
+       style="fill:black;stroke:none;stroke-opacity:1;stroke-width:1px;stroke-linejoin:miter;stroke-linecap:butt;fill-opacity:1;font-family:Sans;font-style:normal;font-weight:normal;font-size:24px;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;text-align:center"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion7009"><rect
+           id="rect7011"
+           width="14.182999"
+           height="64.611435"
+           x="1279.6217"
+           y="594.38507" /></flowRegion><flowPara
+         id="flowPara7013" /></flowRoot>    <rect
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.35555581;stroke-dasharray:4.2, 12.6;stroke-dashoffset:0"
+       id="rect6501-6-0"
+       width="320"
+       height="736.00024"
+       x="1312"
+       y="92.362183"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot7035"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(-34.212099,300.28395)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion7037"><rect
+           id="rect7039"
+           width="128.02527"
+           height="133.95055"
+           x="1151.9747"
+           y="361.1535" /></flowRegion><flowPara
+         id="flowPara7041">SamplingMode</flowPara></flowRoot>    <path
+       style="fill:none;stroke:#000000;stroke-width:4.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       d="m 1184,328.09448 c 0,-128 0,-128 0,-128"
+       id="path7439"
+       inkscape:connector-curvature="0"
+       transform="translate(0,308.2677)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot7035-9"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(-351.98437,301.85984)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion7037-2"><rect
+           id="rect7039-7"
+           width="128.02527"
+           height="133.95055"
+           x="1151.9747"
+           y="361.1535" /></flowRegion><flowPara
+         id="flowPara7041-2">Fitting Mode</flowPara></flowRoot>    <path
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       d="m 864,636.36218 c 0,-128 0,-128 0,-128"
+       id="path7439-2"
+       inkscape:connector-curvature="0"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.35555576;stroke-dasharray:none;stroke-dashoffset:0"
+       id="rect7524"
+       width="88.249771"
+       height="73.972183"
+       x="821.03802"
+       y="350.12228"
+       transform="translate(0,308.2677)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"
+       ry="20.057787" />
+    <rect
+       style="fill:none;stroke:#000000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:0.3555557;stroke-dasharray:none;stroke-dashoffset:0"
+       id="rect7526"
+       width="128"
+       height="77.123962"
+       x="1120"
+       y="346.97052"
+       transform="translate(0,308.2677)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"
+       ry="23.400755" />
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="1482.6659"
+       y="403.63452"
+       id="text7530"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532"
+         x="1482.6659"
+         y="403.63452">k.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="1472"
+       y="604.36218"
+       id="text7534"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7536"
+         x="1472"
+         y="604.36218">l.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="1472"
+       y="753.48798"
+       id="text7538"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7540"
+         x="1472"
+         y="753.48798">m.</tspan></text>
+    <path
+       sodipodi:type="arc"
+       style="fill:#000000;fill-opacity:1;stroke:none"
+       id="path7542"
+       sodipodi:cx="1424"
+       sodipodi:cy="-327.90552"
+       sodipodi:rx="16"
+       sodipodi:ry="16"
+       d="m 1440,-327.90552 c 0,8.83656 -7.1634,16 -16,16 -8.8366,0 -16,-7.16344 -16,-16 0,-8.83655 7.1634,-16 16,-16 8.8366,0 16,7.16345 16,16 z"
+       transform="matrix(0.5,0,0,0.5,472,672.43994)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#000000;fill-opacity:1;stroke:none"
+       id="path7542-2"
+       sodipodi:cx="1424"
+       sodipodi:cy="-327.90552"
+       sodipodi:rx="16"
+       sodipodi:ry="16"
+       d="m 1440,-327.90552 c 0,8.83656 -7.1634,16 -16,16 -8.8366,0 -16,-7.16344 -16,-16 0,-8.83655 7.1634,-16 16,-16 8.8366,0 16,7.16345 16,16 z"
+       transform="matrix(0.5,0,0,0.5,152,672.43994)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       sodipodi:type="arc"
+       style="fill:#000000;fill-opacity:1;stroke:none"
+       id="path7542-1"
+       sodipodi:cx="1424"
+       sodipodi:cy="-327.90552"
+       sodipodi:rx="16"
+       sodipodi:ry="16"
+       d="m 1440,-327.90552 c 0,8.83656 -7.1634,16 -16,16 -8.8366,0 -16,-7.16344 -16,-16 0,-8.83655 7.1634,-16 16,-16 8.8366,0 16,7.16345 16,16 z"
+       transform="matrix(0.5,0,0,0.5,88,672.51025)"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="192"
+       y="34.160557"
+       id="text7530-8"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7"
+         x="192"
+         y="34.160557">a.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="192"
+       y="414.78287"
+       id="text7530-8-1"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7-2"
+         x="192"
+         y="414.78287">b.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="192"
+       y="546.16058"
+       id="text7530-8-6"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7-9"
+         x="192"
+         y="546.16058">c.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="192"
+       y="866.16058"
+       id="text7530-8-7"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7-4"
+         x="192"
+         y="866.16058">d.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="608"
+       y="162.16058"
+       id="text7530-8-3"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7-6"
+         x="608"
+         y="162.16058">f.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="608"
+       y="418.16058"
+       id="text7530-8-33"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7-48"
+         x="608"
+         y="418.16058">g.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="608"
+       y="596.53143"
+       id="text7530-8-0"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7-0"
+         x="608"
+         y="596.53143">h.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="608"
+       y="866.16058"
+       id="text7530-8-68"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7-66"
+         x="608"
+         y="866.16058">i.</tspan></text>
+    <text
+       xml:space="preserve"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       x="1003.7878"
+       y="632.43921"
+       id="text7530-8-2"
+       sodipodi:linespacing="125%"
+       inkscape:export-filename="/tmp/concept-rectangles.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><tspan
+         sodipodi:role="line"
+         id="tspan7532-7-68"
+         x="1003.7878"
+         y="632.43921">j.</tspan></text>
+  </g>
+</svg>
diff --git a/docs/content/figures/image-scaling/dog.jpg b/docs/content/figures/image-scaling/dog.jpg
new file mode 100644 (file)
index 0000000..f7d2cc4
Binary files /dev/null and b/docs/content/figures/image-scaling/dog.jpg differ
diff --git a/docs/content/figures/image-scaling/door.jpg b/docs/content/figures/image-scaling/door.jpg
new file mode 100644 (file)
index 0000000..7317ea5
Binary files /dev/null and b/docs/content/figures/image-scaling/door.jpg differ
diff --git a/docs/content/figures/image-scaling/example-fitting-mode-options.svg b/docs/content/figures/image-scaling/example-fitting-mode-options.svg
new file mode 100644 (file)
index 0000000..f64443b
--- /dev/null
@@ -0,0 +1,547 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+   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:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1052.3622"
+   height="744.09448"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="example-fitting-mode-options.svg"
+   inkscape:export-filename="/tmp/1.png"
+   inkscape:export-xdpi="89.269394"
+   inkscape:export-ydpi="89.269394">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient5404"
+       osb:paint="gradient">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop5406" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop5408" />
+    </linearGradient>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="1"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.63456256"
+     inkscape:cx="704.49723"
+     inkscape:cy="501.75416"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1920"
+     inkscape:window-height="1158"
+     inkscape:window-x="1200"
+     inkscape:window-y="418"
+     inkscape:window-maximized="1"
+     objecttolerance="4"
+     gridtolerance="4">
+    <inkscape:grid
+       type="xygrid"
+       id="grid3181"
+       empspacing="4"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true"
+       spacingx="32px"
+       spacingy="32px" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <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:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-308.2677)">
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/door.jpg"
+       xlink:href="door.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="256"
+       height="256"
+       id="image6106"
+       x="32"
+       y="92.362183" />
+    <g
+       id="g6199"
+       transform="matrix(0.75,0,0,0.75,158.83024,-448.90946)"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394">
+      <image
+         sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/door.jpg"
+         xlink:href="door.jpg"
+         inkscape:export-ydpi="89.269394"
+         inkscape:export-xdpi="89.269394"
+         inkscape:export-filename="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/door-scale-to-fill2.png"
+         y="764.36218"
+         x="512"
+         id="image6106-0"
+         height="256"
+         width="256" />
+      <rect
+         y="764.36218"
+         x="719.81006"
+         height="258.6265"
+         width="51.309372"
+         id="rect6179"
+         style="fill:#ffffff;fill-opacity:1;stroke:none"
+         inkscape:export-filename="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/door-scale-to-fill.png"
+         inkscape:export-xdpi="89.269394"
+         inkscape:export-ydpi="89.269394" />
+      <rect
+         y="764.36218"
+         x="512"
+         height="259.15176"
+         width="48.189934"
+         id="rect6179-2"
+         style="fill:#ffffff;fill-opacity:1;stroke:none"
+         inkscape:export-filename="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/door-scale-to-fill.png"
+         inkscape:export-xdpi="89.269394"
+         inkscape:export-ydpi="89.269394" />
+      <rect
+         inkscape:export-ydpi="89.269394"
+         inkscape:export-xdpi="89.269394"
+         inkscape:export-filename="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/door-scale-to-fill2.png"
+         y="764.36218"
+         x="560"
+         height="256.00003"
+         width="160"
+         id="rect3183-1-9-1-6"
+         style="fill:none;stroke:#ff0000;stroke-width:4.28426027;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    </g>
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.21319532;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1"
+       width="120"
+       height="192.00003"
+       x="356"
+       y="124.36218"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/door.jpg"
+       xlink:href="door.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="120"
+       height="135.85014"
+       id="image6106-5"
+       x="804"
+       y="152.43707" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.21319532;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-4"
+       width="120"
+       height="192.00003"
+       x="804"
+       y="124.36212"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/door.jpg"
+       xlink:href="door.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="120"
+       height="135.85014"
+       id="image6106-5-3"
+       x="1030.3395"
+       y="152.43707" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.21319532;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-4-1"
+       width="120"
+       height="192.00003"
+       x="1030.3395"
+       y="124.36212"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/door.jpg"
+       xlink:href="door.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="192"
+       height="192"
+       id="image6106-4"
+       x="1218.3396"
+       y="124.36218" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.21319532;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-3"
+       width="120"
+       height="192.00003"
+       x="1254.3396"
+       y="124.36218"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/dog.jpg"
+       xlink:href="dog.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="256"
+       height="256"
+       id="image6359"
+       x="32"
+       y="412.36218" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.31857371;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-0"
+       width="128.00003"
+       height="192"
+       x="-604.36218"
+       y="320"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"
+       transform="matrix(0,-1,1,0,0,0)" />
+    <g
+       id="g6476"
+       transform="translate(-7.128906e-7,-384.82965)"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394">
+      <image
+         sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/dog.jpg"
+         xlink:href="dog.jpg"
+         y="829.19183"
+         x="544"
+         id="image6359-2"
+         height="192"
+         width="192" />
+      <rect
+         transform="translate(0,308.2677)"
+         y="520.09448"
+         x="544"
+         height="32"
+         width="192"
+         id="rect6470"
+         style="fill:#ffffff;fill-opacity:1;stroke:none" />
+      <rect
+         transform="translate(0,308.2677)"
+         y="680.09448"
+         x="541.66046"
+         height="33.94965"
+         width="196.67912"
+         id="rect6474"
+         style="fill:#ffffff;fill-opacity:1;stroke:none" />
+      <rect
+         transform="matrix(0,-1,1,0,0,0)"
+         inkscape:export-ydpi="89.269394"
+         inkscape:export-xdpi="89.269394"
+         inkscape:export-filename="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/example-scale-to-fill-sequence.png"
+         y="544"
+         x="-989.19183"
+         height="192"
+         width="128.00003"
+         id="rect3183-1-9-1-0-2"
+         style="fill:none;stroke:#ff0000;stroke-width:3.31857371;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    </g>
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/dog.jpg"
+       xlink:href="dog.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="192"
+       height="192"
+       id="image6359-2-2"
+       x="994.33954"
+       y="445.19183" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.31857371;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-0-4"
+       width="128.00003"
+       height="192"
+       x="-605.19183"
+       y="994.33954"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"
+       transform="matrix(0,-1,1,0,0,0)" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/dog.jpg"
+       xlink:href="dog.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="128"
+       height="128"
+       id="image6359-2-2-2"
+       x="1250.3396"
+       y="477.19183" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.31857371;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-0-0"
+       width="128.00003"
+       height="192"
+       x="-605.19183"
+       y="1218.3396"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"
+       transform="matrix(0,-1,1,0,0,0)" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/dog.jpg"
+       xlink:href="dog.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="128"
+       height="128"
+       id="image6359-2-2-2-1"
+       x="800"
+       y="476.36218" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:3.31857371;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9-1-0-0-6"
+       width="128.00003"
+       height="192"
+       x="-604.36218"
+       y="768"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"
+       transform="matrix(0,-1,1,0,0,0)" />
+    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3024"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(0,244.2677)"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion3026"><rect
+           id="rect3028"
+           width="256.29398"
+           height="127.03266"
+           x="33.429649"
+           y="746.32312" /></flowRegion><flowPara
+         id="flowPara3030">Raw Image</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3032"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(0,244.2677)"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion3034"><rect
+           id="rect3036"
+           width="192.25842"
+           height="96.91716"
+           x="318.32953"
+           y="744.09448" /></flowRegion><flowPara
+         id="flowPara3038">Fitting Target</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3040"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(0,244.2677)"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion3042"><rect
+           id="rect3044"
+           width="192.25842"
+           height="91.40155"
+           x="542.89368"
+           y="744.88245" /></flowRegion><flowPara
+         id="flowPara3046">SCALE_TO_FILL</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3048"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(0,244.2677)"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion3050"><rect
+           id="rect3052"
+           width="193.83432"
+           height="96.91716"
+           x="767.45782"
+           y="744.09448" /></flowRegion><flowPara
+         id="flowPara3054">SHRINK_TO_FIT</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3056"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(0,244.2677)"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion3058"><rect
+           id="rect3060"
+           width="193.83432"
+           height="126.85905"
+           x="990.44611"
+           y="745.67035" /></flowRegion><flowPara
+         id="flowPara3062">FIT_WIDTH</flowPara></flowRoot>    <flowRoot
+       xml:space="preserve"
+       id="flowRoot3064"
+       style="font-size:24px;font-style:normal;font-weight:normal;text-align:center;line-height:125%;letter-spacing:0px;word-spacing:0px;text-anchor:middle;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
+       transform="translate(0,244.2677)"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394"><flowRegion
+         id="flowRegion3066"><rect
+           id="rect3068"
+           width="193.04637"
+           height="100.06894"
+           x="1215.7982"
+           y="744.88245" /></flowRegion><flowPara
+         id="flowPara3070">FIT_HEIGHT</flowPara></flowRoot>    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/liberty.jpg"
+       xlink:href="liberty.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       width="256"
+       height="256"
+       id="image3239"
+       x="32"
+       y="700.36218" />
+    <g
+       id="g4034"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394">
+      <rect
+         y="764.36218"
+         x="352"
+         height="128"
+         width="128"
+         id="rect3244"
+         style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+         inkscape:export-filename="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/shared-javascript-and-cpp-documentation/fitting-mode-options.png"
+         inkscape:export-xdpi="89.269394"
+         inkscape:export-ydpi="89.269394" />
+    </g>
+    <g
+       transform="translate(224,-1.9531262e-7)"
+       id="g4034-5"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394">
+      <image
+         sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/liberty.jpg"
+         xlink:href="liberty.jpg"
+         y="764.36218"
+         x="352"
+         id="image3239-9-8"
+         height="128"
+         width="128" />
+      <rect
+         y="764.36218"
+         x="352"
+         height="128"
+         width="128"
+         id="rect3244-5"
+         style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    </g>
+    <g
+       transform="translate(448,-1.9531262e-7)"
+       id="g4034-4"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394">
+      <image
+         sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/liberty.jpg"
+         xlink:href="liberty.jpg"
+         y="764.36218"
+         x="352"
+         id="image3239-9-88"
+         height="128"
+         width="128" />
+      <rect
+         y="764.36218"
+         x="352"
+         height="128"
+         width="128"
+         id="rect3244-9"
+         style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    </g>
+    <g
+       transform="translate(672,-1.9531262e-7)"
+       id="g4034-3"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394">
+      <image
+         sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/liberty.jpg"
+         xlink:href="liberty.jpg"
+         y="764.36218"
+         x="352"
+         id="image3239-9-85"
+         height="128"
+         width="128" />
+      <rect
+         y="764.36218"
+         x="352"
+         height="128"
+         width="128"
+         id="rect3244-8"
+         style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    </g>
+    <g
+       transform="translate(896,-1.9531262e-7)"
+       id="g4034-2"
+       inkscape:export-filename="/tmp/fitting-mode-options.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394">
+      <image
+         sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/liberty.jpg"
+         xlink:href="liberty.jpg"
+         y="764.36218"
+         x="352"
+         id="image3239-9-7"
+         height="128"
+         width="128" />
+      <rect
+         y="764.36218"
+         x="352"
+         height="128"
+         width="128"
+         id="rect3244-95"
+         style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none" />
+    </g>
+  </g>
+</svg>
diff --git a/docs/content/figures/image-scaling/example-scale-to-fill-problem.svg b/docs/content/figures/image-scaling/example-scale-to-fill-problem.svg
new file mode 100644 (file)
index 0000000..fcdde97
--- /dev/null
@@ -0,0 +1,149 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+   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:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1052.3622"
+   height="744.09448"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="example-scale-to-fill-problem.svg"
+   inkscape:export-filename="/tmp/example-scale-to-fill-sequence.png"
+   inkscape:export-xdpi="89.269394"
+   inkscape:export-ydpi="89.269394">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient5404"
+       osb:paint="gradient">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop5406" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop5408" />
+    </linearGradient>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.94173904"
+     inkscape:cx="330.62812"
+     inkscape:cy="291.60912"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1920"
+     inkscape:window-height="1158"
+     inkscape:window-x="1200"
+     inkscape:window-y="418"
+     inkscape:window-maximized="1"
+     objecttolerance="4"
+     gridtolerance="4">
+    <inkscape:grid
+       type="xygrid"
+       id="grid3181"
+       empspacing="4"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true"
+       spacingx="32px"
+       spacingy="32px" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <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:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-308.2677)">
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/phone.png"
+       xlink:href="phone.png"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/image3087.png"
+       width="187"
+       height="348"
+       id="image3087"
+       x="736"
+       y="608.36218" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/gallery-large-12.jpg"
+       xlink:href="gallery-large-12.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/image3087.png"
+       width="512"
+       height="512"
+       id="image3178"
+       x="32"
+       y="508.36218" />
+    <rect
+       style="fill:#ffffff;fill-opacity:1;stroke-width:4.19999980999999956;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-dasharray:none;stroke:#ff0000;stroke-opacity:1"
+       id="rect3183"
+       width="154.95831"
+       height="254.03409"
+       x="753.73383"
+       y="347.32999"
+       transform="translate(0,308.2677)"
+       inkscape:export-filename="/tmp/image3087.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;fill-opacity:1;stroke:#ff0000;stroke-width:4.19999980999999956;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3957"
+       width="512"
+       height="512"
+       x="32"
+       y="200.09448"
+       transform="translate(0,308.2677)"
+       ry="0"
+       inkscape:export-filename="/tmp/image3087.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#ff0000;stroke-width:4.2;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 554.87974,200.09448 C 736,345.39199 736,346.14284 736,346.14284"
+       id="path5414"
+       inkscape:connector-curvature="0"
+       transform="translate(0,308.2677)"
+       inkscape:export-filename="/tmp/image3087.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <path
+       style="fill:none;stroke:#ff0000;stroke-width:4.20000000000000018;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;stroke-miterlimit:4;stroke-dasharray:none"
+       d="M 553.37804,712.09448 C 736,604.43598 736,604.43598 736,604.43598"
+       id="path5416"
+       inkscape:connector-curvature="0"
+       transform="translate(0,308.2677)"
+       inkscape:export-filename="/tmp/image3087.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+  </g>
+</svg>
diff --git a/docs/content/figures/image-scaling/example-scale-to-fill-sequence.svg b/docs/content/figures/image-scaling/example-scale-to-fill-sequence.svg
new file mode 100644 (file)
index 0000000..12d0eec
--- /dev/null
@@ -0,0 +1,172 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Created with Inkscape (http://www.inkscape.org/) -->
+
+<svg
+   xmlns:osb="http://www.openswatchbook.org/uri/2009/osb"
+   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:xlink="http://www.w3.org/1999/xlink"
+   xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+   xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+   width="1052.3622"
+   height="744.09448"
+   id="svg2"
+   version="1.1"
+   inkscape:version="0.48.3.1 r9886"
+   sodipodi:docname="example-scale-to-fill-sequence.svg"
+   inkscape:export-filename="/tmp/example-scale-to-fill-problem.png"
+   inkscape:export-xdpi="89.269394"
+   inkscape:export-ydpi="89.269394">
+  <defs
+     id="defs4">
+    <linearGradient
+       id="linearGradient5404"
+       osb:paint="gradient">
+      <stop
+         style="stop-color:#ffffff;stop-opacity:1;"
+         offset="0"
+         id="stop5406" />
+      <stop
+         style="stop-color:#ffffff;stop-opacity:0;"
+         offset="1"
+         id="stop5408" />
+    </linearGradient>
+  </defs>
+  <sodipodi:namedview
+     id="base"
+     pagecolor="#ffffff"
+     bordercolor="#666666"
+     borderopacity="1.0"
+     inkscape:pageopacity="0.0"
+     inkscape:pageshadow="2"
+     inkscape:zoom="0.94173902"
+     inkscape:cx="676.6218"
+     inkscape:cy="430.48889"
+     inkscape:document-units="px"
+     inkscape:current-layer="layer1"
+     showgrid="true"
+     inkscape:window-width="1920"
+     inkscape:window-height="1158"
+     inkscape:window-x="1200"
+     inkscape:window-y="418"
+     inkscape:window-maximized="1"
+     objecttolerance="4"
+     gridtolerance="4">
+    <inkscape:grid
+       type="xygrid"
+       id="grid3181"
+       empspacing="4"
+       visible="true"
+       enabled="true"
+       snapvisiblegridlinesonly="true"
+       spacingx="32px"
+       spacingy="32px" />
+  </sodipodi:namedview>
+  <metadata
+     id="metadata7">
+    <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:title>
+      </cc:Work>
+    </rdf:RDF>
+  </metadata>
+  <g
+     inkscape:label="Layer 1"
+     inkscape:groupmode="layer"
+     id="layer1"
+     transform="translate(0,-308.2677)">
+    <rect
+       style="fill:none;fill-opacity:1;stroke:#ff0000;stroke-width:4.19999980999999956;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3957"
+       width="512"
+       height="512"
+       x="32"
+       y="200.09448"
+       transform="translate(0,308.2677)"
+       ry="0"
+       inkscape:export-filename="/tmp/rect3957.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/gallery-large-12.jpg"
+       xlink:href="gallery-large-12.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/rect3957.png"
+       width="512"
+       height="512"
+       id="image3178"
+       x="32"
+       y="508.36218" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/gallery-large-12.jpg"
+       xlink:href="gallery-large-12.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/rect3957.png"
+       width="256"
+       height="256"
+       id="image3178-6"
+       x="640"
+       y="636.36218" />
+    <rect
+       style="fill:none;stroke:#ff0000;stroke-width:4.19999981;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect5513"
+       width="256"
+       height="256"
+       x="640"
+       y="636.36218"
+       inkscape:export-filename="/tmp/rect3957.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <image
+       sodipodi:absref="/home/SERILOCAL/andrew.cox/git/opendali-features/dali-toolkit/docs/content/figures/gallery-large-12.jpg"
+       xlink:href="gallery-large-12.jpg"
+       inkscape:export-ydpi="89.269394"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-filename="/tmp/rect3957.png"
+       width="256"
+       height="256"
+       id="image3178-6-5"
+       x="992"
+       y="636.36218" />
+    <rect
+       style="fill:#000000;fill-opacity:0.74666664;stroke:none"
+       id="rect5554"
+       width="50.182735"
+       height="256"
+       x="992"
+       y="328.09448"
+       transform="translate(0,308.2677)"
+       inkscape:export-filename="/tmp/rect3957.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:#000000;fill-opacity:0.74666628;stroke:none"
+       id="rect5554-1"
+       width="50.182735"
+       height="256"
+       x="1197.8173"
+       y="636.36218"
+       inkscape:export-filename="/tmp/rect3957.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+    <rect
+       style="fill:none;fill-opacity:1;stroke:#ff0000;stroke-width:4.19999980999999956;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none"
+       id="rect3183-1-9"
+       width="154.95831"
+       height="254.03409"
+       x="1043.3221"
+       y="637.48846"
+       inkscape:export-filename="/tmp/rect3957.png"
+       inkscape:export-xdpi="89.269394"
+       inkscape:export-ydpi="89.269394" />
+  </g>
+</svg>
diff --git a/docs/content/figures/image-scaling/gallery-large-12.jpg b/docs/content/figures/image-scaling/gallery-large-12.jpg
new file mode 100644 (file)
index 0000000..7173b85
Binary files /dev/null and b/docs/content/figures/image-scaling/gallery-large-12.jpg differ
diff --git a/docs/content/figures/image-scaling/liberty.jpg b/docs/content/figures/image-scaling/liberty.jpg
new file mode 100644 (file)
index 0000000..e42dba7
Binary files /dev/null and b/docs/content/figures/image-scaling/liberty.jpg differ
diff --git a/docs/content/figures/image-scaling/phone-transparent-screen.png b/docs/content/figures/image-scaling/phone-transparent-screen.png
new file mode 100644 (file)
index 0000000..e8a988b
Binary files /dev/null and b/docs/content/figures/image-scaling/phone-transparent-screen.png differ
diff --git a/docs/content/figures/image-scaling/phone.png b/docs/content/figures/image-scaling/phone.png
new file mode 100644 (file)
index 0000000..250b881
Binary files /dev/null and b/docs/content/figures/image-scaling/phone.png differ
diff --git a/docs/content/images/image-scaling/concept-rectangles.jpg b/docs/content/images/image-scaling/concept-rectangles.jpg
new file mode 100644 (file)
index 0000000..edd6eca
Binary files /dev/null and b/docs/content/images/image-scaling/concept-rectangles.jpg differ
diff --git a/docs/content/images/image-scaling/demo-fitting-sampling.jpg b/docs/content/images/image-scaling/demo-fitting-sampling.jpg
new file mode 100644 (file)
index 0000000..5d07fcd
Binary files /dev/null and b/docs/content/images/image-scaling/demo-fitting-sampling.jpg differ
diff --git a/docs/content/images/image-scaling/demo-sampling-modes.jpg b/docs/content/images/image-scaling/demo-sampling-modes.jpg
new file mode 100644 (file)
index 0000000..ffe94a8
Binary files /dev/null and b/docs/content/images/image-scaling/demo-sampling-modes.jpg differ
diff --git a/docs/content/images/image-scaling/example-scale-to-fill-problem.jpg b/docs/content/images/image-scaling/example-scale-to-fill-problem.jpg
new file mode 100644 (file)
index 0000000..33ed74f
Binary files /dev/null and b/docs/content/images/image-scaling/example-scale-to-fill-problem.jpg differ
diff --git a/docs/content/images/image-scaling/example-scale-to-fill-sequence.jpg b/docs/content/images/image-scaling/example-scale-to-fill-sequence.jpg
new file mode 100644 (file)
index 0000000..e432e76
Binary files /dev/null and b/docs/content/images/image-scaling/example-scale-to-fill-sequence.jpg differ
diff --git a/docs/content/images/image-scaling/fitting-mode-options.jpg b/docs/content/images/image-scaling/fitting-mode-options.jpg
new file mode 100644 (file)
index 0000000..3d085b8
Binary files /dev/null and b/docs/content/images/image-scaling/fitting-mode-options.jpg differ
diff --git a/docs/content/images/image-scaling/sampling_modes_box.png b/docs/content/images/image-scaling/sampling_modes_box.png
new file mode 100644 (file)
index 0000000..9e54e89
Binary files /dev/null and b/docs/content/images/image-scaling/sampling_modes_box.png differ
diff --git a/docs/content/images/image-scaling/sampling_modes_box_then_linear.png b/docs/content/images/image-scaling/sampling_modes_box_then_linear.png
new file mode 100644 (file)
index 0000000..cc32253
Binary files /dev/null and b/docs/content/images/image-scaling/sampling_modes_box_then_linear.png differ
diff --git a/docs/content/images/image-scaling/sampling_modes_box_then_nearest.png b/docs/content/images/image-scaling/sampling_modes_box_then_nearest.png
new file mode 100644 (file)
index 0000000..a1792f6
Binary files /dev/null and b/docs/content/images/image-scaling/sampling_modes_box_then_nearest.png differ
diff --git a/docs/content/images/image-scaling/sampling_modes_linear.png b/docs/content/images/image-scaling/sampling_modes_linear.png
new file mode 100644 (file)
index 0000000..a51c346
Binary files /dev/null and b/docs/content/images/image-scaling/sampling_modes_linear.png differ
diff --git a/docs/content/images/image-scaling/sampling_modes_nearest.png b/docs/content/images/image-scaling/sampling_modes_nearest.png
new file mode 100644 (file)
index 0000000..02d3391
Binary files /dev/null and b/docs/content/images/image-scaling/sampling_modes_nearest.png differ
diff --git a/docs/content/images/image-scaling/sampling_modes_no_filter.png b/docs/content/images/image-scaling/sampling_modes_no_filter.png
new file mode 100644 (file)
index 0000000..4825696
Binary files /dev/null and b/docs/content/images/image-scaling/sampling_modes_no_filter.png differ
index 92ed866..0521e17 100644 (file)
@@ -97,6 +97,7 @@
 ### Application Optimization Guide
  + [Texture Atlases](@ref textureatlases)
  + [Texture Compression](@ref texturecompression)
+ + [Rescaling Images](@ref resourceimagescaling)
  + Performance & Debugging
  + [Performance Tips](@ref performancetips)
  + [Performance Profiling](@ref performanceprofiling)
index 437e5a8..73a1ada 100644 (file)
  * <h1 class="pg">Image Actor</h1>
  *
  * <h2 class="pg">Construction</h2>
- * The Image Actor is constructed by passing a Dali::Image object
+ * The Image Actor is constructed by passing a Dali::Image object.
+ * Dali::Image is an abstract base class with multiple derived classes.
+ * Dali::ResourceImage is used for the common case of loading an image
+ * from a file.
  *
  * @code
- * Dali::Image image = Image::New(myImageFilename);
- * Dali::ImageActor myImageActor = ImageActor::New(image);
+ * Dali::Image image = ResourceImage::New( myImageFilename );
+ * Dali::ImageActor myImageActor = ImageActor::New( image );
  * @endcode
  *
  * <h3 class="pg">Resizing at Load Time</h3>
  * An application loading images from an external source will often want to
  * display those images at a lower resolution than their native ones.
- * To support this, %Dali can resize an image at load time so that its in-memory
- * copy uses less space and its visual quality benefits from being prefiltered.
+ * To support this, %Dali can resize an image at load time so that its
+ * in-memory copy uses less space and its visual quality benefits from being
+ * prefiltered.
  * There are four algorithms which can be used to fit an image to a desired
  * rectangle, a desired width or a desired height
- * (see Dali::ImageAttributes::ScalingMode).
+ * (see Dali::FittingMode).
  *
  * Here is an example doing rescaling:
  *
  * @code
- * Dali::ImageAttributes attributes;
- * attributes.SetSize( 256, 192 );
- * attributes.SetScalingMode( Dali::ImageAttributes::ScaleToFill );
- * Dali::Image image = Dali::Image::New( filename, attributes );
+ * Dali::Image image = Dali::ResourceImage::New( filename, ImageDimensions( 240, 240 ), FittingMode::SCALE_TO_FILL );
  * @endcode
  *
- * This example sets the size and scaling mode appropriately for a large thumbnail
- * on an Dali::ImageAttributes instance and passes that to Dali::Image construction.
- * In general, to enable scaling on load, set-up a Dali::ImageAttributes object with
- * a non-zero width or height and one of the four scaling modes, and pass it into a
- * Dali::Image creator function as shown above.
+ * This example sets the size and fitting mode appropriately for a large thumbnail
+ * during Dali::ResourceImage construction.
+ * In general, to enable scaling on load, pass a non-zero width or height and
+ * one of the four fitting modes to the Dali::ResourceImage creator function
+ * as shown above.
  *
- * The scaling modes and a suggested use-case for each are as follows:
+ * The fitting modes and a suggested use-case for each are as follows:
  * <ol>
- *   <li> Dali::ImageAttributes::ShrinkToFit Full-screen image display: Limit loaded image resolution to device resolution.
- *   <li> Dali::ImageAttributes::ScaleToFill Thumbnail gallery grid: Limit loaded image resolution to screen tile.
- *   <li> Dali::ImageAttributes::FitWidth Image columns: Limit loaded image resolution to column.
- *   <li> Dali::ImageAttributes::FitHeight Image rows: Limit loaded image resolution to row height.
+ *   <li> Dali::FittingMode::SHRINK_TO_FIT Full-screen image display: Limit loaded image resolution to device resolution but show all of image.
+ *   <li> Dali::FittingMode::SCALE_TO_FILL Thumbnail gallery grid: Limit loaded image resolution to screen tile, filling whole tile but losing a few pixels to match the tile shape.
+ *   <li> Dali::FittingMode::FIT_WIDTH Image columns: Limit loaded image resolution to column.
+ *   <li> Dali::FittingMode::FIT_HEIGHT Image rows: Limit loaded image resolution to row height.
  * </ol>
  *
- * The dali-demo project contains a full example under <code>examples/image</code>.
+ * The dali-demo project contains a full example under
+ * <code>examples/image-scaling-and-filtering</code>
+ * and a specific sampling mode example under
+ * <code>examples/image-scaling-irregular-grid</code>.
+ *
+ * There are more details on this topic in the
+ * \link resourceimagescaling Rescaling Images \endlink
+ * section.
  *
  * <h2 class="pg">Style</h2>
  * The Actor can render an image in two different ways.<br>
  * @endcode
  *
  */
-
diff --git a/docs/content/shared-javascript-and-cpp-documentation/resource-image-scaling.md b/docs/content/shared-javascript-and-cpp-documentation/resource-image-scaling.md
new file mode 100644 (file)
index 0000000..08519a1
--- /dev/null
@@ -0,0 +1,360 @@
+/**
+ *
+[TOC]
+
+# Resource Image Scaling {#resourceimagescaling}
+
+## Introduction
+
+While common uses of images in DALi applications involve fixed sized images
+under the developer's control, e.g. for button backgrounds, in other cases such as galleries and wallpapers an application must display a variety of images and adapt to different screen sizes and densities.
+For these situations, DALi provides a facility to scale a `ResourceImage` while it is being loaded.
+
+Look at the following example.
+Let's say we are writing a home-screen application for a smartphone.
+Here we have a large, square image that we want to set as the wallpaper on a tall and narrow phone screen.
+We want to fill the screen without distorting the image or having black borders, and wasting as few pixels from the source image as possible.
+
+![ ](../assets/img/image-scaling/example-scale-to-fill-problem.jpg)
+![ ](example-scale-to-fill-problem.jpg)
+
+DALi provides the concept of a `FittingMode` to specify how a source image is mapped into a target rectangle, and the one we need here is `FittingMode::SCALE_TO_FILL` as it will cover all of the pixels of the target.
+A second concept of a `SamplingMode` controls how source image pixels are combined during the scaling and allows the developer to trade speed for quality.
+Since our image is to be loaded once and reused, we should use `SamplingMode::BOX_THEN_LINEAR` which is the highest quality option.
+We can pass the stage dimensions to the `ResourceImage` creator function as the desired rectangle and ask it to map the image to the screen as follows:
+
+~~~{.cpp}
+// C++
+ResourceImage image = ResourceImage::New(
+  "gallery-large-12.jpg",
+  Dali::ImageDimensions( stage.GetSize().x, stage.GetSize().y ),
+  Dali::FittingMode::SCALE_TO_FILL,
+  Dali::SamplingMode::BOX_THEN_LINEAR );
+~~~
+~~~{.js}
+// JavaScript
+// First get stage dimensions into stageX and stageY ...
+var image = new dali.ResourceImage( {
+  url: "gallery-large-12.jpg",
+  width: stageX,
+  height: stageY,
+  fitting-mode: "SCALE_TO_FILL",
+  sampling-mode: "BOX_THEN_LINEAR"
+});
+~~~
+
+In this case, `SCALE_TO_FILL` will perform this sequence of operations:
+
+| SCALE_TO_FILL Example |
+| ------------ |
+| ![ ](../assets/img/image-scaling/example-scale-to-fill-sequence.jpg) ![ ](example-scale-to-fill-sequence.jpg) |
+| <sub> **1.** *The source image.* **2.** *The source scaled-down to match the screen size.* **3.** *The borders of the image are trimmed to match the shape of the screen.* **4.** *The image fits exactly on the phone screen with no scaling required while rendering.* </sub> |
+
+
+## API Details {#resourceimagescalingapidetails}
+
+The new function of `ResourceImage` has the following scaling-related parameters:
+* **path**: Identifier for the image (allows raw image width and height to be retrieved).
+* **requested dimensions**: These are either `(0,0)`, a width, a height, or a (width, height) pair and either directly, or after reading the image raw dimensions and doing some math, define a target rectangle to fit the image to.
+* **fitting mode**: one of four strategies for mapping images onto the target rectangle.
+* **sampling mode** Different quality options for the scaling.
+
+### Target dimensions for fitting {#resourceimagescalingtargetdimensions}
+
+An application has several options for specifying the target rectangle for the image to be fitted to.
+The application may request dimensions through `ResourceImage::New()`:
+
+  1. `(0, 0)`, which is equivalent to not specifying any dimensions
+  2. `(x != 0, 0)` or `(0, y != 0)`, i.e. just one dimension specified
+  3. `(x != 0, y != 0)`, i.e. both dimensions specified
+
+In **case 1.** no scaling will be attempted.
+The image will be loaded at its raw dimensions.
+In **case 2.** the unspecified dimension will be derived from the specified one and the aspect ratio of the raw dimensions.
+This specified dimension and calculated dimension pair pass on as the target dimension for fitting.
+See more on this case [below](#resourceimagescalingzerodimensions).
+In **case 3.** the requested dimensions pass straight through to become the target for fitting.
+
+The result of this process is an `(x, y)` tuple defining a box to fit the image to in the next step.
+
+#### Examples {#resourceimagescalingtargetdimensionsexamples}
+If we have a `(320, 240)` image called "flower.jpg", we use these three options in code as below.
+
+**Case 1**:
+~~~{.cpp}
+// C++
+ResourceImage image1 = ResourceImage::New( "flower.png" );
+ResourceImage image2 = ResourceImage::New( "flower.png", ImageDimensions( 0, 0 ) );
+~~~
+~~~{.js}
+// JavaScript
+var image1 = new dali.ResourceImage( { url:"flower.png" } );
+var image2 = new dali.ResourceImage( { url:"flower.png", width:0, height:0 } );
+~~~
+In these two equivalent loads, the target dimensions will be `(320, 240)` so the image will be loaded at its raw dimensions without modification.
+
+**Case 2**:
+~~~{.cpp}
+// C++
+ResourceImage image1 = ResourceImage::New( "flower.png", ImageDimensions( 160, 0 ) );
+ResourceImage image2 = ResourceImage::New( "flower.png", ImageDimensions( 0, 120 ) );
+~~~
+~~~{.js}
+// JavaScript
+var image1 = new dali.ResourceImage( { url:"flower.png", width:160, height:0 } );
+var image2 = new dali.ResourceImage( { url:"flower.png", width:0, height:120 } );
+~~~
+In these loads, the target dimensions will be `(160, 120)` as the zero dimension is derived from the aspect ratio of the raw image.
+
+**Case 3**:
+~~~{.cpp}
+// C++
+ResourceImage image = ResourceImage::New( "flower.png", ImageDimensions( 111, 233 ) );
+~~~
+~~~{.js}
+// JavaScript
+var image = new dali.ResourceImage( { url:"flower.png", width:111, height:233 } );
+~~~
+In this load, the target dimensions will be `(111, 233)`.
+
+### Image Pixel Dimensions {#resourceimagescalingsamplingmodesdimensionflow}
+
+DALi derives the pixel width and height of loaded resource images from a sequence of calculations with four inputs:
+
+  1. The dimensions requested via `ResourceImage` new function, either of which may be passed as zeros
+  2. The dimensions of the raw image before loading
+  3. The fitting mode requested
+  4. The sampling mode requested
+
+The dimensions requested do not correspond 1:1 with the exact pixel width and height of the image once loaded: they are just one of the four inputs to the process which determines those dimensions.
+
+| Flow of image dimensions from API to loaded image |
+| ------------ |
+| ![ ](../assets/img/image-scaling/concept-rectangles.jpg) ![ ](concept-rectangles.jpg) |
+| <sub> *Image dimensions requested through the API are either absent (**a.**), a height (**b.**), a width (**c.**) or a full (width, height) pair (**d.**). In case **d.** this is the target for fitting (**i.**). In cases **a.**, **b.**, and **c.**, the raw image dimensions (**e.**) are also needed to define the target (examples: **f.**, **g.**, **h.**). This target, the **FittingMode**, and the raw size (**e.**), are used to derive the fitted size (**j.**). This is the size that a perfect scaling would achieve. This fitted size, the **Sampling Mode**, and the raw size (**e.**) are used to derive the final pixel width and height (**k.** **l.** **m.**, depending on **Sampling Mode**).* </sub> |
+
+The diagram above shows the key `(x,y)` image dimensions used by DALi in its load-time scaling pipeline visualized as rectangles.
+They are:
+
+  1. **Requested**: The dimensions passed by the app.
+  2. **Raw**: The dimensions stored in the resource.
+  3. **Target**: The box to fit the image into derived from 1. and 2.
+  4. **Fitted**: The ideal scaled-down size of the image.
+  5. **Scaled Pixels** The final pixel width and height resulting from the (possibly approximate) scaling.
+
+This should help to understand how the parameters given to DALi influence the final image loaded. The (x, y) passed define a *target* to the fit the image to rather than a new size for the image directly.
+The fitting mode defines a strategy for fitting the raw image to the target.
+The sampling mode has two options which cause the fitted dimensions to be exceeded, while the others cause it to be matched exactly.
+
+The pipeline from the values passed from the application to the *natural size* of the image is different. If no dimension is passed, the raw image size is read from the image resource. If only one dimension is passed, the explicitly set dimension will be used for the **natural size** and the unspecified dimension will match the actual loaded pixel dimension. When both are specified that becomes the 'natural size' even if it differs from the actual pixel dimensions loaded. This [requires some care in rendering to avoid distortion](#resourceimagescalingsamplingmodesrendernaturalsize).
+
+### Fitting an image's dimensions to the target box {#resourceimagescalingfittingmodes}
+
+DALi provides a number of strategies for mapping the pixels of an image onto the target box derived above.
+It provides a `FittingMode` enumeration to the developer to select a mapping or fitting approach.
+These are `SCALE_TO_FILL`, `SHRINK_TO_FIT`, `FIT_WIDTH`, and `FIT_HEIGHT` and their effect is best appreciated visually:
+
+| FittingMode Options |
+| ------------------- |
+| ![ ](../assets/img/image-scaling/fitting-mode-options.jpg) ![ ](fitting-mode-options.jpg) |
+| <sub> **Fitting modes**: *The top row shows the effect of each mode when a tall target rectangle is applied to a square image. The middle row applies a wide target to a square raw image. The bottom row uses a target with the same aspect ratio as the raw image. These examples show that `SCALE_TO_FILL` is the only option for which the dimensions of the fitted image result exactly match the target. The others are larger or smaller, with a different aspect ratio. `SHRINK_TO_FIT` is always equal to one of `FIT_WIDTH` or `FIT_HEIGHT`: in each case it is the minimum of them. As a special case, where the aspect ratio of raw image and target match, all fitting modes generate an exact match final image and are equivalent to each other.* </sub> |
+
+The operation of each of these modes is as follows:
+
+| `FittingMode` | **Operation** |
+| ------------- | --------- |
+| `SCALE_TO_FILL` | Centers the image on the target box and uniformly scales it so that it matches the target in one dimension and extends outside the target in the other. Chooses the dimension to match that results in the fewest pixels outside the target. Trims away the parts of the image outside the target box so as to match it exactly. |
+| `SHRINK_TO_FIT` | Centers the image on the target box and uniformly scales it so that it matches the target in one dimension and fits inside it in the other. |
+| `FIT_WIDTH` | Centers the image on the target box and uniformly scales it so that it matches the target width without regard for the target height. |
+| `FIT_HEIGHT` | Centers the image on the target box and uniformly scales it so that it matches the target in height and ignores the target width. |
+
+These modes differ only when the target box has a different aspect ratio to the raw image. Using this, if the application knows a priori what the image dimensions are, it can scale down the image by requesting dimensions that have the same aspect ratio as the raw dimensions:
+~~~{.cpp}
+// C++
+// Image on 'disk' is 320x240.
+ResourceImage image = ResourceImage::New( "flower.png", ImageDimensions( 32, 24 ) );
+// Image will be loaded at (32, 24), regardless of fitting mode.
+~~~
+~~~{.js}
+// JavaScript
+// Image on 'disk' is 320x240.
+var image = new dali.ResourceImage( { url:"flower.png", width:32, height:24});
+// Image will be loaded at (32, 24), regardless of fitting mode.
+~~~
+
+
+### Quality Versus Speed and Memory Options {#resourceimagescalingsamplingmodes}
+
+The process of scaling an image can be expensive in CPU cycles and add latency to the loading of each resource.
+To allow the developer to trade-off speed against quality for different use cases, DALi provides the `SamplingMode` enum, which can be passed to `ResourceImage::New()`.
+Two of these modes produce bitmaps which differ from the dimensions calculated by the fitting algorithm and so have a memory trade-off as well. The full set of modes is explained below.
+
+| `SamplingMode` | **Operation** |
+| ------------- | --------- |
+| `NEAREST` | Use simple point sampling when scaling. For each pixel in output image, just one pixel is chosen from the input image. This is the fastest, crudest option but suffers the worst from aliasing artifacts so should only be used for fast previews, or where the source image is known to have very low-frequency features. |
+| `LINEAR` | Uses a weighted bilinear filter with a `(2,2)` footprint when scaling. For each output pixel, four input pixels are averaged from the input image. This is a good quality option, equivalent to the GPU's filtering and works well at least down to a `0.5` scaling. |
+| `BOX` | Uses an iterated `(2,2)` box filter to repeatedly halve the image in both dimensions, averaging adjacent pixels until the the result is approximately right for the fitting target rectangle. For each output pixel some number of pixels from the sequence `[4,16,64,256,1024,...]` are averaged from the input image, where the number averaged depends on the degree of scaling requested. This provides a very high quality result and is free from aliasing artifacts because of the iterated averaging. *The resulting bitmap will not exactly match the dimensions calculated by the fitting mode but it will be within a factor of two of it and have the same aspect ratio as it.*   |
+| `BOX_THEN_NEAREST` | Applies the `BOX` mode to get within a factor of two of the fitted dimensions, and then finishes off with `NEAREST` to reach the exact dimensions. |
+| `BOX_THEN_LINEAR` | Applies the `BOX` mode to get within a factor of two of the fitted dimensions, and then finishes off with `LINEAR` to reach the exact dimensions. This is the slowest option and of equivalent quality to `BOX`. It is superior to `BOX` in that is uses an average of 62% of the memory and exactly matches the dimensions calculated by fitting. **This is the best mode for most use cases**.  |
+| `NO_FILTER` | Disables scaling altogether. In conjunction with `SCALE_TO_FILL` mode this can be useful as the edge trimming of that fitting mode is still applied. An example would be a gallery application, where a database of prescaled thumbnails of approximately the correct size need to be displayed in a regular grid of equal-sized cells, while being loaded at maximum speed. |
+
+Here are all the modes applied to scaling-down a `(640,720)` line art and text JPEG image to a `(218, 227)` thumbnail:
+
+|  |  | |
+| ---- | ---- | --- |
+| ![ ](../assets/img/image-scaling/sampling_modes_no_filter.png) ![ ](sampling_modes_no_filter.png) | ![ ](../assets/img/image-scaling/sampling_modes_nearest.png) ![ ](sampling_modes_nearest.png) | ![ ](../assets/img/image-scaling/sampling_modes_linear.png) ![ ](sampling_modes_linear.png) |
+| **NO_FILTER** | **NEAREST** | **LINEAR** |
+| ![ ](../assets/img/image-scaling/sampling_modes_box.png) ![ ](sampling_modes_box.png) | ![ ](../assets/img/image-scaling/sampling_modes_box_then_nearest.png) ![ ](sampling_modes_box_then_nearest.png) | ![ ](../assets/img/image-scaling/sampling_modes_box_then_linear.png) ![ ](sampling_modes_box_then_linear.png) |
+| **BOX** | **BOX_THEN_NEAREST** | **BOX_THEN_LINEAR** |
+
+These are screenshots, showing how the images are rendered in a DALi demo.
+There is an additional level of GPU bilinear filtering happening at render time.
+The best way to get a feel for the best sampling mode for different image types is to play with the [examples](#resourceimagescalingsamplingmodesexamples).
+
+In the following code example the same image is loaded to be a thumbnail but with differing quality, speed, and memory implications.
+~~~{.cpp}
+// C++
+ResourceImage image1 = ResourceImage::New( "flower.png",
+    ImageDimensions( 240, 240 ), FittingMode::SCALE_TO_FILL, SamplingMode::NEAREST );
+
+ResourceImage image2 = ResourceImage::New( "flower.png",
+    ImageDimensions( 240, 240 ), FittingMode::SCALE_TO_FILL, SamplingMode::NO_FILTER );
+
+ResourceImage image3 = ResourceImage::New( "flower.png",
+    ImageDimensions( 240, 240 ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX );
+
+ResourceImage image4 = ResourceImage::New( "flower.png",
+    ImageDimensions( 240, 240 ), FittingMode::SCALE_TO_FILL, SamplingMode::BOX_THEN_LINEAR );
+~~~
+~~~{.js}
+// JavaScript
+var image1 = new dali.ResourceImage( {
+  url:"flower.png", width:240, height:240,
+  fitting-mode:"SCALE_TO_FILL", sampling-mode:"NEAREST"
+} );
+
+var image2 = new dali.ResourceImage( {
+  url:"flower.png", width:240, height:240,
+  fitting-mode:"SCALE_TO_FILL", sampling-mode:"NO_FILTER"
+} );
+
+var image3 = new dali.ResourceImage( {
+  url:"flower.png", width:240, height:240,
+  fitting-mode:"SCALE_TO_FILL", sampling-mode:"BOX"
+} );
+
+var image4 = new dali.ResourceImage( {
+  url:"flower.png", width:240, height:240,
+  fitting-mode:"SCALE_TO_FILL", sampling-mode:"BOX_THEN_LINEAR"
+} );
+~~~
+
+If we imagine flower.jpg is a 560*512 photo with high frequency details, the results of this are:
+* `image1` loads fast, uses minimal space, has poor quality.
+* `image2` loads even faster, uses 4.6 * minimal space, has good quality.
+* `image3` loads moderately slow, uses 1.3 * minimal space, has good quality.
+* `image4` loads slowest, uses minimal space, has good quality.
+
+Note that `BOX`, `BOX_THEN_NEAREST` and `BOX_THEN_LINEAR` can work particularly well for JPEG images as they can use fast downscaling typically built-in to the JPEG codec on supported platforms on the fly while decoding. In this case the caveats about using them having a speed trade-off given above do not apply.
+
+## Passing a Zero Dimension {#resourceimagescalingzerodimensions}
+Passing in a single zero dimension is effectively a shortcut for specifying `FIT_WIDTH` or `FIT_HEIGHT` `FittingMode`s. When a non-zero width and zero height are specified, the fitting done will be identical to the result using `FittingMode` `FIT_WIDTH`. When passing a zero width and non-zero height, the effect of applying the chosen `FittingMode` to the calculated target dimensions is always identical to applying the `FIT_HEIGHT` mode.
+
+* `ResourceImage::New( ImageDimensions( x, 0 ), <ANY_FITTING_MODE> )` =
+  `ResourceImage::New( ImageDimensions( x, <ANYTHING> ), FittingMode::FIT_WIDTH )`
+* `ResourceImage::New( ImageDimensions( 0, y ), <ANY_FITTING_MODE> )` =
+  `ResourceImage::New( ImageDimensions( <ANYTHING>, y), FittingMode::FIT_HEIGHT )`
+
+This falls out of the the fact that the fitting modes modes are strategies for the case when the aspect ratio of the raw image differs from the aspect ratio of the target dimensions, but the zero dimension behavior always ensures that the target dimensions have the same aspect ratio as the raw image's so the fitting modes are all equivalent.
+
+Therefore, if `(x!=0, y=0)`, fittingMode = `FIT_WIDTH`,
+and if `(x=0, y=!0)`, fittingMode = `FIT_HEIGHT`, irrespective of fitting mode passed by the application (if any).
+This shortcut is provided as a convenience to the developer and allows FIT_WIDTH or FIT_HEIGHT to be specified compactly:
+~~~{.cpp}
+// C++
+// FIT_WIDTH:
+ResourceImage image = ResourceImage::New("flower.png", ImageDimensions(x, 0));
+// FIT_HEIGHT:
+ResourceImage image = ResourceImage::New("flower.png", ImageDimensions(0, y));
+~~~
+~~~{.js}
+// JavaScript
+// FIT_WIDTH:
+var image = new dali.ResourceImage( {
+  url: "flower.png",
+  width: x,
+  height: 0
+});
+// FIT_HEIGHT:
+var image = new dali.ResourceImage( {
+  url: "flower.png",
+  width: 0,
+  height: y
+});
+~~~
+
+## Upscaling
+
+DALi refuses to upscale images at load time in order to conserve memory.
+If the application requests a size for an image that is larger than its raw dimensions, DALi will instead return an image with the same aspect ratio but limited to the largest dimensions that do not exceed the raw ones.
+Upscaling can still be effected at render time by setting the size of an actor to the desired size.
+
+## Compressed Textures and Scaling
+
+Compressed textures cannot be scaled at load time as their formats are designed to be uploaded directly to GPU memory. To achieve scaling of compressed textures, set the desired size on the attached `ImageActor` for scaling at render time instead.
+
+## Compensation for Natural Size != Pixel Width / Height {#resourceimagescalingsamplingmodesrendernaturalsize}
+
+Because the *natural size* of an image is
+[taken from the requested dimensions](#resourceimagescalingsamplingmodesdimensionflow)
+passed to `ResourceImage::New()` rather than passing through the same calculations that result in the eventual pixel width and height loaded,
+the *natural size* and pixel dimensions of an image will differ when loaded with scaling.
+It is inherent in the definition of fitting modes other than `SCALE_TO_FILL` not to match the requested dimensions, so in general, images loaded with them must have this mismatch between *natural size* and actual pixel width.
+
+It is not possible in general to draw a scaled resource image using its natural size as the `ImageActor`'s size without it appearing stretched in one dimension.
+This is the case for example by default with size negotiation in effect or when an image is simply passed to an actor at creation time.
+
+There are circumstance, however, in which the the natural size of a resource image loaded will exactly match its post-load pixel dimensions:
+
+1. No scaling is requested.
+1. The application chooses a combination of requested dimensions, fitting mode, and sampling mode which the scaling sub-system can match exactly. This is the case:
+   *  For all downscaling using `SCALE_TO_FILL` fitting mode and not using `BOX` or `NO_FILTER` sampling modes.
+   * The app uses `SHRINK_TO_FIT`, `FIT_WIDTH`, or `FIT_HEIGHT` and the requested dimensions passed-in are both smaller than the raw ones and have the same aspect ratio as them, and it is not using `BOX` or `NO_FILTER` sampling modes.
+
+In these cases the image may be used freely in layouts controlled by size negotiation.
+Additionally, if the requested size has the same aspect ratio as the eventual pixel array loaded, and the fitting mode is `SCALE_TO_FILL` or `BOX` and `NO_FILTER` sampling modes are avoided, even if they don't match in dimensions exactly, the eventual image will be drawn without aspect ratio distortion although it will be scaled at render time.
+
+The fitting and scaling modes [demo](#resourceimagescalingsamplingmodesexamples) allows this behavior to be be explored dynamically when the fitting mode is changed from `SCALE_TO_FILL`.
+
+The application can of course only pass dimensions which are just right if it happens to know the raw dimensions or if it accesses the the image resource and reads the raw dimensions from its header.
+
+The application can get a scaled resource image rendered correctly to screen with one of three strategies:
+
+  1. Use one of the special cases above.
+  2. Read the image header from disk, recreate the dimension deriving, fitting, and sampling logic described in this document, and use that to generate a pair of requested dimensions which match the eventual image dimensions.
+  3. Use the requested dimensions it really wants to but then read the image header from disk, recreate the dimension deriving, fitting, and sampling logic described in this document, and set the size of an `ImageActor` to that size explicitly rather than relying on the *natural size* of the image.
+
+## Examples {#resourceimagescalingsamplingmodesexamples}
+Load time image scaling is spread throughout the DALi examples.
+Search for `"ImageDimensions"` in the dali-demo project to see it used.
+There is also a specific demo to show all of the fitting and scaling modes.
+which lives in the demo project at `examples/image-scaling-and-filtering`.
+
+![ ](../assets/img/image-scaling/demo-fitting-sampling.jpg) ![ ](./demo-fitting-sampling.jpg)
+
+Touch the arrows in the top corners to changes image.
+Drag the green button in the corner of the image to change the requested size and trigger an immediate image reload.
+Use the buttons at the bottom of the screen to select any of the fitting and sampling modes from the popups which appear.
+This demo does not take any of the special measures [described above](#resourceimagescalingsamplingmodesrendernaturalsize) to correct for the natural size != pixel dimensions discrepancy so all fitting modes other than `SCALE_TO_FILL` show distortion.
+
+A second specific demo shows the effect of a filter mode on a single image loaded into various requested rectangles side by side.
+It can be found under `examples/image-scaling-irregular-grid`.
+
+![ ](../assets/img/image-scaling/demo-sampling-modes.jpg) ![ ](./demo-sampling-modes.jpg)
+
+Touch the button at top-left to change image.
+The button at top-right changes sampling mode.
+You will see strong differences between sampling modes where the image contains high frequency details such as hair and in the large black and white image, but much less in some others such as the Statue of Liberty which is mostly covered by a smooth gradient.
+
+@class _Guide_Resource_Image_Scaling
+*/
index a9910d5..7da51c6 100644 (file)
@@ -6,13 +6,15 @@
 
 Using compressing the textures will:
 
-- Speed up rendering in time the GPU == less power used due to less texture data being transferred.
+- Reduce memory bandwidth in rendering due to less texture data being transferred per frame.
+  - Reduces power consumption.
+  - Speeds up rendering.
 - Reduce texture memory usage.
-- Speed up load times. Smaller files mean quicker load times.
-  
+- Speed up load times. There is no CPU decoding step in loading: the file data can be copied directly to GPU memory.
+
 DALi supports the KTX file format.
-  
-You just load the compressed texture like you would any other image.
+
+You load the compressed texture just like you would any other image.
 
 ~~~{.cpp}
 // C++
@@ -23,27 +25,27 @@ ResourceImage image = ResourceImage::New("my_compressed_file.ktx");
 var image = new dali.ResourceImage( { url:"my_compressed_file.ktx"});
 
 ~~~
-  
+
 ### ARMS texture compression tool
 
 http://malideveloper.arm.com/develop-for-mali/tools/asset-creation/mali-gpu-texture-compression-tool/
-  
+
 Here is an example of using the ARM compression tool.
-  
+
 ![ ](../assets/img/texture-atlas/compression-options.jpg)
 ![ ](compression-options.jpg)
-  
+
 ![ ](../assets/img/texture-atlas/compression-example.jpg)
 ![ ](compression-example.jpg)
 
-  
+
 As shown above the ETC-1 compression format does not support alpha.
-  
-As a work around the tool will export the alpha as a seperate compressed image.
+
+As a work around the tool will export the alpha as a separate compressed image.
 
 In order to combine both the images you need to use a custom shader.
 Here is an example shader:
-  
+
 ~~~{.cpp}
 // C++ Code
   const char* const COMPRESSED_RGB_PLUS_SEPARATE_ALPHA_FRAGMENT_SOURCE =
@@ -73,7 +75,7 @@ Here is an example shader:
 
   imageActor.SetBlendMode(BlendingMode::ON);
 ~~~
-  
+
 ~~~{.js}
 // JavaScript code
 var fragSource = "  \
@@ -83,20 +85,20 @@ void main()                                                   \
     v4Color.a =  texture2D(sEffect, vTexCoord ).r;             \
    gl_FragColor = v4Color;                                     \
 }";
-  
+
 var shaderEffect = new dali.ShaderEffect( "", fragSource);
-  
+
 var atlasImageRGB = new dali.ResourceImage( { url:"ATLAS_RGB_FILENAME.KTX"} );
-  
+
 var atlasImageAlpha = new dali.ResourceImage( { url:"ATLAS_ALPHA_FILENAME.KTX"} );
-  
+
 shaderEffect.setEffectImage( atlasImageAlpha );
-  
+
 // to create Image Actor
 ImageActor  imageActor = ImageActor::New( mAtlasImageRGB, GetImagePosition( info) );
-  
+
 imageActor.setShaderEffect( shaderEffect );
-  
+
 imageActor.setBlendMode( dali.BLENDING_ON );
 ~~~
 
@@ -104,5 +106,3 @@ imageActor.setBlendMode( dali.BLENDING_ON );
 
 
 */
-
-