From 264acfcdc3227ad6406bfd39b95af9f85b409024 Mon Sep 17 00:00:00 2001 From: Dirk Lemstra Date: Wed, 28 Jun 2023 08:05:04 +0200 Subject: [PATCH] Code style changes. --- coders/dds.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/coders/dds.c b/coders/dds.c index 113c2f9767..9a446513c7 100644 --- a/coders/dds.c +++ b/coders/dds.c @@ -2567,12 +2567,17 @@ static MagickBooleanType ReadUncompressedRGBAPixels(Image *image, } else if (dds_info->extFormat == DXGI_FORMAT_R10G10B10A2_UNORM) { - const unsigned int pixel = ReadBlobLSBLong(image); - const unsigned int mask10 = 0x3ff; - SetPixelRed(image, ScaleShortToQuantum(((pixel & mask10) / 1023.0) * 65535), q); - SetPixelBlue(image, ScaleShortToQuantum((((pixel >> 10) & mask10) / 1023.0) * 65535), q); - SetPixelGreen(image, ScaleShortToQuantum((((pixel >> 20) & mask10) / 1023.0) * 65535), q); - SetPixelAlpha(image, ScaleShortToQuantum((((pixel >> 30) & 3) / 3.0) * 65535), q); + const unsigned int + pixel=ReadBlobLSBLong(image); + + SetPixelRed(image,ScaleShortToQuantum((unsigned short) + ((pixel & 0x3ff)/1023.0)*65535),q); + SetPixelBlue(image,ScaleShortToQuantum((unsigned short) + (((pixel >> 10) & 0x3ff)/1023.0)*65535),q); + SetPixelGreen(image,ScaleShortToQuantum((unsigned short) + (((pixel >> 20) & 0x3ff)/1023.0)*65535),q); + SetPixelAlpha(image,ScaleShortToQuantum((unsigned short) + (((pixel >> 30) & 3)/3.0)*65535),q); } else if (dds_info->extFormat == DXGI_FORMAT_R8G8B8A8_UNORM || IsBitMask(dds_info->pixelformat,0x000000ff,0x0000ff00,0x00ff0000,0xff000000)) @@ -2819,9 +2824,9 @@ static Image *ReadDDSImage(const ImageInfo *image_info,ExceptionInfo *exception) } case DXGI_FORMAT_R10G10B10A2_UNORM: { - compression = NoCompression; - alpha_trait = BlendPixelTrait; - decoder = ReadUncompressedRGBA; + compression=NoCompression; + alpha_trait=BlendPixelTrait; + decoder=ReadUncompressedRGBA; break; } case DXGI_FORMAT_B8G8R8X8_UNORM: