Procházet zdrojové kódy

Added all Exif orientation modes.

Branimir Karadžić před 8 roky
rodič
revize
d7f03f8cab
3 změnil soubory, kde provedl 13 přidání a 8 odebrání
  1. 4 0
      include/bimg/bimg.h
  2. 1 0
      src/image.cpp
  3. 8 8
      src/image_decode.cpp

+ 4 - 0
include/bimg/bimg.h

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

+ 1 - 0
src/image.cpp

@@ -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

+ 8 - 8
src/image_decode.cpp

@@ -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;