ReactOS 0.4.16-dev-1948-gd260c1d
ddsformat.c File Reference
#include <stdarg.h>
#include "windef.h"
#include "wincodec.h"
#include "wine/test.h"
Include dependency graph for ddsformat.c:

Go to the source code of this file.

Classes

struct  test_data
 

Macros

#define COBJMACROS
 
#define GET_RGB565_R(color)   ((BYTE)(((color) >> 11) & 0x1F))
 
#define GET_RGB565_G(color)   ((BYTE)(((color) >> 5) & 0x3F))
 
#define GET_RGB565_B(color)   ((BYTE)(((color) >> 0) & 0x1F))
 
#define MAKE_RGB565(r, g, b)   ((WORD)(((BYTE)(r) << 11) | ((BYTE)(g) << 5) | (BYTE)(b)))
 
#define MAKE_ARGB(a, r, g, b)   (((DWORD)(a) << 24) | ((DWORD)(r) << 16) | ((DWORD)(g) << 8) | (DWORD)(b))
 
#define BLOCK_WIDTH   4
 
#define BLOCK_HEIGHT   4
 

Functions

static IWICStreamcreate_stream (const void *image_data, UINT image_size)
 
static IWICBitmapDecodercreate_decoder (void)
 
static IWICBitmapEncodercreate_encoder (void)
 
static HRESULT init_decoder (IWICBitmapDecoder *decoder, IWICStream *stream, HRESULT expected, BOOL wine_init)
 
static void release_encoder (IWICBitmapEncoder *encoder, IWICDdsEncoder *dds_encoder, IWICStream *stream)
 
static HRESULT create_and_init_encoder (BYTE *image_buffer, UINT buffer_size, WICDdsParameters *params, IWICBitmapEncoder **encoder, IWICDdsEncoder **dds_encoder, IWICStream **stream)
 
static BOOL is_compressed (DXGI_FORMAT format)
 
static BOOL has_extended_header (const BYTE *data)
 
static DWORD rgb565_to_argb (WORD color, BYTE alpha)
 
static void decode_block (const BYTE *block_data, UINT block_count, DXGI_FORMAT format, UINT width, UINT height, DWORD *buffer)
 
static BOOL color_match (DWORD color_a, DWORD color_b)
 
static BOOL color_buffer_match (DWORD *color_buffer_a, DWORD *color_buffer_b, UINT color_count)
 
static void copy_pixels (void *src_buffer, UINT src_stride, void *dst_buffer, UINT dst_stride, UINT size)
 
static void test_dds_decoder_initialize (void)
 
static void test_dds_decoder_global_properties (IWICBitmapDecoder *decoder)
 
static void test_dds_decoder_image_parameters (void)
 
static void test_dds_decoder_frame_properties (IWICBitmapFrameDecode *frame_decode, IWICDdsFrameDecode *dds_frame, UINT frame_count, WICDdsParameters *params, struct test_data *test, UINT frame_index)
 
static void test_dds_decoder_frame_data (IWICBitmapFrameDecode *frame, IWICDdsFrameDecode *dds_frame, UINT frame_count, WICDdsParameters *params, struct test_data *test, UINT frame_index)
 
static void test_dds_decoder_frame (IWICBitmapDecoder *decoder, struct test_data *test)
 
static void test_dds_decoder (void)
 
static void test_dds_encoder_initialize (void)
 
static void test_dds_encoder_params (void)
 
static void test_dds_encoder_create_frame (void)
 
static void test_dds_encoder_pixel_format (void)
 
static void test_dds_encoder (void)
 
 START_TEST (ddsformat)
 

Variables

static BYTE test_dds_alpha []
 
static BYTE test_dds_luminance []
 
static BYTE test_dds_rgb565 []
 
static BYTE test_dds_24bpp []
 
static BYTE test_dds_32bpp_xrgb []
 
static BYTE test_dds_32bpp_argb []
 
static BYTE test_dds_64bpp []
 
static BYTE test_dds_96bpp []
 
static BYTE test_dds_128bpp []
 
static BYTE test_dds_cube []
 
static BYTE test_dds_cube_dx10 []
 
static BYTE test_dds_mipmaps []
 
static BYTE test_dds_volume []
 
static BYTE test_dds_array []
 
static BYTE test_dds_dxt1c []
 
static BYTE test_dds_dxt1a []
 
static BYTE test_dds_dxt2 []
 
static BYTE test_dds_dxt3 []
 
static BYTE test_dds_dxt4 []
 
static BYTE test_dds_dxt5 []
 
static BYTE test_dds_12x12 []
 
static BYTE test_dds_bad_magic [sizeof(test_dds_dxt1c)]
 
static BYTE test_dds_bad_header [sizeof(test_dds_dxt1c)]
 
static BYTE test_byte [1] = { 0 }
 
static BYTE test_word [2] = { 0 }
 
static BYTE test_dword [4] = { 0 }
 
static BYTE test_qword_a [8] = { 0 }
 
static BYTE test_qword_b [8] = "DDS "
 
static struct test_data test_data []
 
static DXGI_FORMAT compressed_formats []
 
static IWICImagingFactoryfactory = NULL
 

Macro Definition Documentation

◆ BLOCK_HEIGHT

#define BLOCK_HEIGHT   4

Definition at line 34 of file ddsformat.c.

◆ BLOCK_WIDTH

#define BLOCK_WIDTH   4

Definition at line 33 of file ddsformat.c.

◆ COBJMACROS

#define COBJMACROS

Definition at line 21 of file ddsformat.c.

◆ GET_RGB565_B

#define GET_RGB565_B (   color)    ((BYTE)(((color) >> 0) & 0x1F))

Definition at line 29 of file ddsformat.c.

◆ GET_RGB565_G

#define GET_RGB565_G (   color)    ((BYTE)(((color) >> 5) & 0x3F))

Definition at line 28 of file ddsformat.c.

◆ GET_RGB565_R

#define GET_RGB565_R (   color)    ((BYTE)(((color) >> 11) & 0x1F))

Definition at line 27 of file ddsformat.c.

◆ MAKE_ARGB

#define MAKE_ARGB (   a,
  r,
  g,
  b 
)    (((DWORD)(a) << 24) | ((DWORD)(r) << 16) | ((DWORD)(g) << 8) | (DWORD)(b))

Definition at line 31 of file ddsformat.c.

◆ MAKE_RGB565

#define MAKE_RGB565 (   r,
  g,
  b 
)    ((WORD)(((BYTE)(r) << 11) | ((BYTE)(g) << 5) | (BYTE)(b)))

Definition at line 30 of file ddsformat.c.

Function Documentation

◆ color_buffer_match()

static BOOL color_buffer_match ( DWORD color_buffer_a,
DWORD color_buffer_b,
UINT  color_count 
)
static

Definition at line 745 of file ddsformat.c.

746{
747 UINT i;
748
749 for (i = 0; i < color_count; i++)
750 {
751 if (!color_match(color_buffer_a[i], color_buffer_b[i])) return FALSE;
752 }
753
754 return TRUE;
755}
#define TRUE
Definition: types.h:120
#define FALSE
Definition: types.h:117
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
static BOOL color_match(DWORD color_a, DWORD color_b)
Definition: ddsformat.c:733
unsigned int UINT
Definition: ndis.h:50

Referenced by test_dds_decoder_frame_data().

◆ color_match()

static BOOL color_match ( DWORD  color_a,
DWORD  color_b 
)
static

Definition at line 733 of file ddsformat.c.

734{
735 static const int tolerance = 8;
736
737 const int da = abs((int)((color_a & 0xFF000000) >> 24) - (int)((color_b & 0xFF000000) >> 24));
738 const int dr = abs((int)((color_a & 0x00FF0000) >> 16) - (int)((color_b & 0x00FF0000) >> 16));
739 const int dg = abs((int)((color_a & 0x0000FF00) >> 8) - (int)((color_b & 0x0000FF00) >> 8));
740 const int db = abs((int)((color_a & 0x000000FF) >> 0) - (int)((color_b & 0x000000FF) >> 0));
741
742 return (da <= tolerance && dr <= tolerance && dg <= tolerance && db <= tolerance);
743}
#define abs(i)
Definition: fconv.c:206

Referenced by color_buffer_match().

◆ copy_pixels()

static void copy_pixels ( void src_buffer,
UINT  src_stride,
void dst_buffer,
UINT  dst_stride,
UINT  size 
)
static

Definition at line 757 of file ddsformat.c.

758{
759 char *src = src_buffer, *dst = dst_buffer;
760 UINT i;
761
762 for (i = 0; i < size; i++)
763 {
764 *dst = src[i];
765 if (i % src_stride == src_stride - 1) dst += dst_stride - src_stride;
766 dst ++;
767 }
768}
GLenum src
Definition: glext.h:6340
GLsizeiptr size
Definition: glext.h:5919
GLenum GLenum dst
Definition: glext.h:6340

◆ create_and_init_encoder()

static HRESULT create_and_init_encoder ( BYTE image_buffer,
UINT  buffer_size,
WICDdsParameters params,
IWICBitmapEncoder **  encoder,
IWICDdsEncoder **  dds_encoder,
IWICStream **  stream 
)
static

Definition at line 556 of file ddsformat.c.

