You are here: Start » Usage Tips » ATL Data Types Visualizers

ATL Data Types Visualizers

Data Visualizers

Data visualizers present data during the debugging session in a human-friendly form. Microsoft Visual Studio allows users to write custom visualizers for C++ data. Adaptive Vision Library is shipped with a set of visualizers for the most frequently used ATL data types: atl::String, atl::Array, atl::Conditional and atl::Optional.

Visualizers are available for Visual Studio 2010, 2012, 2013 and 2015. Visualizers are automatically installed during installation of Adaptive Vision Library and are ready to use, but they are also available at atl_visualizers subdirectory of Adaptive Vision Library installation path.

For more information about visualizers, please refer to the MSDN.

Example ATL data visualization

Please see the example variables definition below and their visualization without and with visualizers.

atl::String str = L"Hello world";
atl::Conditional<int> nil = atl::NIL;
atl::Conditional<int> conditionalFive = 5;
atl::Array<int> array(3, 5);

Data preview without ATL visualizers installed:

The same data presented using AVL visualizers:

Image Watch extension

For Visual Studio 2012, 2013 and 2015 an extension Image Watch is available. Image Watch allows to display images during debugging sessions in window similar to "Locals" or "Watch". To make Image Watch work correctly with avl::Image type, Adaptive Vision Library installer provides avl::Image visualizer for Visual Studio 2012 and 2013 extension - Image Watch. If one have Image Watch extension and AVL installed, preview of images can be enabled by choosing "View->Other Windows->Image Watch" from Visual Studio menu.

avl::Image description for Image Watch extension is included in atl.natvis file, which is stored in atl_visualizers folder in Adaptive Vision Library installation directory. atl.natvis file is installed automatically during Adaptive Vision Library installation, but if from any reason .natvis is not installed correctly, one can execute install_vs2012.bat or install_vs2013.bat script, depending on which Visual Studio version is present in system.

When program is paused during debug session, all variables of type avl::Image can be displayed in Image Watch window, as shown below:

Image displayed inside Image Watch can be zoomed. When the close-up is large enough, decimal values of pixels' channel will be displayed. Hexadecimal values can be displayed instead, if appropriate option from context menu is selected.

Image Watch is quite powerful tool - one can copy address of given pixel, ignore alpha channel and much more. All options are described in its documentation, which is accessible from the Image Watch site at Visual Studio Gallery

Previous: Memory Leak Detection in Visual Studio Next: Optimizing Image Analysis for Speed