I loved these quintessential roofs in Japan, with the tall ridge and the endcaps. This one is from one of the outbuildings at Nijo Castle, I think from one of the storage buildings used to warehouse rice and other supplies needed to weather a seige.
Apparently the heavy ridge along the top provided compressive force that helped hold the interlocking tiles together in high winds and typhoons. The weight of the roof, however, also meant that the posts holding it up were a weak spot. When the A-Bomb went off in Hiroshima, many of the houses out at the edges of the blast area had their wooden building structure give way, and the roofs collapsed largely intact on whatever and whoever was inside. Many people were trapped as a result, and then burned alive in the subsequent firestorm.