558{
559 IWICDdsEncoder *dds = NULL;
560 HRESULT hr;
561
563 if (!*encoder) goto fail;
564
566 if (!*stream) goto fail;
567
568 hr = IWICBitmapEncoder_Initialize(*encoder, (IStream *)*stream, WICBitmapEncoderNoCache);
569 ok(hr == S_OK, "Initialize failed, hr %#lx\n", hr);
570 if (hr != S_OK) goto fail;
571
572 hr = IWICBitmapEncoder_QueryInterface(*encoder, &IID_IWICDdsEncoder, (void **)&dds);
573 ok(hr == S_OK, "QueryInterface failed, hr %#lx\n", hr);
574 if (hr != S_OK) goto fail;
575
576 if (params)
577 {
578 hr = IWICDdsEncoder_SetParameters(dds, params);
579 ok(hr == S_OK, "SetParameters failed, hr %#lx\n", hr);
580 if (hr != S_OK) goto fail;
581 }
582
583 if (dds_encoder)
584 {
585 *dds_encoder = dds;
586 }
587 else
588 {
589 IWICDdsEncoder_Release(dds);
590 dds = NULL;
591 }
592
593 return S_OK;
594
595fail:
597 return E_FAIL;
598}
#define ok(value,...)
Definition: atltest.h:57
#define E_FAIL
Definition: ddrawi.h:102
#define NULL
Definition: types.h:112
GLenum const GLfloat * params
Definition: glext.h:5645
#define S_OK
Definition: intsafe.h:52
JSAMPLE * image_buffer
static void release_encoder(IWICBitmapEncoder *encoder, IWICDdsEncoder *dds_encoder, IWICStream *stream)
Definition: ddsformat.c:549
static IWICStream * create_stream(const void *image_data, UINT image_size)
Definition: ddsformat.c:461
static IWICBitmapEncoder * create_encoder(void)
Definition: ddsformat.c:503
HRESULT hr
Definition: shlfolder.c:183
wchar_t const *const size_t const buffer_size
Definition: stat.cpp:95
Definition: parse.h:23
@ WICBitmapEncoderNoCache
Definition: wincodec.idl:73

Referenced by test_dds_encoder_create_frame(), test_dds_encoder_params(), and test_dds_encoder_pixel_format().

◆ create_decoder()

static IWICBitmapDecoder * create_decoder ( void  )
static

Definition at line 481 of file ddsformat.c.

482{
483 HRESULT hr;
485 GUID guidresult;
486
487 hr = CoCreateInstance(&CLSID_WICDdsDecoder, NULL, CLSCTX_INPROC_SERVER,
488 &IID_IWICBitmapDecoder, (void **)&decoder);
489 if (hr != S_OK) {
490 win_skip("Dds decoder is not supported\n");
491 return NULL;
492 }
493
494 memset(&guidresult, 0, sizeof(guidresult));
495 hr = IWICBitmapDecoder_GetContainerFormat(decoder, &guidresult);
496 ok(hr == S_OK, "GetContainerFormat failed, hr %#lx\n", hr);
497 ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatDds),
498 "Got unexpected container format %s\n", debugstr_guid(&guidresult));
499
500 return decoder;
501}
HRESULT WINAPI DECLSPEC_HOTPATCH CoCreateInstance(REFCLSID rclsid, LPUNKNOWN pUnkOuter, DWORD dwClsContext, REFIID iid, LPVOID *ppv)
Definition: compobj.c:3325
#define debugstr_guid
Definition: kernel32.h:35
#define win_skip
Definition: minitest.h:67
#define IsEqualGUID(rguid1, rguid2)
Definition: guiddef.h:147
#define memset(x, y, z)
Definition: compat.h:39

Referenced by test_chunk_size(), test_color_contexts(), test_color_formats(), test_dds_decoder(), test_dds_decoder_image_parameters(), test_dds_decoder_initialize(), test_gif_frame_sizes(), test_global_gif_palette(), test_global_gif_palette_2frames(), test_local_gif_palette(), test_no_gif_palette(), test_png_palette(), test_tiff_1bpp_palette(), test_tiff_24bpp(), test_tiff_4bps_bgra(), test_tiff_8bpp_alpha(), test_tiff_8bpp_palette(), and test_tiff_resolution().

◆ create_encoder()

static IWICBitmapEncoder * create_encoder ( void  )
static

Definition at line 503 of file ddsformat.c.

504{
506 GUID guidresult;
507 HRESULT hr;
508
509 hr = CoCreateInstance(&CLSID_WICDdsEncoder, NULL, CLSCTX_INPROC_SERVER,
510 &IID_IWICBitmapEncoder, (void **)&encoder);
511 if (hr != S_OK)
512 {
513 win_skip("DDS encoder is not supported\n");
514 return NULL;
515 }
516
517 memset(&guidresult, 0, sizeof(guidresult));
518
519 hr = IWICBitmapEncoder_GetContainerFormat(encoder, &guidresult);
520 ok(hr == S_OK, "GetContainerFormat failed, hr %#lx\n", hr);
521
522 ok(IsEqualGUID(&guidresult, &GUID_ContainerFormatDds),
523 "Got unexpected container format %s\n", debugstr_guid(&guidresult));
524
525 return encoder;
526}

Referenced by create_and_init_encoder(), and test_dds_encoder_initialize().

◆ create_stream()

static IWICStream * create_stream ( const void image_data,
UINT  image_size 
)
static

Definition at line 461 of file ddsformat.c.

462{
463 HRESULT hr;
465
466 hr = IWICImagingFactory_CreateStream(factory, &stream);
467 ok(hr == S_OK, "CreateStream failed, hr %#lx\n", hr);
468 if (hr != S_OK) goto fail;
469
470 hr = IWICStream_InitializeFromMemory(stream, (BYTE *)image_data, image_size);
471 ok(hr == S_OK, "InitializeFromMemory failed, hr %#lx\n", hr);
472 if (hr != S_OK) goto fail;
473
474 return stream;
475
476fail:
477 if (stream) IWICStream_Release(stream);
478 return NULL;
479}
static GLint image_size(GLint width, GLint height, GLenum format, GLenum type)
Definition: mipmap.c:4858
Definition: main.c:439
unsigned char BYTE
Definition: xxhash.c:193

Referenced by create_and_init_encoder(), test_dds_decoder(), test_dds_decoder_image_parameters(), test_dds_decoder_initialize(), and test_dds_encoder_initialize().

◆ decode_block()

static void decode_block ( const BYTE block_data,
UINT  block_count,
DXGI_FORMAT  format,
UINT  width,
UINT  height,
DWORD buffer 
)
static

Definition at line 622 of file ddsformat.c.

624{
625 const BYTE *block, *color_indices, *alpha_indices, *alpha_table;
626 int i, j, x, y, block_x, block_y, color_index, alpha_index;
627 int block_size, color_offset, color_indices_offset;
628 WORD color[4], color_value = 0;
629 BYTE alpha[8], alpha_value = 0;
630
632 block_size = 8;
633 color_offset = 0;
634 color_indices_offset = 4;
635 } else {
636 block_size = 16;
637 color_offset = 8;
638 color_indices_offset = 12;
639 }
640 block_x = 0;
641 block_y = 0;
642
643 for (i = 0; i < block_count; i++)
644 {
645 block = block_data + i * block_size;
646
647 color[0] = *((WORD *)(block + color_offset));
648 color[1] = *((WORD *)(block + color_offset + 2));
649 color[2] = MAKE_RGB565(((GET_RGB565_R(color[0]) * 2 + GET_RGB565_R(color[1]) + 1) / 3),
650 ((GET_RGB565_G(color[0]) * 2 + GET_RGB565_G(color[1]) + 1) / 3),
651 ((GET_RGB565_B(color[0]) * 2 + GET_RGB565_B(color[1]) + 1) / 3));
652 color[3] = MAKE_RGB565(((GET_RGB565_R(color[0]) + GET_RGB565_R(color[1]) * 2 + 1) / 3),
653 ((GET_RGB565_G(color[0]) + GET_RGB565_G(color[1]) * 2 + 1) / 3),
654 ((GET_RGB565_B(color[0]) + GET_RGB565_B(color[1]) * 2 + 1) / 3));
655
656 switch (format)
657 {
659 if (color[0] <= color[1]) {
660 color[2] = MAKE_RGB565(((GET_RGB565_R(color[0]) + GET_RGB565_R(color[1]) + 1) / 2),
661 ((GET_RGB565_G(color[0]) + GET_RGB565_G(color[1]) + 1) / 2),
662 ((GET_RGB565_B(color[0]) + GET_RGB565_B(color[1]) + 1) / 2));
663 color[3] = 0;
664 }
665 break;
667 alpha_table = block;
668 break;
670 alpha[0] = *block;
671 alpha[1] = *(block + 1);
672 if (alpha[0] > alpha[1]) {
673 for (j = 2; j < 8; j++)
674 {
675 alpha[j] = (BYTE)((alpha[0] * (8 - j) + alpha[1] * (j - 1) + 3) / 7);
676 }
677 } else {
678 for (j = 2; j < 6; j++)
679 {
680 alpha[j] = (BYTE)((alpha[0] * (6 - j) + alpha[1] * (j - 1) + 2) / 5);
681 }
682 alpha[6] = 0;
683 alpha[7] = 0xFF;
684 }
685 alpha_indices = block + 2;
686 break;
687 default:
688 break;
689 }
690
691 color_indices = block + color_indices_offset;
692 for (j = 0; j < 16; j++)
693 {
694 x = block_x + j % 4;
695 y = block_y + j / 4;
696 if (x >= width || y >= height) continue;
697
698 color_index = (color_indices[j / 4] >> ((j % 4) * 2)) & 0x3;
699 color_value = color[color_index];
700
701 switch (format)
702 {
704 if ((color[0] <= color[1]) && !color_value) {
705 color_value = 0;
706 alpha_value = 0;
707 } else {
708 alpha_value = 0xFF;
709 }
710 break;
712 alpha_value = (alpha_table[j / 2] >> (j % 2) * 4) & 0xF;
713 alpha_value = (BYTE)((alpha_value * 0xFF + 0x7)/ 0xF);
714 break;
716 alpha_index = (*((DWORD *)(alpha_indices + (j / 8) * 3)) >> ((j % 8) * 3)) & 0x7;
717 alpha_value = alpha[alpha_index];
718 break;
719 default:
720 break;
721 }
722 buffer[x + y * width] = rgb565_to_argb(color_value, alpha_value);
723 }
724
725 block_x += BLOCK_WIDTH;
726 if (block_x >= width) {
727 block_x = 0;
728 block_y += BLOCK_HEIGHT;
729 }
730 }
731}
#define GET_RGB565_B(color)
Definition: ddsformat.c:52
#define GET_RGB565_R(color)
Definition: ddsformat.c:50
#define MAKE_RGB565(r, g, b)
Definition: ddsformat.c:53
static DWORD rgb565_to_argb(WORD color, BYTE alpha)
Definition: ddsformat.c:308
#define GET_RGB565_G(color)
Definition: ddsformat.c:51
@ DXGI_FORMAT_BC1_UNORM
Definition: dxgiformat.idl:94
@ DXGI_FORMAT_BC3_UNORM
Definition: dxgiformat.idl:100
@ DXGI_FORMAT_BC2_UNORM
Definition: dxgiformat.idl:97
unsigned short WORD
Definition: ntddk_ex.h:93
unsigned long DWORD
Definition: ntddk_ex.h:95
GLint GLint GLint GLint GLint x
Definition: gl.h:1548
GLclampf GLclampf GLclampf alpha
Definition: gl.h:1740
GLint GLint GLint GLint GLint GLint y
Definition: gl.h:1548
GLint GLint GLsizei GLsizei height
Definition: gl.h:1546
GLint GLint GLsizei width
Definition: gl.h:1546
GLuint buffer
Definition: glext.h:5915
GLuint color
Definition: glext.h:6243
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
Definition: glfuncs.h:250
static DWORD block_size(DWORD block)
Definition: jsutils.c:66
#define BLOCK_HEIGHT
Definition: ddsformat.c:34
#define BLOCK_WIDTH
Definition: ddsformat.c:33
Definition: format.c:58
static unsigned int block
Definition: xmlmemory.c:101

◆ has_extended_header()

static BOOL has_extended_header ( const BYTE data)
static

Definition at line 610 of file ddsformat.c.

611{
612 return data[84] == 'D' && data[85] == 'X' && data[86] == '1' && data[87] == '0';
613}
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
Definition: gl.h:1950

◆ init_decoder()

static HRESULT init_decoder ( IWICBitmapDecoder decoder,
IWICStream stream,
HRESULT  expected,
BOOL  wine_init 
)
static

Definition at line 528 of file ddsformat.c.

529{
530 HRESULT hr;
531 IWICWineDecoder *wine_decoder;
532
533 hr = IWICBitmapDecoder_Initialize(decoder, (IStream*)stream, WICDecodeMetadataCacheOnDemand);
534 ok(hr == expected, "Expected hr %#lx, got %#lx\n", expected, hr);
535
536 if (hr != S_OK && wine_init) {
537 hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICWineDecoder, (void **)&wine_decoder);
538 ok(hr == S_OK || broken(hr != S_OK), "QueryInterface failed, hr %#lx\n", hr);
539
540 if (hr == S_OK) {
541 hr = IWICWineDecoder_Initialize(wine_decoder, (IStream*)stream, WICDecodeMetadataCacheOnDemand);
542 ok(hr == S_OK, "Initialize failed, hr %#lx\n", hr);
543 }
544 }
545
546 return hr;
547}
#define broken(x)
Definition: atltest.h:178
void wine_init(int argc, char *argv[], char *error, int error_size)
BOOL expected
Definition: store.c:2000
@ WICDecodeMetadataCacheOnDemand
Definition: wincodec.idl:29

Referenced by test_dds_decoder(), test_dds_decoder_image_parameters(), and test_dds_decoder_initialize().

◆ is_compressed()

static BOOL is_compressed ( DXGI_FORMAT  format)
static

Definition at line 600 of file ddsformat.c.

601{
602 UINT i;
603 for (i = 0; i < ARRAY_SIZE(compressed_formats); i++)
604 {
605 if (format == compressed_formats[i]) return TRUE;
606 }
607 return FALSE;
608}
#define ARRAY_SIZE(A)
Definition: main.h:20
static DXGI_FORMAT compressed_formats[]
Definition: ddsformat.c:296

◆ release_encoder()

static void release_encoder ( IWICBitmapEncoder encoder,
IWICDdsEncoder dds_encoder,
IWICStream stream 
)
static

Definition at line 549 of file ddsformat.c.

550{
551 if (dds_encoder) IWICDdsEncoder_Release(dds_encoder);
552 if (stream) IWICStream_Release(stream);
553 if (encoder) IWICBitmapEncoder_Release(encoder);
554}

Referenced by create_and_init_encoder(), test_dds_encoder_create_frame(), test_dds_encoder_params(), and test_dds_encoder_pixel_format().

◆ rgb565_to_argb()

static DWORD rgb565_to_argb ( WORD  color,
BYTE  alpha 
)
static

Definition at line 615 of file ddsformat.c.

616{
617 return MAKE_ARGB(alpha, (GET_RGB565_R(color) * 0xFF + 0x0F) / 0x1F,
618 (GET_RGB565_G(color) * 0xFF + 0x1F) / 0x3F,
619 (GET_RGB565_B(color) * 0xFF + 0x0F) / 0x1F);
620}
#define MAKE_ARGB(a, r, g, b)
Definition: ddsformat.c:54

◆ START_TEST()

START_TEST ( ddsformat  )

Definition at line 1559 of file ddsformat.c.

1560{
1561 HRESULT hr;
1563
1564 hr = CoCreateInstance(&CLSID_WICImagingFactory, NULL, CLSCTX_INPROC_SERVER,
1565 &IID_IWICImagingFactory, (void **)&factory);
1566 ok(hr == S_OK, "CoCreateInstance failed, hr %#lx\n", hr);
1567 if (hr != S_OK) goto end;
1568
1571
1572end:
1573 if (factory) IWICImagingFactory_Release(factory);
1575}
HRESULT WINAPI DECLSPEC_HOTPATCH CoInitializeEx(LPVOID lpReserved, DWORD dwCoInit)
Definition: compobj.c:2002
void WINAPI DECLSPEC_HOTPATCH CoUninitialize(void)
Definition: compobj.c:2067
GLuint GLuint end
Definition: gl.h:1545
static void test_dds_decoder(void)
Definition: ddsformat.c:1276
static void test_dds_encoder(void)
Definition: ddsformat.c:1551
@ COINIT_APARTMENTTHREADED
Definition: objbase.h:278

◆ test_dds_decoder()

static void test_dds_decoder ( void  )
static

Definition at line 1276 of file ddsformat.c.

1277{
1278 int i;
1279 HRESULT hr;
1280
1283
1284 for (i = 0; i < ARRAY_SIZE(test_data); i++)
1285 {
1288
1289 if (test_data[i].init_hr != S_OK && !test_data[i].wine_init) continue;
1290
1291 winetest_push_context("Test %u", i);
1292
1294 if (!stream) goto next;
1296 if (!decoder) goto next;
1298 if (hr != S_OK) {
1299 if (test_data[i].expected_parameters.Dimension == WICDdsTextureCube) {
1300 win_skip("Cube map is not supported\n");
1301 } else {
1302 win_skip("Uncompressed DDS image is not supported\n");
1303 }
1304 goto next;
1305 }
1306
1309
1310 next:
1311 if (decoder) IWICBitmapDecoder_Release(decoder);
1312 if (stream) IWICStream_Release(stream);
1314 }
1315}
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl winetest_push_context(const char *fmt,...) __WINE_PRINTF_ATTR(1
void __cdecl void __cdecl void __cdecl void __cdecl void __cdecl void winetest_pop_context(void)
static IWICBitmapDecoder * create_decoder(void)
Definition: ddsformat.c:481
static void test_dds_decoder_global_properties(IWICBitmapDecoder *decoder)
Definition: ddsformat.c:801
static void test_dds_decoder_frame(IWICBitmapDecoder *decoder, struct test_data *test)
Definition: ddsformat.c:1230
static void test_dds_decoder_image_parameters(void)
Definition: ddsformat.c:846
static HRESULT init_decoder(IWICBitmapDecoder *decoder, IWICStream *stream, HRESULT expected, BOOL wine_init)
Definition: ddsformat.c:528
static void test_dds_decoder_initialize(void)
Definition: ddsformat.c:770
static unsigned __int64 next
Definition: rand_nt.c:6
@ WICDdsTextureCube
Definition: wincodec.idl:201

Referenced by START_TEST().

◆ test_dds_decoder_frame()

static void test_dds_decoder_frame ( IWICBitmapDecoder decoder,
struct test_data test 
)
static

Definition at line 1230 of file ddsformat.c.

1231{
1232 HRESULT hr;
1233 IWICDdsDecoder *dds_decoder = NULL;
1234 UINT frame_count, j;
1236
1237 hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
1238 ok(hr == S_OK, "GetFrameCount failed, hr %#lx\n", hr);
1239 if (hr != S_OK) return;
1240 hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder);
1241 ok(hr == S_OK, "QueryInterface failed, hr %#lx\n", hr);
1242 if (hr != S_OK) goto end;
1243 hr = IWICDdsDecoder_GetParameters(dds_decoder, &params);
1244 ok(hr == S_OK, "GetParameters failed, hr %#lx\n", hr);
1245 if (hr != S_OK) goto end;
1246
1247 if (test->expected_parameters.Dimension == WICDdsTextureCube) params.ArraySize *= 6;
1248
1249 for (j = 0; j < frame_count; j++)
1250 {
1251 IWICBitmapFrameDecode *frame_decode = NULL;
1252 IWICDdsFrameDecode *dds_frame = NULL;
1253
1254 winetest_push_context("Frame %u", j);
1255
1256 hr = IWICBitmapDecoder_GetFrame(decoder, j, &frame_decode);
1257 ok(hr == S_OK, "GetFrame failed, hr %#lx\n", hr);
1258 if (hr != S_OK) goto next;
1259 hr = IWICBitmapFrameDecode_QueryInterface(frame_decode, &IID_IWICDdsFrameDecode, (void **)&dds_frame);
1260 ok(hr == S_OK, "QueryInterface failed, hr %#lx\n", hr);
1261 if (hr != S_OK) goto next;
1262
1263 test_dds_decoder_frame_properties(frame_decode, dds_frame, frame_count, &params, test, j);
1264 test_dds_decoder_frame_data(frame_decode, dds_frame, frame_count, &params, test, j);
1265
1266 next:
1267 if (frame_decode) IWICBitmapFrameDecode_Release(frame_decode);
1268 if (dds_frame) IWICDdsFrameDecode_Release(dds_frame);
1270 }
1271
1272end:
1273 if (dds_decoder) IWICDdsDecoder_Release(dds_decoder);
1274}
static void test_dds_decoder_frame_properties(IWICBitmapFrameDecode *frame_decode, IWICDdsFrameDecode *dds_frame, UINT frame_count, WICDdsParameters *params, struct test_data *test, UINT frame_index)
Definition: ddsformat.c:933
static void test_dds_decoder_frame_data(IWICBitmapFrameDecode *frame, IWICDdsFrameDecode *dds_frame, UINT frame_count, WICDdsParameters *params, struct test_data *test, UINT frame_index)
Definition: ddsformat.c:1030
#define test
Definition: rosglue.h:37

