@ -9,7 +9,7 @@ NOTE: number at end of pixelformat name it's a total bitscount e.g. PF_RGB_24 ==
@@ -9,7 +9,7 @@ NOTE: number at end of pixelformat name it's a total bitscount e.g. PF_RGB_24 ==
#define ImageRAW( type ) (type == PF_RGBA_32 || type == PF_BGRA_32 || type == PF_RGB_24 || type == PF_BGR_24 || type == PF_LUMINANCE)
#define ImageDXT( type ) (type == PF_DXT1 || type == PF_DXT3 || type == PF_DXT5 || type == PF_ATI2)
#define ImageDXT( type ) (type == PF_DXT1 || type == PF_DXT3 || type == PF_DXT5 || type == PF_ATI2 || type == PF_BC6H_SIGNED || type == PF_BC6H_UNSIGNED || type == PF_BC7)
image.flags&=~IMAGE_HAS_ALPHA;// alpha is already premultiplied by color
// intentionally fallthrough
caseTYPE_DXT3:
image.type=PF_DXT3;
break;
caseTYPE_DXT4:
image.flags&=~IMAGE_HAS_ALPHA;// alpha is already premultiplied by color
// intentionally fallthrough
caseTYPE_DXT5:
image.type=PF_DXT5;
break;
caseTYPE_ATI2:
image.type=PF_ATI2;
break;
default:
image.type=PF_UNKNOWN;// assume error
break;
switch(headerExt->dxgiFormat)
{
caseDXGI_FORMAT_BC6H_SF16:
image.type=PF_BC6H_SIGNED;
break;
caseDXGI_FORMAT_BC6H_UF16:
caseDXGI_FORMAT_BC6H_TYPELESS:
image.type=PF_BC6H_UNSIGNED;
break;
caseDXGI_FORMAT_BC7_UNORM:
caseDXGI_FORMAT_BC7_UNORM_SRGB:
caseDXGI_FORMAT_BC7_TYPELESS:
image.type=PF_BC7;
break;
default:
image.type=PF_UNKNOWN;
break;
}
}
else
{
switch(hdr->dsPixelFormat.dwFourCC)
{
caseTYPE_DXT1:
image.type=PF_DXT1;
break;
caseTYPE_DXT2:
image.flags&=~IMAGE_HAS_ALPHA;// alpha is already premultiplied by color
// intentionally fallthrough
caseTYPE_DXT3:
image.type=PF_DXT3;
break;
caseTYPE_DXT4:
image.flags&=~IMAGE_HAS_ALPHA;// alpha is already premultiplied by color
// intentionally fallthrough
caseTYPE_DXT5:
image.type=PF_DXT5;
break;
caseTYPE_ATI2:
image.type=PF_ATI2;
break;
default:
image.type=PF_UNKNOWN;// assume error
break;
}
}
}
else
@ -171,6 +195,9 @@ size_t Image_DXTGetLinearSize( int type, int width, int height, int depth )
@@ -171,6 +195,9 @@ size_t Image_DXTGetLinearSize( int type, int width, int height, int depth )