Blender V4.3
format_dds.cc File Reference
#include <algorithm>
#include <memory>
#include "oiio/openimageio_support.hh"
#include "IMB_filetype.hh"
#include "IMB_imbuf_types.hh"
#include "BLI_math_base.h"
#include "BLI_path_utils.hh"
#include "BLI_string.h"

Go to the source code of this file.

Typedefs

using FlipBlockFunction = void (*)(uint8_t *block)
 

Functions

static void LoadDXTCImage (ImBuf *ibuf, Filesystem::IOMemReader &mem_reader)
 
void imb_init_dds ()
 
bool imb_is_a_dds (const uchar *buf, size_t size)
 
ImBufimb_load_dds (const uchar *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
 
static void FlipDXT1BlockFull (uint8_t *block)
 
static void FlipDXT1BlockHalf (uint8_t *block)
 
static void FlipDXT3BlockFull (uint8_t *block)
 
static void FlipDXT3BlockHalf (uint8_t *block)
 
static void FlipDXT5BlockFull (uint8_t *block)
 
static void FlipDXT5BlockHalf (uint8_t *block)
 
static void FlipDXTCImage (ImBuf *ibuf)
 

Detailed Description

Some portions of this file are from the Chromium project and have been adapted for Blender use when flipping DDS images to the OpenGL convention.

Definition in file format_dds.cc.

Typedef Documentation

◆ FlipBlockFunction

using FlipBlockFunction = void (*)(uint8_t *block)

Definition at line 69 of file format_dds.cc.

Function Documentation

◆ FlipDXT1BlockFull()

static void FlipDXT1BlockFull ( uint8_t * block)
static

Definition at line 72 of file format_dds.cc.

Referenced by FlipDXT3BlockFull(), FlipDXT5BlockFull(), and FlipDXTCImage().

◆ FlipDXT1BlockHalf()

static void FlipDXT1BlockHalf ( uint8_t * block)
static

Definition at line 89 of file format_dds.cc.

Referenced by FlipDXT3BlockHalf(), FlipDXT5BlockHalf(), and FlipDXTCImage().

◆ FlipDXT3BlockFull()

static void FlipDXT3BlockFull ( uint8_t * block)
static

Definition at line 98 of file format_dds.cc.

References FlipDXT1BlockFull().

Referenced by FlipDXTCImage().

◆ FlipDXT3BlockHalf()

static void FlipDXT3BlockHalf ( uint8_t * block)
static

Definition at line 124 of file format_dds.cc.

References FlipDXT1BlockHalf().

Referenced by FlipDXTCImage().

◆ FlipDXT5BlockFull()

static void FlipDXT5BlockFull ( uint8_t * block)
static

Definition at line 138 of file format_dds.cc.

References FlipDXT1BlockFull().

Referenced by FlipDXTCImage().

◆ FlipDXT5BlockHalf()

static void FlipDXT5BlockHalf ( uint8_t * block)
static

Definition at line 181 of file format_dds.cc.

References FlipDXT1BlockHalf().

Referenced by FlipDXTCImage().

◆ FlipDXTCImage()

static void FlipDXTCImage ( ImBuf * ibuf)
static

Flips a DXTC image, by flipping and swapping DXTC blocks as appropriate.

Use to flip vertically to fit OpenGL convention.

Definition at line 197 of file format_dds.cc.

References DDSData::data, ImBuf::dds_data, FlipDXT1BlockFull(), FlipDXT1BlockHalf(), FlipDXT3BlockFull(), FlipDXT3BlockHalf(), FlipDXT5BlockFull(), FlipDXT5BlockHalf(), DDSData::fourcc, FOURCC_DXT1, FOURCC_DXT3, FOURCC_DXT5, is_power_of_2_i(), DDSData::nummipmaps, DDSData::size, ImBuf::x, and ImBuf::y.

Referenced by LoadDXTCImage().

◆ imb_init_dds()

void imb_init_dds ( )

Definition at line 34 of file format_dds.cc.

References BLI_getenv(), and BLI_strcasestr().

◆ imb_is_a_dds()

bool imb_is_a_dds ( const uchar * buf,
size_t size )

Definition at line 47 of file format_dds.cc.

References blender::imbuf::imb_oiio_check().

◆ imb_load_dds()

ImBuf * imb_load_dds ( const uchar * mem,
size_t size,
int flags,
char colorspace[IM_MAX_SPACE] )

◆ LoadDXTCImage()

static void LoadDXTCImage ( ImBuf * ibuf,
Filesystem::IOMemReader & mem_reader )
static