Referenced by test_dds_decoder().

◆ test_dds_decoder_frame_data()

static void test_dds_decoder_frame_data ( IWICBitmapFrameDecode frame,
IWICDdsFrameDecode dds_frame,
UINT  frame_count,
WICDdsParameters params,
struct test_data test,
UINT  frame_index 
)
static

Definition at line 1030 of file ddsformat.c.

1032{
1033 HRESULT hr;
1036 WICRect rect = { 0, 0, 1, 1 }, rect_test_a = { 0, 0, 0, 0 }, rect_test_b = { 0, 0, 0xdeadbeaf, 0xdeadbeaf };
1037 WICRect rect_test_c = { -0xdeadbeaf, -0xdeadbeaf, 1, 1 }, rect_test_d = { 0xdeadbeaf, 0xdeadbeaf, 1, 1 };
1038 BYTE buffer[2048], pixels[2048];
1039 UINT stride, frame_stride, frame_size, frame_width, frame_height, width_in_blocks, height_in_blocks, bpp;
1040 UINT width, height, depth, array_index;
1041 UINT block_offset;
1042 int slice_index;
1043
1044 hr = IWICBitmapFrameDecode_GetPixelFormat(frame, &pixel_format);
1045 ok(hr == S_OK, "GetPixelFormat failed, hr %#lx\n", hr);
1046 if (hr != S_OK) return;
1047 hr = IWICBitmapFrameDecode_GetSize(frame, &frame_width, &frame_height);
1048 ok(hr == S_OK, "GetSize failed, hr %#lx\n", hr);
1049 if (hr != S_OK) return;
1050 hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, &format_info);
1051 ok(hr == S_OK, "GetFormatInfo failed, hr %#lx\n", hr);
1052 if (hr != S_OK) return;
1053 hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, &height_in_blocks);
1054 ok(hr == S_OK, "GetSizeInBlocks failed, hr %#lx\n", hr);
1055 if (hr != S_OK) return;
1056 stride = rect.Width * format_info.BytesPerBlock;
1057 frame_stride = width_in_blocks * format_info.BytesPerBlock;
1058 frame_size = frame_stride * height_in_blocks;
1059
1060 /* CopyBlocks tests */
1061
1062 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, 0, 0, NULL);
1063 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1064
1065 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_a, stride, sizeof(buffer), buffer);
1066 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1067 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_b, stride, sizeof(buffer), buffer);
1068 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1069 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_c, stride, sizeof(buffer), buffer);
1070 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1071 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect_test_d, stride, sizeof(buffer), buffer);
1072 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1073
1074 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride - 1, sizeof(buffer), buffer);
1075 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1076 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride * 2, sizeof(buffer), buffer);
1077 ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
1078 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer);
1079 ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
1080 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, frame_stride * height_in_blocks - 1, buffer);
1081 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1082 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, frame_stride * height_in_blocks, buffer);
1083 ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
1084
1085 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, 0, sizeof(buffer), buffer);
1086 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1087 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride - 1, sizeof(buffer), buffer);
1088 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1089 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride * 2, sizeof(buffer), buffer);
1090 ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
1091
1092 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, 0, buffer);
1093 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1094 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, 1, buffer);
1095 ok(hr == E_INVALIDARG || (hr == S_OK && test->expected_bytes_per_block == 1),
1096 "CopyBlocks got unexpected hr %#lx\n", hr);
1097 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, stride * rect.Height - 1, buffer);
1098 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1099 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, stride * rect.Height, buffer);
1100 ok(hr == S_OK, "CopyBlocks got unexpected hr %#lx\n", hr);
1101
1102 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), NULL);
1103 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1104
1105 block_offset = 128; /* DDS magic and header */
1106 if (has_extended_header(test->data)) block_offset += 20; /* DDS extended header */
1107 width = params->Width;
1108 height = params->Height;
1109 depth = params->Depth;
1110 slice_index = frame_index % (frame_count / params->ArraySize);
1111 array_index = frame_index / (frame_count / params->ArraySize);
1112 block_offset += (test->size - block_offset) / params->ArraySize * array_index;
1113 while (slice_index >= 0)
1114 {
1115 width_in_blocks = (width + format_info.BlockWidth - 1) / format_info.BlockWidth;
1116 height_in_blocks = (width + format_info.BlockWidth - 1) / format_info.BlockWidth;
1117 block_offset += (slice_index >= depth) ?
1118 (width_in_blocks * height_in_blocks * format_info.BytesPerBlock * depth) :
1119 (width_in_blocks * height_in_blocks * format_info.BytesPerBlock * slice_index);
1120 if (width > 1) width /= 2;
1121 if (height > 1) height /= 2;
1122 slice_index -= depth;
1123 if (depth > 1) depth /= 2;
1124 }
1125
1126 memset(buffer, 0, sizeof(buffer));
1127 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, &rect, stride, sizeof(buffer), buffer);
1128 ok(hr == S_OK, "CopyBlocks failed, hr %#lx\n", hr);
1129 if (hr != S_OK) return;
1130 ok(!memcmp(test->data + block_offset, buffer, format_info.BytesPerBlock),
1131 "Block data mismatch\n");
1132
1133 memset(buffer, 0, sizeof(buffer));
1134 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride, sizeof(buffer), buffer);
1135 ok(hr == S_OK, "CopyBlocks failed, hr %#lx\n", hr);
1136 if (hr != S_OK) return;
1137 ok(!memcmp(test->data + block_offset, buffer, frame_size),
1138 "Block data mismatch\n");
1139
1140 memset(buffer, 0, sizeof(buffer));
1141 memset(pixels, 0, sizeof(pixels));
1142 copy_pixels(test->data + block_offset, frame_stride, pixels, frame_stride * 2, frame_size);
1143 hr = IWICDdsFrameDecode_CopyBlocks(dds_frame, NULL, frame_stride * 2, sizeof(buffer), buffer);
1144 ok(hr == S_OK, "CopyBlocks failed, hr %#lx\n", hr);
1145 if (hr != S_OK) return;
1146 ok(!memcmp(pixels, buffer, frame_size),
1147 "Block data mismatch\n");
1148
1149 /* CopyPixels tests */
1150
1151 bpp = test->pixel_format_bpp;
1152 stride = rect.Width * bpp / 8;
1153 frame_stride = frame_width * bpp / 8;
1154 frame_size = frame_stride * frame_height;
1155
1156 hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, 0, 0, NULL);
1157 ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
1158
1159 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect_test_a, stride, sizeof(buffer), buffer);
1160 ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
1161 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect_test_b, stride, sizeof(buffer), buffer);
1162 ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
1163 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect_test_c, stride, sizeof(buffer), buffer);
1164 ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
1165 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect_test_d, stride, sizeof(buffer), buffer);
1166 ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
1167
1168 hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride - 1, sizeof(buffer), buffer);
1169 ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
1170 hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride * 2, sizeof(buffer), buffer);
1171 ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
1172 hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride, sizeof(buffer), buffer);
1173 ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
1174 hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride, frame_stride * frame_height - 1, buffer);
1175 ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#lx\n", hr);
1176 hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride, frame_stride * frame_height, buffer);
1177 ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
1178
1179 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, 0, sizeof(buffer), buffer);
1180 ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
1181 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride - 1, sizeof(buffer), buffer);
1182 ok(hr == E_INVALIDARG, "CopyPixels got unexpected hr %#lx\n", hr);
1183 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride * 2, sizeof(buffer), buffer);
1184 ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
1185
1186 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, 0, buffer);
1187 ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#lx\n", hr);
1188 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, 1, buffer);
1189 ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER || (hr == S_OK && test->expected_bytes_per_block == 1),
1190 "CopyPixels got unexpected hr %#lx\n", hr);
1191 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, stride * rect.Height - 1, buffer);
1192 ok(hr == WINCODEC_ERR_INSUFFICIENTBUFFER, "CopyPixels got unexpected hr %#lx\n", hr);
1193 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, stride * rect.Height, buffer);
1194 ok(hr == S_OK, "CopyPixels got unexpected hr %#lx\n", hr);
1195
1196 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, sizeof(buffer), NULL);
1197 ok(hr == E_INVALIDARG, "CopyBlocks got unexpected hr %#lx\n", hr);
1198
1199 memset(buffer, 0, sizeof(pixels));
1200 if (is_compressed(format_info.DxgiFormat)) {
1201 decode_block(test->data + block_offset, width_in_blocks * height_in_blocks,
1202 format_info.DxgiFormat, frame_width, frame_height, (DWORD *)pixels);
1203 } else {
1204 memcpy(pixels, test->data + block_offset, frame_size);
1205 }
1206
1207 memset(buffer, 0, sizeof(buffer));
1208 hr = IWICBitmapFrameDecode_CopyPixels(frame, &rect, stride, sizeof(buffer), buffer);
1209 ok(hr == S_OK, "CopyPixels failed, hr %#lx\n", hr);
1210 if (hr == S_OK) {
1211 if (is_compressed(format_info.DxgiFormat)) {
1212 ok(color_buffer_match((DWORD *)pixels, (DWORD *)buffer, 1), "Pixels mismatch\n");
1213 } else {
1214 ok(!memcmp(pixels, buffer, bpp / 8), "Pixels mismatch\n");
1215 }
1216 }
1217
1218 memset(buffer, 0, sizeof(buffer));
1219 hr = IWICBitmapFrameDecode_CopyPixels(frame, NULL, frame_stride, sizeof(buffer), buffer);
1220 ok(hr == S_OK, "CopyPixels failed, hr %#lx\n", hr);
1221 if (hr == S_OK) {
1222 if (is_compressed(format_info.DxgiFormat)) {
1223 ok(color_buffer_match((DWORD *)pixels, (DWORD *)buffer, frame_size / (bpp / 8)), "Pixels mismatch\n");
1224 } else {
1225 ok(!memcmp(pixels, buffer, frame_size), "Pixels mismatch\n");
1226 };
1227 }
1228}
int memcmp(void *Buffer1, void *Buffer2, ACPI_SIZE Count)
Definition: utclib.c:112
while(CdLookupNextInitialFileDirent(IrpContext, Fcb, FileContext))
void copy_pixels(const BYTE *src, UINT src_row_pitch, UINT src_slice_pitch, BYTE *dst, UINT dst_row_pitch, UINT dst_slice_pitch, const struct volume *size, const struct pixel_format_desc *format) DECLSPEC_HIDDEN
Definition: surface.c:1700
format_info
#define E_INVALIDARG
Definition: ddrawi.h:101
DWORD bpp
Definition: surface.c:185
static void decode_block(const BYTE *block_data, UINT block_count, DXGI_FORMAT format, UINT width, UINT height, DWORD *buffer)
Definition: ddsformat.c:604
static BOOL has_extended_header(DDS_HEADER *header)
Definition: ddsformat.c:315
static BOOL is_compressed(DXGI_FORMAT format)
Definition: ddsformat.c:548
GLint GLint GLsizei GLsizei GLsizei depth
Definition: gl.h:1546
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
Definition: gl.h:1546
GLsizei stride
Definition: glext.h:5848
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
static BOOL color_buffer_match(DWORD *color_buffer_a, DWORD *color_buffer_b, UINT color_count)
Definition: ddsformat.c:745
& rect
Definition: startmenu.cpp:1413
#define WINCODEC_ERR_INSUFFICIENTBUFFER
Definition: winerror.h:7322

