A Library for Declarative Resolution-Independent 2D Graphics

  • Paul Klint
  • Atze van der Ploeg
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7752)


The design of most 2D graphics frameworks has been guided by what the computer can draw efficiently, instead of by how graphics can best be expressed and composed. As a result, such frameworks restrict expressivity by providing a limited set of shape primitives, a limited set of textures and only affine transformations. For example, non-affine transformations can only be added by invasive modification or complex tricks rather than by simple composition. More general frameworks exist, but they make it harder to describe and analyze shapes. We present a new declarative approach to resolution-independent 2D graphics that generalizes and simplifies the functionality of traditional frameworks, while preserving their efficiency. As a real-world example, we show the implementation of a form of focus+context lenses that gives better image quality and better performance than the state-of-the-art solution at a fraction of the code. Our approach can serve as a versatile foundation for the creation of advanced graphics and higher level frameworks.


Declarative Graphics Design Resolution-Independence Optimization Focus+context lenses 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Klint, P., Lisser, B., van der Ploeg, A.: Towards a one-stop-shop for analysis, transformation and visualization of software. In: Sloane, A., Aßmann, U. (eds.) SLE 2011. LNCS, vol. 6940, pp. 1–18. Springer, Heidelberg (2012)CrossRefGoogle Scholar
  2. 2.
    Karczmarczuk, J.: Functional approach to texture generation. In: Adsul, B., Ramakrishnan, C.R. (eds.) PADL 2002. LNCS, vol. 2257, pp. 225–242. Springer, Heidelberg (2002)CrossRefGoogle Scholar
  3. 3.
    Hoffmann, C.M.: Implicit curves and surfaces in CAGD. IEEE Computer Graphics and Applications 13, 79–88 (1993)CrossRefGoogle Scholar
  4. 4.
    Sederberg, T.W., Anderson, D.C., Goldman, R.N.: Implicit representation of parametric curves and surfaces. Computer Vision, Graphics, and Image Processing 28(1), 72–84 (1984)CrossRefzbMATHGoogle Scholar
  5. 5.
    Dokken, T., Thomassen, J.: Overview of approximate implicitization. In: Topics in Algebraic Geometry and Geometric modelling. AMS series on Contemporary Mathematics CONM 334, vol. 28(1), pp. 169–184 (2003)Google Scholar
  6. 6.
    Elliott, C.: Functional image synthesis. In: Proceedings of Bridges (2001)Google Scholar
  7. 7.
    Finne, S., Jones, S.P.: Pictures: A simple structured graphics model. In: Glasgow Functional Programming Workshop, Ullapool (1995)Google Scholar
  8. 8.
    Matlage, K., Gill, A.: ChalkBoard: Mapping functions to polygons. In: Morazán, M.T., Scholz, S.-B. (eds.) IFL 2009. LNCS, vol. 6041, pp. 55–71. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  9. 9.
    Elliott, C.: Programming graphics processors functionally. In: Proceedings of the 2004 ACM SIGPLAN Workshop on Haskell 2004, pp. 45–56. ACM, New York (2004)Google Scholar
  10. 10.
    Karczmarczuk, J.: Geometric modelling in functional style. In: Proceedings of the III Latino-American Workshop on Functional Programming, CLAPF 1999, pp. 8–9 (1999)Google Scholar
  11. 11.
    Casciola, G., Morigi, S.: Reparametrization of NURBS curves. International Journal of Shape Modeling 2, 103–116 (1996)CrossRefzbMATHGoogle Scholar
  12. 12.
    Ma, Y.L., Hewitt, W.T.: Point inversion and projection for NURBS curves and surfaces: control polygon approach. Comput. Aided Geom. Des. 20(2), 79–99 (2003)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Schneider, P.J.: An algorithm for automatically fitting digitized curves. In: Glassner, A.S. (ed.) Graphics gems, pp. 612–626. Academic Press Professional, Inc., San Diego (1990)Google Scholar
  14. 14.
    Elliott, C.: Beautiful differentiation. In: International Conference on Functional Programming, ICFP (2009)Google Scholar
  15. 15.
    Carpendale, M.S.T., Montagnese, C.: A framework for unifying presentation space. In: Proceedings of the 14th Annual ACM Symposium on User Interface Software and Technology, UIST 2001, pp. 61–70. ACM, New York (2001)CrossRefGoogle Scholar
  16. 16.
    Pietriga, E., Bau, O., Appert, C.: Representation-independent in-place magnification with Sigma lenses. IEEE Transactions on Visualization and Computer Graphics 16, 455–467 (2010)CrossRefGoogle Scholar
  17. 17.
    Pietriga, E.: A Toolkit for Addressing HCI Issues in Visual Language Environments. In: IEEE Symposium on Visual Languages and Human-Centric Computing (VL/HCC), pp. 145–152 (2005)Google Scholar
  18. 18.
    Ragan-Kelley, J., Adams, A., Paris, S., Levoy, M., Amarasinghe, S., Durand, F.: Decoupling algorithms from schedules for easy optimization of image processing pipelines. ACM Transactions on Graphics 31(4), 32 (2012)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2013

Authors and Affiliations

  • Paul Klint
    • 1
  • Atze van der Ploeg
    • 1
  1. 1.Centrum Wiskunde & InformaticaAmsterdamThe Netherlands

Personalised recommendations