Skip to content

Commit

Permalink
Added natvis file for Image Watch for eos::core::Image
Browse files Browse the repository at this point in the history
Since our revamped Image class stores the data in row-major order, it now works perfectly with Image Watch, out-of-the-box. N-channel images and all data types work and are visualised correctly.

This file has to be put somewhere where Visual Studio can find it, for example into C:\Users\Username\Documents\Visual Studio 2017\Visualizers.
  • Loading branch information
patrikhuber committed Aug 1, 2018
1 parent 98946bf commit be436f4
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions .natvis/eos.natvis
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
<?xml version="1.0" encoding="utf-8"?>
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" MenuName="Add to Image Watch"/>

<Type Name="eos::core::Image&lt;*&gt;">
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
</Type>
<Type Name="eos::core::Image&lt;eos::core::Pixel&lt;*,*&gt;&gt;">
<UIVisualizer ServiceId="{A452AFEA-3DF6-46BB-9177-C0B08F318025}" Id="1" />
</Type>

<!-- Images instantiated with a built-in type as PixelType (1-channel): -->
<Type Name="eos::core::Image&lt;*&gt;">
<Expand>
<Synthetic Name="[type]" Condition='strcmp("unsigned char", "$T1") == 0'>
<DisplayString>UINT8</DisplayString>
</Synthetic>
<Synthetic Name="[type]" Condition='strcmp("int", "$T1") == 0'>
<DisplayString>INT32</DisplayString>
</Synthetic>
<Synthetic Name="[type]" Condition='strcmp("float", "$T1") == 0'>
<DisplayString>FLOAT32</DisplayString>
</Synthetic>
<Synthetic Name="[type]" Condition='strcmp("double", "$T1") == 0'>
<DisplayString>FLOAT64</DisplayString>
</Synthetic>

<Synthetic Name="[channels]">
<DisplayString>1</DisplayString>
</Synthetic>

<Item Name="[width]">width_</Item>
<Item Name="[height]">height_</Item>

<Item Name="[data]">($T1*)(&amp;data_[0])</Item>

<Item Name="[stride]">row_stride</Item>
</Expand>
</Type>

<!-- Images instantiated with Pixel<ElementType, NumChannels>: -->
<Type Name="eos::core::Image&lt;eos::core::Pixel&lt;*,*&gt;&gt;">
<Expand>
<Synthetic Name="[type]" Condition='strcmp("unsigned char", "$T1") == 0'>
<DisplayString>UINT8</DisplayString>
</Synthetic>
<Synthetic Name="[type]" Condition='strcmp("int", "$T1") == 0'>
<DisplayString>INT32</DisplayString>
</Synthetic>
<Synthetic Name="[type]" Condition='strcmp("float", "$T1") == 0'>
<DisplayString>FLOAT32</DisplayString>
</Synthetic>
<Synthetic Name="[type]" Condition='strcmp("double", "$T1") == 0'>
<DisplayString>FLOAT64</DisplayString>
</Synthetic>

<Item Name="[channels]">$T2</Item>

<Item Name="[width]">width_</Item>
<Item Name="[height]">height_</Item>

<Item Name="[data]">($T1*)(&amp;data_[0])</Item>

<Item Name="[stride]">row_stride</Item>
</Expand>
</Type>
</AutoVisualizer>

0 comments on commit be436f4

Please sign in to comment.