Referenced by test_dds_decoder_frame().

◆ test_dds_decoder_frame_properties()

static void test_dds_decoder_frame_properties ( IWICBitmapFrameDecode frame_decode,
IWICDdsFrameDecode dds_frame,
UINT  frame_count,
WICDdsParameters params,
struct test_data test,
UINT  frame_index 
)
static

Definition at line 933 of file ddsformat.c.

935{
936 HRESULT hr;
937 UINT width, height ,expected_width, expected_height, slice_index, depth;
938 UINT width_in_blocks, height_in_blocks, expected_width_in_blocks, expected_height_in_blocks;
939 UINT expected_block_width, expected_block_height;
942
943 /* frame size tests */
944
945 hr = IWICBitmapFrameDecode_GetSize(frame_decode, NULL, NULL);
946 ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#lx\n", hr);
947 hr = IWICBitmapFrameDecode_GetSize(frame_decode, NULL, &height);
948 ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#lx\n", hr);
949 hr = IWICBitmapFrameDecode_GetSize(frame_decode, &width, NULL);
950 ok(hr == E_INVALIDARG, "GetSize got unexpected hr %#lx\n", hr);
951 hr = IWICBitmapFrameDecode_GetSize(frame_decode, &width, &height);
952 ok(hr == S_OK, "GetSize failed, hr %#lx\n", hr);
953 if (hr != S_OK) return;
954
955 depth = params->Depth;
956 expected_width = params->Width;
957 expected_height = params->Height;
958 slice_index = frame_index % (frame_count / params->ArraySize);
959 while (slice_index >= depth)
960 {
961 if (expected_width > 1) expected_width /= 2;
962 if (expected_height > 1) expected_height /= 2;
963 slice_index -= depth;
964 if (depth > 1) depth /= 2;
965 }
966 ok(width == expected_width, "Expected width %u, got %u\n", expected_width, width);
967 ok(height == expected_height, "Expected height %u, got %u\n", expected_height, height);
968
969 /* frame format information tests */
970
971 if (is_compressed(test->expected_parameters.DxgiFormat)) {
972 expected_block_width = BLOCK_WIDTH;
973 expected_block_height = BLOCK_HEIGHT;
974 } else {
975 expected_block_width = 1;
976 expected_block_height = 1;
977 }
978
979 hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, NULL);
980 ok(hr == E_INVALIDARG, "GetFormatInfo got unexpected hr %#lx\n", hr);
981 hr = IWICDdsFrameDecode_GetFormatInfo(dds_frame, &format_info);
982 ok(hr == S_OK, "GetFormatInfo failed, hr %#lx\n", hr);
983 if (hr != S_OK) return;
984
985 ok(format_info.DxgiFormat == test->expected_parameters.DxgiFormat,
986 "Expected DXGI format %#x, got %#x\n",
987 test->expected_parameters.DxgiFormat, format_info.DxgiFormat);
988 ok(format_info.BytesPerBlock == test->expected_bytes_per_block,
989 "Expected bytes per block %u, got %u\n",
990 test->expected_bytes_per_block, format_info.BytesPerBlock);
991 ok(format_info.BlockWidth == expected_block_width,
992 "Expected block width %u, got %u\n",
993 expected_block_width, format_info.BlockWidth);
994 ok(format_info.BlockHeight == expected_block_height,
995 "Expected block height %u, got %u\n",
996 expected_block_height, format_info.BlockHeight);
997
998
999 /* size in blocks tests */
1000
1001 hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, NULL, NULL);
1002 ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#lx\n", hr);
1003 hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, NULL, &height_in_blocks);
1004 ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#lx\n", hr);
1005 hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, NULL);
1006 ok(hr == E_INVALIDARG, "GetSizeInBlocks got unexpected hr %#lx\n", hr);
1007 hr = IWICDdsFrameDecode_GetSizeInBlocks(dds_frame, &width_in_blocks, &height_in_blocks);
1008 ok(hr == S_OK, "GetSizeInBlocks failed, hr %#lx\n", hr);
1009 if (hr != S_OK) return;
1010
1011 expected_width_in_blocks = (expected_width + expected_block_width - 1) / expected_block_width;
1012 expected_height_in_blocks = (expected_height + expected_block_height - 1) / expected_block_height;
1013 ok(width_in_blocks == expected_width_in_blocks,
1014 "Expected width in blocks %u, got %u\n", expected_width_in_blocks, width_in_blocks);
1015 ok(height_in_blocks == expected_height_in_blocks,
1016 "Expected height in blocks %u, got %u\n", expected_height_in_blocks, height_in_blocks);
1017
1018 /* pixel format tests */
1019
1020 hr = IWICBitmapFrameDecode_GetPixelFormat(frame_decode, NULL);
1021 ok(hr == E_INVALIDARG, "GetPixelFormat got unexpected hr %#lx\n", hr);
1022 hr = IWICBitmapFrameDecode_GetPixelFormat(frame_decode, &pixel_format);
1023 ok(hr == S_OK, "GetPixelFormat failed, hr %#lx\n", hr);
1024 if (hr != S_OK) return;
1025 ok(IsEqualGUID(&pixel_format, test->expected_pixel_format),
1026 "Expected pixel format %s, got %s\n",
1027 debugstr_guid(test->expected_pixel_format), debugstr_guid(&pixel_format));
1028}

Referenced by test_dds_decoder_frame().

◆ test_dds_decoder_global_properties()

static void test_dds_decoder_global_properties ( IWICBitmapDecoder decoder)
static

Definition at line 801 of file ddsformat.c.

802{
803 HRESULT hr;
805 IWICMetadataQueryReader *metadata_reader = NULL;
806 IWICBitmapSource *preview = NULL, *thumnail = NULL;
807 IWICColorContext *color_context = NULL;
808 UINT count;
809
810 hr = IWICImagingFactory_CreatePalette(factory, &palette);
811 ok(hr == S_OK, "CreatePalette failed, hr %#lx\n", hr);
812 if (hr == S_OK) {
813 hr = IWICBitmapDecoder_CopyPalette(decoder, palette);
814 ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "CopyPalette got unexpected hr %#lx\n", hr);
815 hr = IWICBitmapDecoder_CopyPalette(decoder, NULL);
816 ok(hr == WINCODEC_ERR_PALETTEUNAVAILABLE, "CopyPalette got unexpected hr %#lx\n", hr);
817 }
818
819 hr = IWICBitmapDecoder_GetMetadataQueryReader(decoder, &metadata_reader);
820 todo_wine ok (hr == S_OK, "GetMetadataQueryReader got unexpected hr %#lx\n", hr);
821 hr = IWICBitmapDecoder_GetMetadataQueryReader(decoder, NULL);
822 ok(hr == E_INVALIDARG, "GetMetadataQueryReader got unexpected hr %#lx\n", hr);
823
824 hr = IWICBitmapDecoder_GetPreview(decoder, &preview);
825 ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetPreview got unexpected hr %#lx\n", hr);
826 hr = IWICBitmapDecoder_GetPreview(decoder, NULL);
827 ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetPreview got unexpected hr %#lx\n", hr);
828
829 hr = IWICBitmapDecoder_GetColorContexts(decoder, 1, &color_context, &count);
830 ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts got unexpected hr %#lx\n", hr);
831 hr = IWICBitmapDecoder_GetColorContexts(decoder, 1, NULL, NULL);
832 ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "GetColorContexts got unexpected hr %#lx\n", hr);
833
834 hr = IWICBitmapDecoder_GetThumbnail(decoder, &thumnail);
835 ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "GetThumbnail got unexpected hr %#lx\n", hr);
836 hr = IWICBitmapDecoder_GetThumbnail(decoder, NULL);
837 ok(hr == WINCODEC_ERR_CODECNOTHUMBNAIL, "GetThumbnail got unexpected hr %#lx\n", hr);
838
839 if (palette) IWICPalette_Release(palette);
840 if (metadata_reader) IWICMetadataQueryReader_Release(metadata_reader);
841 if (preview) IWICBitmapSource_Release(preview);
842 if (color_context) IWICColorContext_Release(color_context);
843 if (thumnail) IWICBitmapSource_Release(thumnail);
844}
static previewinfo preview
Definition: print.c:56
GLuint GLuint GLsizei count
Definition: gl.h:1545
#define todo_wine
Definition: minitest.h:80
static HPALETTE palette
Definition: clipboard.c:1341
#define WINCODEC_ERR_UNSUPPORTEDOPERATION
Definition: winerror.h:7319
#define WINCODEC_ERR_PALETTEUNAVAILABLE
Definition: winerror.h:7303
#define WINCODEC_ERR_CODECNOTHUMBNAIL
Definition: winerror.h:7302

