Added all Exif orientation modes.

This commit is contained in:
Branimir Karadžić
2017-07-20 20:27:06 -07:00
parent aa9dcbe5f9
commit d7f03f8cab
3 changed files with 13 additions and 8 deletions

View File

@@ -143,6 +143,10 @@ namespace bimg
R90,
R180,
R270,
HFlip,
HFlipR90,
HFlipR270,
VFlip,
};
};

View File

@@ -1995,6 +1995,7 @@ namespace bimg
{ 16, DDPF_RGB, { 0x0000f800, 0x000007e0, 0x0000001f, 0x00000000 }, TextureFormat::R5G6B5 },
{ 16, DDPF_RGB, { 0x00007c00, 0x000003e0, 0x0000001f, 0x00008000 }, TextureFormat::RGB5A1 },
{ 24, DDPF_RGB, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::RGB8 },
{ 32, DDPF_RGB, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0x00000000 }, TextureFormat::BGRA8 },
{ 32, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }, TextureFormat::RGBA8 },
{ 32, DDPF_BUMPDUDV, { 0x000000ff, 0x0000ff00, 0x00ff0000, 0xff000000 }, TextureFormat::RGBA8S },
{ 32, DDPF_RGB|DDPF_ALPHAPIXELS, { 0x00ff0000, 0x0000ff00, 0x000000ff, 0xff000000 }, TextureFormat::BGRA8 }, // D3DFMT_A8R8G8B8

View File

@@ -621,14 +621,14 @@ namespace bimg
switch (u16)
{
default:
case 1: orientation = Orientation::R0; break; // Horizontal (normal)
case 2: orientation = Orientation::R0; break; // Mirror horizontal
case 3: orientation = Orientation::R180; break; // Rotate 180
case 4: orientation = Orientation::R0; break; // Mirror vertical
case 5: orientation = Orientation::R0; break; // Mirror horizontal and rotate 270 CW
case 6: orientation = Orientation::R90; break; // Rotate 90 CW
case 7: orientation = Orientation::R0; break; // Mirror horizontal and rotate 90 CW
case 8: orientation = Orientation::R270; break; // Rotate 270 CW
case 1: orientation = Orientation::R0; break; // Horizontal (normal)
case 2: orientation = Orientation::HFlip; break; // Mirror horizontal
case 3: orientation = Orientation::R180; break; // Rotate 180
case 4: orientation = Orientation::VFlip; break; // Mirror vertical
case 5: orientation = Orientation::HFlipR270; break; // Mirror horizontal and rotate 270 CW
case 6: orientation = Orientation::R90; break; // Rotate 90 CW
case 7: orientation = Orientation::HFlipR90; break; // Mirror horizontal and rotate 90 CW
case 8: orientation = Orientation::R270; break; // Rotate 270 CW
}
}
break;