<?xml version="1.0" encoding="utf-8"?> 
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">

  <Type Name="Area">
    <DisplayString>{{x = {x}, y = {y}, width = {width}, height = {height}}}</DisplayString>
  </Type>

  <Type Name="CompArea">
    <DisplayString Condition="compID == COMPONENT_Y">{{(Y) x = {x}, y = {y}, width = {width}, height = {height}}}</DisplayString>
    <DisplayString Condition="compID == COMPONENT_Cb">{{(Cb) x = {x}, y = {y}, width = {width}, height = {height}}}</DisplayString>
    <DisplayString Condition="compID == COMPONENT_Cr">{{(Cr) x = {x}, y = {y}, width = {width}, height = {height}}}</DisplayString>
    <DisplayString Condition="compID >= MAX_NUM_COMPONENT">invalid</DisplayString>
  </Type>
  
  <Type Name="UnitArea">
    <DisplayString Condition="blocks._size > 0 &amp;&amp; ((CompArea*) blocks._arr)->width > 0">{{x = {((CompArea*) blocks._arr)->x}, y = {((CompArea*) blocks._arr)->y}, width = {((CompArea*) blocks._arr)->width}, height = {((CompArea*) blocks._arr)->height}}}</DisplayString>
    <DisplayString Condition="blocks._size > 1 &amp;&amp; ((CompArea*) blocks._arr)->width == 0">{{(chroma) x = {((CompArea*) blocks._arr)[1].x}, y = {((CompArea*) blocks._arr)[1].y}, width = {((CompArea*) blocks._arr)[1].width}, height = {((CompArea*) blocks._arr)[1].height}}}</DisplayString>
    <DisplayString Condition="blocks._size == 0">{{empty}}</DisplayString>
    <Expand>
      <Synthetic Name="[format]" Condition="chromaFormat == CHROMA_400">
        <DisplayString>400</DisplayString>
      </Synthetic>
      <Synthetic Name="[format]" Condition="chromaFormat == CHROMA_420">
        <DisplayString>420</DisplayString>
      </Synthetic>
      <Synthetic Name="[format]" Condition="chromaFormat == CHROMA_422">
        <DisplayString>422</DisplayString>
      </Synthetic>
      <Synthetic Name="[format]" Condition="chromaFormat == CHROMA_444">
        <DisplayString>444</DisplayString>
      </Synthetic>
      <Synthetic Name="[format]" Condition="chromaFormat > CHROMA_444">
        <DisplayString>invalid</DisplayString>
      </Synthetic>
      <ArrayItems>
        <Size>blocks._size</Size>
        <ValuePointer>((CompArea*) blocks._arr)</ValuePointer>
      </ArrayItems>
    </Expand>
  </Type>

  <Type Name="AreaBuf&lt;*&gt;">
    <DisplayString>{{width = {width}, heigth = {height}, stride = {stride}}}</DisplayString>
  </Type>

  <Type Name="CodingUnit">
    <DisplayString Condition="blocks._size > 0 &amp;&amp; ((CompArea*) blocks._arr)->width > 0">{{CU: x = {((CompArea*) blocks._arr)->x}, y = {((CompArea*) blocks._arr)->y}, width = {((CompArea*) blocks._arr)->width}, height = {((CompArea*) blocks._arr)->height}}}</DisplayString>
    <DisplayString Condition="blocks._size > 1 &amp;&amp; ((CompArea*) blocks._arr)->width == 0">{{(chroma) CU: x = {((CompArea*) blocks._arr)[1].x}, y = {((CompArea*) blocks._arr)[1].y}, width = {((CompArea*) blocks._arr)[1].width}, height = {((CompArea*) blocks._arr)[1].height}}}</DisplayString>
    <DisplayString Condition="blocks._size == 0">{{empty CU}}</DisplayString>
  </Type>
  <Type Name="TransformUnit">
    <DisplayString Condition="blocks._size > 0 &amp;&amp; ((CompArea*) blocks._arr)->width > 0">{{TU: x = {((CompArea*) blocks._arr)->x}, y = {((CompArea*) blocks._arr)->y}, width = {((CompArea*) blocks._arr)->width}, height = {((CompArea*) blocks._arr)->height}}}</DisplayString>
    <DisplayString Condition="blocks._size > 1 &amp;&amp; ((CompArea*) blocks._arr)->width == 0">{{(chroma) TU: x = {((CompArea*) blocks._arr)[1].x}, y = {((CompArea*) blocks._arr)[1].y}, width = {((CompArea*) blocks._arr)[1].width}, height = {((CompArea*) blocks._arr)[1].height}}}</DisplayString>
    <DisplayString Condition="blocks._size == 0">{{empty TU}}</DisplayString>
  </Type>
  <Type Name="PredictionUnit">
    <DisplayString Condition="blocks._size > 0 &amp;&amp; ((CompArea*) blocks._arr)->width > 0">{{PU: x = {((CompArea*) blocks._arr)->x}, y = {((CompArea*) blocks._arr)->y}, width = {((CompArea*) blocks._arr)->width}, height = {((CompArea*) blocks._arr)->height}}}</DisplayString>
    <DisplayString Condition="blocks._size > 1 &amp;&amp; ((CompArea*) blocks._arr)->width == 0">{{(chroma) PU: x = {((CompArea*) blocks._arr)[1].x}, y = {((CompArea*) blocks._arr)[1].y}, width = {((CompArea*) blocks._arr)[1].width}, height = {((CompArea*) blocks._arr)[1].height}}}</DisplayString>
    <DisplayString Condition="blocks._size == 0">{{empty PU}}</DisplayString>
  </Type>
  
</AutoVisualizer>