Referenced by test_dds_decoder().

◆ test_dds_decoder_image_parameters()

static void test_dds_decoder_image_parameters ( void  )
static

Definition at line 846 of file ddsformat.c.

847{
848 int i;
849 HRESULT hr;
850 WICDdsParameters parameters;
851
852 for (i = 0; i < ARRAY_SIZE(test_data); i++)
853 {
854 UINT frame_count;
857 IWICDdsDecoder *dds_decoder = NULL;
858
859 winetest_push_context("Test %u", i);
860
862 if (!stream) goto next;
863
865 if (!decoder) goto next;
866
867 hr = IWICBitmapDecoder_QueryInterface(decoder, &IID_IWICDdsDecoder, (void **)&dds_decoder);
868 ok(hr == S_OK, "QueryInterface failed, hr %#lx\n", hr);
869 if (hr != S_OK) goto next;
870
871 hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
872 ok(hr == WINCODEC_ERR_WRONGSTATE, "GetFrameCount got unexpected hr %#lx\n", hr);
873 hr = IWICBitmapDecoder_GetFrameCount(decoder, NULL);
874 ok(hr == E_INVALIDARG, "GetFrameCount got unexpected hr %#lx\n", hr);
875
876 hr = IWICDdsDecoder_GetParameters(dds_decoder, &parameters);
877 ok(hr == WINCODEC_ERR_WRONGSTATE, "GetParameters got unexpected hr %#lx\n", hr);
878 hr = IWICDdsDecoder_GetParameters(dds_decoder, NULL);
879 ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#lx\n", hr);
880
881 if (test_data[i].init_hr != S_OK && !test_data[i].wine_init) goto next;
882
884 if (hr != S_OK) {
885 if (test_data[i].expected_parameters.Dimension == WICDdsTextureCube) {
886 win_skip("Cube map is not supported\n");
887 } else {
888 win_skip("Uncompressed DDS image is not supported\n");
889 }
890 goto next;
891 }
892
893 hr = IWICBitmapDecoder_GetFrameCount(decoder, &frame_count);
894 ok(hr == S_OK, "GetFrameCount failed, hr %#lx\n", hr);
895 if (hr == S_OK) {
896 ok(frame_count == test_data[i].expected_frame_count, "Expected frame count %u, got %u\n",
897 test_data[i].expected_frame_count, frame_count);
898 }
899 hr = IWICBitmapDecoder_GetFrameCount(decoder, NULL);
900 ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#lx\n", hr);
901
902 hr = IWICDdsDecoder_GetParameters(dds_decoder, &parameters);
903 ok(hr == S_OK, "GetParameters failed, hr %#lx\n", hr);
904 if (hr == S_OK) {
906 "Expected Width %u, got %u\n", test_data[i].expected_parameters.Width, parameters.Width);
908 "Expected Height %u, got %u\n", test_data[i].expected_parameters.Height, parameters.Height);
910 "Expected Depth %u, got %u\n", test_data[i].expected_parameters.Depth, parameters.Depth);
912 "Expected MipLevels %u, got %u\n", test_data[i].expected_parameters.MipLevels, parameters.MipLevels);
914 "Expected ArraySize %u, got %u\n", test_data[i].expected_parameters.ArraySize, parameters.ArraySize);
916 "Expected DxgiFormat %#x, got %#x\n", test_data[i].expected_parameters.DxgiFormat, parameters.DxgiFormat);
918 "Expected Dimension %#x, got %#x\n", test_data[i].expected_parameters.Dimension, parameters.Dimension);
920 "Expected AlphaMode %#x, got %#x\n", test_data[i].expected_parameters.AlphaMode, parameters.AlphaMode);
921 }
922 hr = IWICDdsDecoder_GetParameters(dds_decoder, NULL);
923 ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#lx\n", hr);
924
925 next:
926 if (decoder) IWICBitmapDecoder_Release(decoder);
927 if (stream) IWICStream_Release(stream);
928 if (dds_decoder) IWICDdsDecoder_Release(dds_decoder);
930 }
931}
WICDdsAlphaMode AlphaMode
Definition: wincodec.idl:354
WICDdsDimension Dimension
Definition: wincodec.idl:353
DXGI_FORMAT DxgiFormat
Definition: wincodec.idl:352
WICDdsParameters expected_parameters
Definition: ddsformat.c:395
#define WINCODEC_ERR_WRONGSTATE
Definition: winerror.h:7292

Referenced by test_dds_decoder().

◆ test_dds_decoder_initialize()

static void test_dds_decoder_initialize ( void  )
static

Definition at line 770 of file ddsformat.c.

771{
772 int i;
773
776 test_dds_bad_magic[0] = 0;
777 test_dds_bad_header[4] = 0;
778
779 for (i = 0; i < ARRAY_SIZE(test_data); i++)
780 {
783
784 winetest_push_context("Test %u", i);
785
787 if (!stream) goto next;
788
790 if (!decoder) goto next;
791
793
794 next:
795 if (decoder) IWICBitmapDecoder_Release(decoder);
796 if (stream) IWICStream_Release(stream);
798 }
799}
static BYTE test_dds_dxt1c[]
Definition: ddsformat.c:248
static BYTE test_dds_bad_header[sizeof(test_dds_dxt1c)]
Definition: ddsformat.c:380
static BYTE test_dds_bad_magic[sizeof(test_dds_dxt1c)]
Definition: ddsformat.c:379

Referenced by test_dds_decoder().

◆ test_dds_encoder()

static void test_dds_encoder ( void  )
static

Definition at line 1551 of file ddsformat.c.

1552{
1557}
static void test_dds_encoder_pixel_format(void)
Definition: ddsformat.c:1481
static void test_dds_encoder_create_frame(void)
Definition: ddsformat.c:1440
static void test_dds_encoder_initialize(void)
Definition: ddsformat.c:1317
static void test_dds_encoder_params(void)
Definition: ddsformat.c:1371

Referenced by START_TEST().

◆ test_dds_encoder_create_frame()

static void test_dds_encoder_create_frame ( void  )
static

Definition at line 1440 of file ddsformat.c.

1441{
1444 IWICBitmapFrameEncode *frame0 = NULL, *frame1 = NULL;
1445 UINT array_index, mip_level, slice_index;
1446 IWICDdsEncoder *dds_encoder = NULL;
1449 BYTE buffer[1024];
1450 HRESULT hr;
1451
1452 hr = create_and_init_encoder(buffer, sizeof(buffer), &params, &encoder, &dds_encoder, &stream);
1453 if (hr != S_OK) goto end;
1454
1455 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame0, NULL);
1456 ok(hr == S_OK, "CreateNewFrame failed, hr %#lx\n", hr);
1457 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame1, NULL);
1458 ok(hr == WINCODEC_ERR_WRONGSTATE, "CreateNewFrame got unexpected hr %#lx\n", hr);
1459
1460 IWICBitmapFrameEncode_Release(frame0);
1461 hr = IWICBitmapEncoder_CreateNewFrame(encoder, &frame1, NULL);
1462 ok(hr == WINCODEC_ERR_WRONGSTATE, "CreateNewFrame got unexpected hr %#lx\n", hr);
1463
1464 release_encoder(encoder, dds_encoder, stream);
1465
1466 create_and_init_encoder(buffer, sizeof(buffer), &params, &encoder, &dds_encoder, &stream);
1467 hr = IWICDdsEncoder_CreateNewFrame(dds_encoder, &frame0, &array_index, &mip_level, &slice_index);
1468 ok(hr == S_OK, "CreateNewFrame failed, hr %#lx\n", hr);
1469 IWICBitmapFrameEncode_Release(frame0);
1470 release_encoder(encoder, dds_encoder, stream);
1471
1472 create_and_init_encoder(buffer, sizeof(buffer), &params, &encoder, &dds_encoder, &stream);
1473 hr = IWICDdsEncoder_CreateNewFrame(dds_encoder, &frame0, NULL, NULL, NULL);
1474 ok(hr == S_OK, "CreateNewFrame failed, hr %#lx\n", hr);
1475 IWICBitmapFrameEncode_Release(frame0);
1476
1477end:
1478 release_encoder(encoder, dds_encoder, stream);
1479}
static HRESULT create_and_init_encoder(BYTE *image_buffer, UINT buffer_size, WICDdsParameters *params, IWICBitmapEncoder **encoder, IWICDdsEncoder **dds_encoder, IWICStream **stream)
Definition: ddsformat.c:556
@ WICDdsTexture2D
Definition: wincodec.idl:199
@ WICDdsAlphaModePremultiplied
Definition: wincodec.idl:208

Referenced by test_dds_encoder().

◆ test_dds_encoder_initialize()

static void test_dds_encoder_initialize ( void  )
static

Definition at line 1317 of file ddsformat.c.

1318{
1321 BYTE buffer[1];
1322 HRESULT hr;
1323
1325 if (!encoder) goto end;
1326
1327 stream = create_stream(buffer, sizeof(buffer));
1328 if (!stream) goto end;
1329
1330 /* initialize with invalid cache option */
1331
1332 hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, 0xdeadbeef);
1333 todo_wine
1334 ok(hr == WINCODEC_ERR_UNSUPPORTEDOPERATION, "Initialize got unexpected hr %#lx\n", hr);
1335
1336 hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
1337 todo_wine
1338 ok(hr == E_INVALIDARG, "Initialize got unexpected hr %#lx\n", hr);
1339
1340 IWICBitmapEncoder_Release(encoder);
1341
1342 /* initialize with null stream */
1343
1345 if (!encoder) goto end;
1346
1347 hr = IWICBitmapEncoder_Initialize(encoder, NULL, WICBitmapEncoderNoCache);
1348 ok(hr == E_INVALIDARG, "Initialize got unexpected hr %#lx\n", hr);
1349
1350 hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
1351 ok(hr == S_OK, "Initialize failed, hr %#lx\n", hr);
1352
1353 IWICBitmapEncoder_Release(encoder);
1354
1355 /* regularly initialize */
1356
1358 if (!encoder) goto end;
1359
1360 hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
1361 ok(hr == S_OK, "Initialize failed, hr %#lx\n", hr);
1362
1363 hr = IWICBitmapEncoder_Initialize(encoder, (IStream *)stream, WICBitmapEncoderNoCache);
1364 ok(hr == WINCODEC_ERR_WRONGSTATE, "Initialize got unexpected hr %#lx\n", hr);
1365
1366end:
1367 if (stream) IWICStream_Release(stream);
1368 if (encoder) IWICBitmapEncoder_Release(encoder);
1369}

Referenced by test_dds_encoder().

◆ test_dds_encoder_params()

static void test_dds_encoder_params ( void  )
static

Definition at line 1371 of file ddsformat.c.

1372{
1373 WICDdsParameters params, params_set = { 4, 4, 4, 3, 1, DXGI_FORMAT_BC1_UNORM,
1375 IWICDdsEncoder *dds_encoder = NULL;
1378 BYTE buffer[1024];
1379 HRESULT hr;
1380 UINT i;
1381
1382 hr = create_and_init_encoder(buffer, sizeof(buffer), NULL, &encoder, &dds_encoder, &stream);
1383 if (hr != S_OK) goto end;
1384
1385 hr = IWICDdsEncoder_GetParameters(dds_encoder, NULL);
1386 ok(hr == E_INVALIDARG, "GetParameters got unexpected hr %#lx\n", hr);
1387
1388 hr = IWICDdsEncoder_GetParameters(dds_encoder, &params);
1389 ok(hr == S_OK, "GetParameters failed, hr %#lx\n", hr);
1390 if (hr != S_OK) goto end;
1391
1392 /* default DDS parameters for encoder */
1393 ok(params.Width == 1, "Got unexpected Width %u\n", params.Width);
1394 ok(params.Height == 1, "Got unexpected Height %u\n", params.Height);
1395 ok(params.Depth == 1, "Got unexpected Depth %u\n", params.Depth);
1396 ok(params.MipLevels == 1, "Got unexpected MipLevels %u\n", params.MipLevels);
1397 ok(params.ArraySize == 1, "Got unexpected ArraySize %u\n", params.ArraySize);
1398 ok(params.DxgiFormat == DXGI_FORMAT_BC3_UNORM, "Got unexpected DxgiFormat %#x\n", params.DxgiFormat);
1399 ok(params.Dimension == WICDdsTexture2D, "Got unexpected Dimension %#x\n", params.Dimension);
1400 ok(params.AlphaMode == WICDdsAlphaModeUnknown, "Got unexpected AlphaMode %#x\n", params.AlphaMode);
1401
1402 hr = IWICDdsEncoder_SetParameters(dds_encoder, NULL);
1403 ok(hr == E_INVALIDARG, "SetParameters got unexpected hr %#lx\n", hr);
1404
1405 hr = IWICDdsEncoder_SetParameters(dds_encoder, &params_set);
1406 ok(hr == S_OK, "SetParameters failed, hr %#lx\n", hr);
1407 if (hr != S_OK) goto end;
1408
1409 IWICDdsEncoder_GetParameters(dds_encoder, &params);
1410
1411 ok(params.Width == params_set.Width,
1412 "Expected Width %u, got %u\n", params_set.Width, params.Width);
1413 ok(params.Height == params_set.Height,
1414 "Expected Height %u, got %u\n", params_set.Height, params.Height);
1415 ok(params.Depth == params_set.Depth,
1416 "Expected Depth %u, got %u\n", params_set.Depth, params.Depth);
1417 ok(params.MipLevels == params_set.MipLevels,
1418 "Expected MipLevels %u, got %u\n", params_set.MipLevels, params.MipLevels);
1419 ok(params.ArraySize == params_set.ArraySize,
1420 "Expected ArraySize %u, got %u\n", params_set.ArraySize, params.ArraySize);
1421 ok(params.DxgiFormat == params_set.DxgiFormat,
1422 "Expected DxgiFormat %u, got %#x\n", params_set.DxgiFormat, params.DxgiFormat);
1423 ok(params.Dimension == params_set.Dimension,
1424 "Expected Dimension %u, got %#x\n", params_set.Dimension, params.Dimension);
1425 ok(params.AlphaMode == params_set.AlphaMode,
1426 "Expected AlphaMode %u, got %#x\n", params_set.AlphaMode, params.AlphaMode);
1427
1428 for (i = 0; i < ARRAY_SIZE(test_data); ++i)
1429 {
1430 hr = IWICDdsEncoder_SetParameters(dds_encoder, &test_data[i].expected_parameters);
1431 todo_wine_if(test_data[i].init_hr != S_OK)
1432 ok((hr == S_OK && test_data[i].init_hr == S_OK) || hr == WINCODEC_ERR_BADHEADER,
1433 "Test %u: SetParameters got unexpected hr %#lx\n", i, hr);
1434 }
1435
1436end:
1437 release_encoder(encoder, dds_encoder, stream);
1438}
#define todo_wine_if(is_todo)
Definition: minitest.h:81
@ WICDdsTexture3D
Definition: wincodec.idl:200
@ WICDdsAlphaModeUnknown
Definition: wincodec.idl:206
#define WINCODEC_ERR_BADHEADER
Definition: winerror.h:7311

Referenced by test_dds_encoder().

◆ test_dds_encoder_pixel_format()

static void test_dds_encoder_pixel_format ( void  )
static

Definition at line 1481 of file ddsformat.c.

1482{
1485 {
1486 &GUID_WICPixelFormat8bppIndexed,
1487 &GUID_WICPixelFormatBlackWhite,
1488 &GUID_WICPixelFormat16bppGray,
1489 &GUID_WICPixelFormat8bppAlpha,
1490 &GUID_WICPixelFormat16bppBGR555,
1491 &GUID_WICPixelFormat16bppBGR565,
1492 &GUID_WICPixelFormat24bppBGR,
1493 &GUID_WICPixelFormat32bppBGR,
1494 &GUID_WICPixelFormat32bppBGRA,
1495 &GUID_WICPixelFormat32bppPBGRA,
1496 &GUID_WICPixelFormat32bppRGB,
1497 &GUID_WICPixelFormat32bppRGBA,
1498 &GUID_WICPixelFormat32bppPRGBA,
1499 &GUID_WICPixelFormat48bppRGB,
1500 &GUID_WICPixelFormat64bppRGB,
1501 &GUID_WICPixelFormat64bppRGBA
1502 };
1503 IWICBitmapFrameEncode *frame = NULL;
1504 IWICDdsEncoder *dds_encoder = NULL;
1509 BYTE buffer[1];
1510 HRESULT hr;
1511 UINT i, j;
1512
1513 for (i = 0; i < ARRAY_SIZE(image_formats); ++i)
1514 {
1515 hr = create_and_init_encoder(buffer, sizeof(buffer), NULL, &encoder, &dds_encoder, &stream);
1516 if (hr != S_OK)
1517 {
1518 release_encoder(encoder, dds_encoder, stream);
1519 return;
1520 }
1521
1522 IWICDdsEncoder_GetParameters(dds_encoder, &params);
1523 params.DxgiFormat = image_formats[i];
1524 IWICDdsEncoder_SetParameters(dds_encoder, &params);
1525
1526 IWICBitmapEncoder_CreateNewFrame(encoder, &frame, NULL);
1527
1528 hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &format);
1529 ok(hr == WINCODEC_ERR_NOTINITIALIZED, "SetPixelFormat got unexpected hr %#lx\n", hr);
1530
1531 IWICBitmapFrameEncode_Initialize(frame, NULL);
1532
1533 for (j = 0; j < ARRAY_SIZE(test_formats); ++j)
1534 {
1535 winetest_push_context("Test %u", j);
1536
1537 format = *(test_formats[j]);
1538 hr = IWICBitmapFrameEncode_SetPixelFormat(frame, &format);
1539 ok(hr == S_OK, "SetPixelFormat failed, hr %#lx\n", hr);
1540 ok(IsEqualGUID(&format, &GUID_WICPixelFormat32bppBGRA),
1541 "Got unexpected GUID %s\n", debugstr_guid(&format));
1542
1544 }
1545
1546 IWICBitmapFrameEncode_Release(frame);
1547 release_encoder(encoder, dds_encoder, stream);
1548 }
1549}
DXGI_FORMAT
Definition: dxgiformat.idl:22
static void test_formats(AUDCLNT_SHAREMODE mode)
Definition: render.c:379
#define WINCODEC_ERR_NOTINITIALIZED
Definition: winerror.h:7296

Referenced by test_dds_encoder().

Variable Documentation

◆ compressed_formats

DXGI_FORMAT compressed_formats[]
static
Initial value:
= {
}
@ DXGI_FORMAT_BC3_UNORM_SRGB
Definition: dxgiformat.idl:101
@ DXGI_FORMAT_BC3_TYPELESS
Definition: dxgiformat.idl:99
@ DXGI_FORMAT_BC5_UNORM
Definition: dxgiformat.idl:106
@ DXGI_FORMAT_BC1_UNORM_SRGB
Definition: dxgiformat.idl:95
@ DXGI_FORMAT_BC2_TYPELESS
Definition: dxgiformat.idl:96
@ DXGI_FORMAT_BC6H_UF16
Definition: dxgiformat.idl:118
@ DXGI_FORMAT_BC6H_SF16
Definition: dxgiformat.idl:119
@ DXGI_FORMAT_BC7_TYPELESS
Definition: dxgiformat.idl:120
@ DXGI_FORMAT_BC6H_TYPELESS
Definition: dxgiformat.idl:117
@ DXGI_FORMAT_BC7_UNORM
Definition: dxgiformat.idl:121
@ DXGI_FORMAT_BC5_TYPELESS
Definition: dxgiformat.idl:105
@ DXGI_FORMAT_BC2_UNORM_SRGB
Definition: dxgiformat.idl:98
@ DXGI_FORMAT_BC5_SNORM
Definition: dxgiformat.idl:107
@ DXGI_FORMAT_BC4_TYPELESS
Definition: dxgiformat.idl:102
@ DXGI_FORMAT_BC1_TYPELESS
Definition: dxgiformat.idl:93
@ DXGI_FORMAT_BC7_UNORM_SRGB
Definition: dxgiformat.idl:122
@ DXGI_FORMAT_BC4_UNORM
Definition: dxgiformat.idl:103
@ DXGI_FORMAT_BC4_SNORM
Definition: dxgiformat.idl:104

Definition at line 449 of file ddsformat.c.

◆ factory

Definition at line 459 of file ddsformat.c.

◆ test_byte

BYTE test_byte[1] = { 0 }
static

Definition at line 381 of file ddsformat.c.

◆ test_data

◆ test_dds_128bpp

BYTE test_dds_128bpp[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x0F, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x74, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x84, 0x83, 0x03, 0x3F, 0x82, 0x81, 0x01, 0x3F, 0xE2, 0xE0, 0xE0, 0x3E, 0x00, 0x00, 0x80, 0x3F
}

Definition at line 143 of file ddsformat.c.

◆ test_dds_12x12

BYTE test_dds_12x12[]
static

Definition at line 336 of file ddsformat.c.

◆ test_dds_24bpp

BYTE test_dds_24bpp[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0x81, 0x83
}

Definition at line 77 of file ddsformat.c.

◆ test_dds_32bpp_argb

BYTE test_dds_32bpp_argb[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x41, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0x81, 0x83, 0xFF
}

Definition at line 103 of file ddsformat.c.

◆ test_dds_32bpp_xrgb

BYTE test_dds_32bpp_xrgb[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00,
0x00, 0xFF, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x70, 0x81, 0x83, 0x00
}

Definition at line 90 of file ddsformat.c.

◆ test_dds_64bpp

BYTE test_dds_64bpp[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x0F, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x24, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x83, 0x83, 0x81, 0x81, 0x70, 0x70, 0xFF, 0xFF
}

Definition at line 116 of file ddsformat.c.

◆ test_dds_96bpp

BYTE test_dds_96bpp[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x0F, 0x10, 0x02, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x0C, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', '1', '0', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x84, 0x83, 0x03, 0x3F, 0x82, 0x81, 0x01, 0x3F, 0xE2, 0xE0, 0xE0, 0x3E
}

Definition at line 129 of file ddsformat.c.

◆ test_dds_alpha

BYTE test_dds_alpha[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF
}

Definition at line 37 of file ddsformat.c.

◆ test_dds_array

BYTE test_dds_array[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0A, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', '1', '0', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B,
0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69,
0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84,
0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B,
0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00
}

Definition at line 230 of file ddsformat.c.

◆ test_dds_bad_header

BYTE test_dds_bad_header[sizeof(test_dds_dxt1c)]
static

Definition at line 380 of file ddsformat.c.

Referenced by test_dds_decoder_initialize().

◆ test_dds_bad_magic

BYTE test_dds_bad_magic[sizeof(test_dds_dxt1c)]
static

Definition at line 379 of file ddsformat.c.

Referenced by test_dds_decoder_initialize().

◆ test_dds_cube

BYTE test_dds_cube[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0A, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', 'T', '1', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55,
0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7,
0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00,
0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55,
0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7,
0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00,
0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55,
0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7,
0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00
}

Definition at line 156 of file ddsformat.c.

◆ test_dds_cube_dx10

BYTE test_dds_cube_dx10[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0A, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', '1', '0', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x47, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
0x03, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B,
0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69,
0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84,
0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B,
0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69,
0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84,
0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B,
0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84, 0x00, 0x00, 0x00, 0x00, 0xF5, 0xA7, 0x08, 0x69,
0x74, 0xC0, 0xBF, 0xD7, 0x32, 0x96, 0x0B, 0x7B, 0xCC, 0x55, 0xCC, 0x55, 0x0E, 0x84, 0x0E, 0x84,
0x00, 0x00, 0x00, 0x00
}

Definition at line 177 of file ddsformat.c.

◆ test_dds_dxt1a

BYTE test_dds_dxt1a[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', 'T', '1', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x2A, 0x31, 0xF5, 0xBC, 0xE3, 0x6E, 0x2A, 0x3A
}

Definition at line 261 of file ddsformat.c.

◆ test_dds_dxt1c

BYTE test_dds_dxt1c[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', 'T', '1', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x9A, 0xE6, 0x2B, 0x39, 0x37, 0xB7, 0x7F, 0x7F
}

Definition at line 248 of file ddsformat.c.

Referenced by test_dds_decoder_initialize().

◆ test_dds_dxt2

BYTE test_dds_dxt2[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', 'T', '2', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFD, 0xDE, 0xC4, 0x10, 0x2F, 0xBF, 0xFF, 0x7B,
0xFF, 0x00, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55,
0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55
}

Definition at line 274 of file ddsformat.c.

◆ test_dds_dxt3

BYTE test_dds_dxt3[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0A, 0x00, 0x03, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', 'T', '3', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x0C, 0x92, 0x38, 0x84, 0x00, 0xFF, 0x55, 0xFF,
0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x53, 0x8B, 0x53, 0x8B, 0x00, 0x00, 0x00, 0x00
}

Definition at line 289 of file ddsformat.c.

◆ test_dds_dxt4

BYTE test_dds_dxt4[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x02, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', 'T', '4', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0xDE, 0xC4, 0x10, 0x2F, 0xBF, 0xFF, 0x7B,
0xFF, 0x00, 0x40, 0x02, 0x24, 0x49, 0x92, 0x24, 0x57, 0x53, 0x00, 0x00, 0x52, 0x52, 0x55, 0x55,
0xFF, 0x00, 0x48, 0x92, 0x24, 0x49, 0x92, 0x24, 0xCE, 0x59, 0x00, 0x00, 0x54, 0x55, 0x55, 0x55
}

Definition at line 303 of file ddsformat.c.

◆ test_dds_dxt5

BYTE test_dds_dxt5[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0A, 0x00, 0x06, 0x00, 0x00, 0x00,
0x06, 0x00, 0x00, 0x00, 0x40, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x44, 0x58, 0x54, 0x35, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x73, 0x73, 0x8E, 0x51, 0x97, 0x97, 0xBF, 0xAF,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x9D, 0xC6, 0xCF, 0x52, 0x22, 0x22, 0xBB, 0x55,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x44, 0xA2, 0xB8, 0x5B, 0xF8, 0xF8, 0xF8, 0xF8,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0C, 0x3A, 0x05, 0x19, 0xCC, 0x66, 0xCC, 0x66,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x9D, 0x0A, 0x39, 0xCF, 0xEF, 0x9B, 0xEF,
0xFF, 0xFF, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xF0, 0x6A, 0xF0, 0x6A, 0x00, 0x00, 0x00, 0x00
}

Definition at line 318 of file ddsformat.c.

◆ test_dds_luminance

BYTE test_dds_luminance[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x01, 0x00, 0x00, 0x00,
0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0xFF, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x82
}

Definition at line 50 of file ddsformat.c.

◆ test_dds_mipmaps

BYTE test_dds_mipmaps[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x0A, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', 'T', '1', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xF5, 0xA7, 0x08, 0x69, 0x74, 0xC0, 0xBF, 0xD7, 0xB1, 0x95, 0x6D, 0x7B, 0xFC, 0x55, 0x5D, 0x5D,
0x2E, 0x8C, 0x4E, 0x7C, 0xAA, 0xAB, 0xAB, 0xAB
}

Definition at line 200 of file ddsformat.c.

◆ test_dds_rgb565

BYTE test_dds_rgb565[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x08, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x40, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x00, 0xF8, 0x00, 0x00,
0xE0, 0x07, 0x00, 0x00, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xF5, 0xA7, 0x08, 0x69, 0x4C, 0x7B, 0x08, 0x69, 0xF5, 0xA7, 0xF5, 0xA7, 0xF5, 0xA7, 0x4C, 0x7B,
0x4C, 0x7B, 0x4C, 0x7B, 0x4C, 0x7B, 0xB1, 0x95, 0x4C, 0x7B, 0x08, 0x69, 0x08, 0x69, 0x4C, 0x7B
}

Definition at line 63 of file ddsformat.c.

◆ test_dds_volume

BYTE test_dds_volume[]
static
Initial value:
= {
'D', 'D', 'S', ' ', 0x7C, 0x00, 0x00, 0x00, 0x07, 0x10, 0x8A, 0x00, 0x04, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 0x08, 0x00, 0x00, 0x00, 0x04, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x20, 0x00, 0x00, 0x00,
0x04, 0x00, 0x00, 0x00, 'D', 'X', 'T', '1', 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x10, 0x40, 0x00,
0x00, 0x00, 0x20, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
0xD5, 0xA7, 0x2C, 0x7B, 0xE0, 0x00, 0x55, 0x55, 0xD5, 0xA7, 0x49, 0x69, 0x57, 0x00, 0xFF, 0x55,
0xD5, 0xA7, 0x48, 0x69, 0xFD, 0x80, 0xFF, 0x55, 0x30, 0x8D, 0x89, 0x71, 0x55, 0xA8, 0x00, 0xFF,
0x32, 0x96, 0x6D, 0x83, 0xA8, 0x55, 0x5D, 0x5D, 0x0E, 0x84, 0x6D, 0x7B, 0xA8, 0xA9, 0xAD, 0xAD,
0x2E, 0x8C, 0x2E, 0x7C, 0xAA, 0xAB, 0xAB, 0xAB
}

Definition at line 214 of file ddsformat.c.

◆ test_dword

BYTE test_dword[4] = { 0 }
static

Definition at line 383 of file ddsformat.c.

◆ test_qword_a

BYTE test_qword_a[8] = { 0 }
static

Definition at line 384 of file ddsformat.c.

◆ test_qword_b

BYTE test_qword_b[8] = "DDS "
static

Definition at line 385 of file ddsformat.c.

◆ test_word

BYTE test_word[2] = { 0 }
static

Definition at line 382 of file ddsformat.c.