Cleanup: use C style doxygen comments
This commit is contained in:
@@ -98,6 +98,6 @@ class GHOST_SystemSDL : public GHOST_System {
|
|||||||
|
|
||||||
void processEvent(SDL_Event *sdl_event);
|
void processEvent(SDL_Event *sdl_event);
|
||||||
|
|
||||||
/// The vector of windows that need to be updated.
|
/** The vector of windows that need to be updated. */
|
||||||
std::vector<GHOST_WindowSDL *> m_dirty_windows;
|
std::vector<GHOST_WindowSDL *> m_dirty_windows;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -225,7 +225,7 @@ class GHOST_WindowX11 : public GHOST_Window {
|
|||||||
bool canInvertColor);
|
bool canInvertColor);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
/// Force use of public constructor.
|
/* Force use of public constructor. */
|
||||||
|
|
||||||
GHOST_WindowX11();
|
GHOST_WindowX11();
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ class MEM_RefCounted {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// The reference count.
|
/** The reference count. */
|
||||||
int m_refCount;
|
int m_refCount;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -254,23 +254,23 @@ typedef struct bNodeType {
|
|||||||
* \note Used as a fallback when #bNode.label isn't set.
|
* \note Used as a fallback when #bNode.label isn't set.
|
||||||
*/
|
*/
|
||||||
void (*labelfunc)(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
void (*labelfunc)(struct bNodeTree *ntree, struct bNode *node, char *label, int maxlen);
|
||||||
/// Optional custom resize handle polling.
|
/** Optional custom resize handle polling. */
|
||||||
int (*resize_area_func)(struct bNode *node, int x, int y);
|
int (*resize_area_func)(struct bNode *node, int x, int y);
|
||||||
/// Optional selection area polling.
|
/** Optional selection area polling. */
|
||||||
int (*select_area_func)(struct bNode *node, int x, int y);
|
int (*select_area_func)(struct bNode *node, int x, int y);
|
||||||
/// Optional tweak area polling (for grabbing).
|
/** Optional tweak area polling (for grabbing). */
|
||||||
int (*tweak_area_func)(struct bNode *node, int x, int y);
|
int (*tweak_area_func)(struct bNode *node, int x, int y);
|
||||||
|
|
||||||
/// Called when the node is updated in the editor.
|
/** Called when the node is updated in the editor. */
|
||||||
void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node);
|
void (*updatefunc)(struct bNodeTree *ntree, struct bNode *node);
|
||||||
/// Check and update if internal ID data has changed.
|
/** Check and update if internal ID data has changed. */
|
||||||
void (*group_update_func)(struct bNodeTree *ntree, struct bNode *node);
|
void (*group_update_func)(struct bNodeTree *ntree, struct bNode *node);
|
||||||
|
|
||||||
/// Initialize a new node instance of this type after creation.
|
/** Initialize a new node instance of this type after creation. */
|
||||||
void (*initfunc)(struct bNodeTree *ntree, struct bNode *node);
|
void (*initfunc)(struct bNodeTree *ntree, struct bNode *node);
|
||||||
/// Free the node instance.
|
/** Free the node instance. */
|
||||||
void (*freefunc)(struct bNode *node);
|
void (*freefunc)(struct bNode *node);
|
||||||
/// Make a copy of the node instance.
|
/** Make a copy of the node instance. */
|
||||||
void (*copyfunc)(struct bNodeTree *dest_ntree,
|
void (*copyfunc)(struct bNodeTree *dest_ntree,
|
||||||
struct bNode *dest_node,
|
struct bNode *dest_node,
|
||||||
const struct bNode *src_node);
|
const struct bNode *src_node);
|
||||||
|
|||||||
@@ -198,13 +198,13 @@ void ExecutionGroup::execute(ExecutionSystem *graph)
|
|||||||
const bNodeTree *bTree = context.getbNodeTree();
|
const bNodeTree *bTree = context.getbNodeTree();
|
||||||
if (this->m_width == 0 || this->m_height == 0) {
|
if (this->m_width == 0 || this->m_height == 0) {
|
||||||
return;
|
return;
|
||||||
} /// \note Break out... no pixels to calculate.
|
} /** \note Break out... no pixels to calculate. */
|
||||||
if (bTree->test_break && bTree->test_break(bTree->tbh)) {
|
if (bTree->test_break && bTree->test_break(bTree->tbh)) {
|
||||||
return;
|
return;
|
||||||
} /// \note Early break out for blur and preview nodes.
|
} /** \note Early break out for blur and preview nodes. */
|
||||||
if (this->m_numberOfChunks == 0) {
|
if (this->m_numberOfChunks == 0) {
|
||||||
return;
|
return;
|
||||||
} /// \note Early break out.
|
} /** \note Early break out. */
|
||||||
unsigned int chunkNumber;
|
unsigned int chunkNumber;
|
||||||
|
|
||||||
this->m_executionStartTime = PIL_check_seconds_timer();
|
this->m_executionStartTime = PIL_check_seconds_timer();
|
||||||
|
|||||||
@@ -184,7 +184,7 @@ NodeOutput *NodeGraph::find_output(const NodeRange &node_range, bNodeSocket *b_s
|
|||||||
|
|
||||||
void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink)
|
void NodeGraph::add_bNodeLink(const NodeRange &node_range, bNodeLink *b_nodelink)
|
||||||
{
|
{
|
||||||
/// \note Ignore invalid links.
|
/** \note Ignore invalid links. */
|
||||||
if (!(b_nodelink->flag & NODE_LINK_VALID)) {
|
if (!(b_nodelink->flag & NODE_LINK_VALID)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,26 +44,26 @@
|
|||||||
# error COM_CURRENT_THREADING_MODEL No threading model selected
|
# error COM_CURRENT_THREADING_MODEL No threading model selected
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// \brief list of all CPUDevices. for every hardware thread an instance of CPUDevice is created
|
/** \brief list of all CPUDevices. for every hardware thread an instance of CPUDevice is created */
|
||||||
static vector<CPUDevice *> g_cpudevices;
|
static vector<CPUDevice *> g_cpudevices;
|
||||||
static ThreadLocal(CPUDevice *) g_thread_device;
|
static ThreadLocal(CPUDevice *) g_thread_device;
|
||||||
|
|
||||||
#if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
|
#if COM_CURRENT_THREADING_MODEL == COM_TM_QUEUE
|
||||||
/// \brief list of all thread for every CPUDevice in cpudevices a thread exists
|
/** \brief list of all thread for every CPUDevice in cpudevices a thread exists. */
|
||||||
static ListBase g_cputhreads;
|
static ListBase g_cputhreads;
|
||||||
static bool g_cpuInitialized = false;
|
static bool g_cpuInitialized = false;
|
||||||
/// \brief all scheduled work for the cpu
|
/** \brief all scheduled work for the cpu */
|
||||||
static ThreadQueue *g_cpuqueue;
|
static ThreadQueue *g_cpuqueue;
|
||||||
static ThreadQueue *g_gpuqueue;
|
static ThreadQueue *g_gpuqueue;
|
||||||
# ifdef COM_OPENCL_ENABLED
|
# ifdef COM_OPENCL_ENABLED
|
||||||
static cl_context g_context;
|
static cl_context g_context;
|
||||||
static cl_program g_program;
|
static cl_program g_program;
|
||||||
/// \brief list of all OpenCLDevices. for every OpenCL GPU device an instance of OpenCLDevice is
|
/** \brief list of all OpenCLDevices. for every OpenCL GPU device an instance of OpenCLDevice is
|
||||||
/// created
|
* created. */
|
||||||
static vector<OpenCLDevice *> g_gpudevices;
|
static vector<OpenCLDevice *> g_gpudevices;
|
||||||
/// \brief list of all thread for every GPUDevice in cpudevices a thread exists
|
/** \brief list of all thread for every GPUDevice in cpudevices a thread exists. */
|
||||||
static ListBase g_gputhreads;
|
static ListBase g_gputhreads;
|
||||||
/// \brief all scheduled work for the gpu
|
/** \brief all scheduled work for the GPU. */
|
||||||
static bool g_openclActive = false;
|
static bool g_openclActive = false;
|
||||||
static bool g_openclInitialized = false;
|
static bool g_openclInitialized = false;
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
@@ -72,7 +72,7 @@ NodeOperation *ImageNode::doMultilayerCheck(NodeConverter &converter,
|
|||||||
void ImageNode::convertToOperations(NodeConverter &converter,
|
void ImageNode::convertToOperations(NodeConverter &converter,
|
||||||
const CompositorContext &context) const
|
const CompositorContext &context) const
|
||||||
{
|
{
|
||||||
/// Image output
|
/** Image output */
|
||||||
NodeOutput *outputImage = this->getOutputSocket(0);
|
NodeOutput *outputImage = this->getOutputSocket(0);
|
||||||
bNode *editorNode = this->getbNode();
|
bNode *editorNode = this->getbNode();
|
||||||
Image *image = (Image *)editorNode->id;
|
Image *image = (Image *)editorNode->id;
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ void ReadBufferOperation::determineResolution(unsigned int resolution[2],
|
|||||||
operation->determineResolution(resolution, preferredResolution);
|
operation->determineResolution(resolution, preferredResolution);
|
||||||
operation->setResolution(resolution);
|
operation->setResolution(resolution);
|
||||||
|
|
||||||
/// \todo: may not occur!, but does with blur node
|
/** \todo: may not occur!, but does with blur node */
|
||||||
if (this->m_memoryProxy->getExecutor()) {
|
if (this->m_memoryProxy->getExecutor()) {
|
||||||
this->m_memoryProxy->getExecutor()->setResolution(resolution);
|
this->m_memoryProxy->getExecutor()->setResolution(resolution);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -583,8 +583,8 @@ static void free_posetree(PoseTree *tree)
|
|||||||
MEM_freeN(tree);
|
MEM_freeN(tree);
|
||||||
}
|
}
|
||||||
|
|
||||||
///----------------------------------------
|
/* ------------------------------
|
||||||
/// Plugin API for legacy iksolver
|
* Plugin API for legacy iksolver */
|
||||||
|
|
||||||
void iksolver_initialize_tree(struct Depsgraph *UNUSED(depsgraph),
|
void iksolver_initialize_tree(struct Depsgraph *UNUSED(depsgraph),
|
||||||
struct Scene *UNUSED(scene),
|
struct Scene *UNUSED(scene),
|
||||||
|
|||||||
@@ -247,14 +247,14 @@ void BlockDXT1::setIndices(const int *idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip DXT1 block vertically.
|
/** Flip DXT1 block vertically. */
|
||||||
inline void BlockDXT1::flip4()
|
inline void BlockDXT1::flip4()
|
||||||
{
|
{
|
||||||
swap(row[0], row[3]);
|
swap(row[0], row[3]);
|
||||||
swap(row[1], row[2]);
|
swap(row[1], row[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip half DXT1 block vertically.
|
/** Flip half DXT1 block vertically. */
|
||||||
inline void BlockDXT1::flip2()
|
inline void BlockDXT1::flip2()
|
||||||
{
|
{
|
||||||
swap(row[0], row[1]);
|
swap(row[0], row[1]);
|
||||||
@@ -299,27 +299,27 @@ void AlphaBlockDXT3::decodeBlock(ColorBlock *block) const
|
|||||||
block->color(0xF).a = (alphaF << 4) | alphaF;
|
block->color(0xF).a = (alphaF << 4) | alphaF;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip DXT3 alpha block vertically.
|
/** Flip DXT3 alpha block vertically. */
|
||||||
void AlphaBlockDXT3::flip4()
|
void AlphaBlockDXT3::flip4()
|
||||||
{
|
{
|
||||||
swap(row[0], row[3]);
|
swap(row[0], row[3]);
|
||||||
swap(row[1], row[2]);
|
swap(row[1], row[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip half DXT3 alpha block vertically.
|
/** Flip half DXT3 alpha block vertically. */
|
||||||
void AlphaBlockDXT3::flip2()
|
void AlphaBlockDXT3::flip2()
|
||||||
{
|
{
|
||||||
swap(row[0], row[1]);
|
swap(row[0], row[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip DXT3 block vertically.
|
/** Flip DXT3 block vertically. */
|
||||||
void BlockDXT3::flip4()
|
void BlockDXT3::flip4()
|
||||||
{
|
{
|
||||||
alpha.flip4();
|
alpha.flip4();
|
||||||
color.flip4();
|
color.flip4();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip half DXT3 block vertically.
|
/** Flip half DXT3 block vertically. */
|
||||||
void BlockDXT3::flip2()
|
void BlockDXT3::flip2()
|
||||||
{
|
{
|
||||||
alpha.flip2();
|
alpha.flip2();
|
||||||
@@ -458,21 +458,21 @@ void BlockDXT5::decodeBlockNV5x(ColorBlock *block) const
|
|||||||
alpha.decodeBlock(block);
|
alpha.decodeBlock(block);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip DXT5 block vertically.
|
/** Flip DXT5 block vertically. */
|
||||||
void BlockDXT5::flip4()
|
void BlockDXT5::flip4()
|
||||||
{
|
{
|
||||||
alpha.flip4();
|
alpha.flip4();
|
||||||
color.flip4();
|
color.flip4();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip half DXT5 block vertically.
|
/** Flip half DXT5 block vertically. */
|
||||||
void BlockDXT5::flip2()
|
void BlockDXT5::flip2()
|
||||||
{
|
{
|
||||||
alpha.flip2();
|
alpha.flip2();
|
||||||
color.flip2();
|
color.flip2();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Decode ATI1 block.
|
/** Decode ATI1 block. */
|
||||||
void BlockATI1::decodeBlock(ColorBlock *block) const
|
void BlockATI1::decodeBlock(ColorBlock *block) const
|
||||||
{
|
{
|
||||||
uint8 alpha_array[8];
|
uint8 alpha_array[8];
|
||||||
@@ -488,19 +488,19 @@ void BlockATI1::decodeBlock(ColorBlock *block) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip ATI1 block vertically.
|
/** Flip ATI1 block vertically. */
|
||||||
void BlockATI1::flip4()
|
void BlockATI1::flip4()
|
||||||
{
|
{
|
||||||
alpha.flip4();
|
alpha.flip4();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip half ATI1 block vertically.
|
/** Flip half ATI1 block vertically. */
|
||||||
void BlockATI1::flip2()
|
void BlockATI1::flip2()
|
||||||
{
|
{
|
||||||
alpha.flip2();
|
alpha.flip2();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Decode ATI2 block.
|
/** Decode ATI2 block. */
|
||||||
void BlockATI2::decodeBlock(ColorBlock *block) const
|
void BlockATI2::decodeBlock(ColorBlock *block) const
|
||||||
{
|
{
|
||||||
uint8 alpha_array[8];
|
uint8 alpha_array[8];
|
||||||
@@ -525,14 +525,14 @@ void BlockATI2::decodeBlock(ColorBlock *block) const
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip ATI2 block vertically.
|
/** Flip ATI2 block vertically. */
|
||||||
void BlockATI2::flip4()
|
void BlockATI2::flip4()
|
||||||
{
|
{
|
||||||
x.flip4();
|
x.flip4();
|
||||||
y.flip4();
|
y.flip4();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip half ATI2 block vertically.
|
/** Flip half ATI2 block vertically. */
|
||||||
void BlockATI2::flip2()
|
void BlockATI2::flip2()
|
||||||
{
|
{
|
||||||
x.flip2();
|
x.flip2();
|
||||||
@@ -586,14 +586,14 @@ void BlockCTX1::setIndices(const int *idx)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip CTX1 block vertically.
|
/** Flip CTX1 block vertically. */
|
||||||
inline void BlockCTX1::flip4()
|
inline void BlockCTX1::flip4()
|
||||||
{
|
{
|
||||||
swap(row[0], row[3]);
|
swap(row[0], row[3]);
|
||||||
swap(row[1], row[2]);
|
swap(row[1], row[2]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Flip half CTX1 block vertically.
|
/** Flip half CTX1 block vertically. */
|
||||||
inline void BlockCTX1::flip2()
|
inline void BlockCTX1::flip2()
|
||||||
{
|
{
|
||||||
swap(row[0], row[1]);
|
swap(row[0], row[1]);
|
||||||
|
|||||||
@@ -55,7 +55,7 @@
|
|||||||
#include <Common.h>
|
#include <Common.h>
|
||||||
#include <Stream.h>
|
#include <Stream.h>
|
||||||
|
|
||||||
/// DXT1 block.
|
/** DXT1 block. */
|
||||||
struct BlockDXT1 {
|
struct BlockDXT1 {
|
||||||
Color16 col0;
|
Color16 col0;
|
||||||
Color16 col1;
|
Color16 col1;
|
||||||
@@ -81,13 +81,13 @@ struct BlockDXT1 {
|
|||||||
void flip2();
|
void flip2();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Return true if the block uses four color mode, false otherwise.
|
/** Return true if the block uses four color mode, false otherwise. */
|
||||||
inline bool BlockDXT1::isFourColorMode() const
|
inline bool BlockDXT1::isFourColorMode() const
|
||||||
{
|
{
|
||||||
return col0.u > col1.u;
|
return col0.u > col1.u;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// DXT3 alpha block with explicit alpha.
|
/** DXT3 alpha block with explicit alpha. */
|
||||||
struct AlphaBlockDXT3 {
|
struct AlphaBlockDXT3 {
|
||||||
union {
|
union {
|
||||||
struct {
|
struct {
|
||||||
@@ -117,7 +117,7 @@ struct AlphaBlockDXT3 {
|
|||||||
void flip2();
|
void flip2();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DXT3 block.
|
/** DXT3 block. */
|
||||||
struct BlockDXT3 {
|
struct BlockDXT3 {
|
||||||
AlphaBlockDXT3 alpha;
|
AlphaBlockDXT3 alpha;
|
||||||
BlockDXT1 color;
|
BlockDXT1 color;
|
||||||
@@ -129,7 +129,7 @@ struct BlockDXT3 {
|
|||||||
void flip2();
|
void flip2();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DXT5 alpha block.
|
/** DXT5 alpha block. */
|
||||||
struct AlphaBlockDXT5 {
|
struct AlphaBlockDXT5 {
|
||||||
// uint64 unions do not compile on all platforms
|
// uint64 unions do not compile on all platforms
|
||||||
#if 0
|
#if 0
|
||||||
@@ -245,7 +245,7 @@ struct AlphaBlockDXT5 {
|
|||||||
void flip2();
|
void flip2();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DXT5 block.
|
/** DXT5 block. */
|
||||||
struct BlockDXT5 {
|
struct BlockDXT5 {
|
||||||
AlphaBlockDXT5 alpha;
|
AlphaBlockDXT5 alpha;
|
||||||
BlockDXT1 color;
|
BlockDXT1 color;
|
||||||
@@ -257,7 +257,7 @@ struct BlockDXT5 {
|
|||||||
void flip2();
|
void flip2();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ATI1 block.
|
/** ATI1 block. */
|
||||||
struct BlockATI1 {
|
struct BlockATI1 {
|
||||||
AlphaBlockDXT5 alpha;
|
AlphaBlockDXT5 alpha;
|
||||||
|
|
||||||
@@ -267,7 +267,7 @@ struct BlockATI1 {
|
|||||||
void flip2();
|
void flip2();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// ATI2 block.
|
/** ATI2 block. */
|
||||||
struct BlockATI2 {
|
struct BlockATI2 {
|
||||||
AlphaBlockDXT5 x;
|
AlphaBlockDXT5 x;
|
||||||
AlphaBlockDXT5 y;
|
AlphaBlockDXT5 y;
|
||||||
@@ -278,7 +278,7 @@ struct BlockATI2 {
|
|||||||
void flip2();
|
void flip2();
|
||||||
};
|
};
|
||||||
|
|
||||||
/// CTX1 block.
|
/** CTX1 block. */
|
||||||
struct BlockCTX1 {
|
struct BlockCTX1 {
|
||||||
uint8 col0[2];
|
uint8 col0[2];
|
||||||
uint8 col1[2];
|
uint8 col1[2];
|
||||||
|
|||||||
@@ -29,7 +29,7 @@
|
|||||||
|
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
/// 32 bit color stored as BGRA.
|
/** 32 bit color stored as BGRA. */
|
||||||
class Color32 {
|
class Color32 {
|
||||||
public:
|
public:
|
||||||
Color32()
|
Color32()
|
||||||
@@ -93,7 +93,7 @@ class Color32 {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
/// 16 bit 565 BGR color.
|
/** 16 bit 565 BGR color. */
|
||||||
class Color16 {
|
class Color16 {
|
||||||
public:
|
public:
|
||||||
Color16()
|
Color16()
|
||||||
|
|||||||
@@ -46,12 +46,12 @@ inline static uint colorDistance(Color32 c0, Color32 c1)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Default constructor.
|
/** Default constructor. */
|
||||||
ColorBlock::ColorBlock()
|
ColorBlock::ColorBlock()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Init the color block from an array of colors.
|
/** Init the color block from an array of colors. */
|
||||||
ColorBlock::ColorBlock(const uint *linearImage)
|
ColorBlock::ColorBlock(const uint *linearImage)
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < 16; i++) {
|
for (uint i = 0; i < 16; i++) {
|
||||||
@@ -59,7 +59,7 @@ ColorBlock::ColorBlock(const uint *linearImage)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Init the color block with the contents of the given block.
|
/** Init the color block with the contents of the given block. */
|
||||||
ColorBlock::ColorBlock(const ColorBlock &block)
|
ColorBlock::ColorBlock(const ColorBlock &block)
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < 16; i++) {
|
for (uint i = 0; i < 16; i++) {
|
||||||
@@ -67,7 +67,7 @@ ColorBlock::ColorBlock(const ColorBlock &block)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Initialize this color block.
|
/** Initialize this color block. */
|
||||||
ColorBlock::ColorBlock(const Image *img, uint x, uint y)
|
ColorBlock::ColorBlock(const Image *img, uint x, uint y)
|
||||||
{
|
{
|
||||||
init(img, x, y);
|
init(img, x, y);
|
||||||
@@ -159,7 +159,7 @@ void ColorBlock::swizzle(uint x, uint y, uint z, uint w)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Returns true if the block has a single color.
|
/** Returns true if the block has a single color. */
|
||||||
bool ColorBlock::isSingleColor(Color32 mask /*= Color32(0xFF, 0xFF, 0xFF, 0x00)*/) const
|
bool ColorBlock::isSingleColor(Color32 mask /*= Color32(0xFF, 0xFF, 0xFF, 0x00)*/) const
|
||||||
{
|
{
|
||||||
uint u = m_color[0].u & mask.u;
|
uint u = m_color[0].u & mask.u;
|
||||||
@@ -174,7 +174,7 @@ bool ColorBlock::isSingleColor(Color32 mask /*= Color32(0xFF, 0xFF, 0xFF, 0x00)*
|
|||||||
}
|
}
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/// Returns true if the block has a single color, ignoring transparent pixels.
|
/** Returns true if the block has a single color, ignoring transparent pixels. */
|
||||||
bool ColorBlock::isSingleColorNoAlpha() const
|
bool ColorBlock::isSingleColorNoAlpha() const
|
||||||
{
|
{
|
||||||
Color32 c;
|
Color32 c;
|
||||||
@@ -199,7 +199,7 @@ bool ColorBlock::isSingleColorNoAlpha() const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/// Count number of unique colors in this color block.
|
/** Count number of unique colors in this color block. */
|
||||||
uint ColorBlock::countUniqueColors() const
|
uint ColorBlock::countUniqueColors() const
|
||||||
{
|
{
|
||||||
uint count = 0;
|
uint count = 0;
|
||||||
@@ -223,7 +223,7 @@ uint ColorBlock::countUniqueColors() const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/// Get average color of the block.
|
/** Get average color of the block. */
|
||||||
Color32 ColorBlock::averageColor() const
|
Color32 ColorBlock::averageColor() const
|
||||||
{
|
{
|
||||||
uint r, g, b, a;
|
uint r, g, b, a;
|
||||||
@@ -240,7 +240,7 @@ Color32 ColorBlock::averageColor() const
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// Return true if the block is not fully opaque.
|
/** Return true if the block is not fully opaque. */
|
||||||
bool ColorBlock::hasAlpha() const
|
bool ColorBlock::hasAlpha() const
|
||||||
{
|
{
|
||||||
for (uint i = 0; i < 16; i++) {
|
for (uint i = 0; i < 16; i++) {
|
||||||
@@ -253,7 +253,7 @@ bool ColorBlock::hasAlpha() const
|
|||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
|
|
||||||
/// Get diameter color range.
|
/** Get diameter color range. */
|
||||||
void ColorBlock::diameterRange(Color32 *start, Color32 *end) const
|
void ColorBlock::diameterRange(Color32 *start, Color32 *end) const
|
||||||
{
|
{
|
||||||
Color32 c0, c1;
|
Color32 c0, c1;
|
||||||
@@ -274,7 +274,7 @@ void ColorBlock::diameterRange(Color32 *start, Color32 *end) const
|
|||||||
*end = c1;
|
*end = c1;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get luminance color range.
|
/** Get luminance color range. */
|
||||||
void ColorBlock::luminanceRange(Color32 *start, Color32 *end) const
|
void ColorBlock::luminanceRange(Color32 *start, Color32 *end) const
|
||||||
{
|
{
|
||||||
Color32 minColor, maxColor;
|
Color32 minColor, maxColor;
|
||||||
@@ -299,7 +299,7 @@ void ColorBlock::luminanceRange(Color32 *start, Color32 *end) const
|
|||||||
*end = maxColor;
|
*end = maxColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get color range based on the bounding box.
|
/** Get color range based on the bounding box. */
|
||||||
void ColorBlock::boundsRange(Color32 *start, Color32 *end) const
|
void ColorBlock::boundsRange(Color32 *start, Color32 *end) const
|
||||||
{
|
{
|
||||||
Color32 minColor(255, 255, 255);
|
Color32 minColor(255, 255, 255);
|
||||||
@@ -344,7 +344,7 @@ void ColorBlock::boundsRange(Color32 *start, Color32 *end) const
|
|||||||
*end = maxColor;
|
*end = maxColor;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get color range based on the bounding box.
|
/** Get color range based on the bounding box. */
|
||||||
void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
|
void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
|
||||||
{
|
{
|
||||||
Color32 minColor(255, 255, 255, 255);
|
Color32 minColor(255, 255, 255, 255);
|
||||||
@@ -400,7 +400,7 @@ void ColorBlock::boundsRangeAlpha(Color32 *start, Color32 *end) const
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/// Sort colors by abosolute value in their 16 bit representation.
|
/** Sort colors by abosolute value in their 16 bit representation. */
|
||||||
void ColorBlock::sortColorsByAbsoluteValue()
|
void ColorBlock::sortColorsByAbsoluteValue()
|
||||||
{
|
{
|
||||||
// Dummy selection sort.
|
// Dummy selection sort.
|
||||||
@@ -422,7 +422,7 @@ void ColorBlock::sortColorsByAbsoluteValue()
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/// Find extreme colors in the given axis.
|
/** Find extreme colors in the given axis. */
|
||||||
void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) const
|
void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) const
|
||||||
{
|
{
|
||||||
|
|
||||||
@@ -452,7 +452,7 @@ void ColorBlock::computeRange(Vector3::Arg axis, Color32 *start, Color32 *end) c
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/// Sort colors in the given axis.
|
/** Sort colors in the given axis. */
|
||||||
void ColorBlock::sortColors(const Vector3 &axis)
|
void ColorBlock::sortColors(const Vector3 &axis)
|
||||||
{
|
{
|
||||||
float luma_array[16];
|
float luma_array[16];
|
||||||
@@ -477,7 +477,7 @@ void ColorBlock::sortColors(const Vector3 &axis)
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if 0
|
#if 0
|
||||||
/// Get the volume of the color block.
|
/** Get the volume of the color block. */
|
||||||
float ColorBlock::volume() const
|
float ColorBlock::volume() const
|
||||||
{
|
{
|
||||||
Box bounds;
|
Box bounds;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include <Color.h>
|
#include <Color.h>
|
||||||
#include <Image.h>
|
#include <Image.h>
|
||||||
|
|
||||||
/// Uncompressed 4x4 color block.
|
/** Uncompressed 4x4 color block. */
|
||||||
struct ColorBlock {
|
struct ColorBlock {
|
||||||
ColorBlock();
|
ColorBlock();
|
||||||
ColorBlock(const uint *linearImage);
|
ColorBlock(const uint *linearImage);
|
||||||
@@ -61,31 +61,31 @@ struct ColorBlock {
|
|||||||
Color32 m_color[4 * 4];
|
Color32 m_color[4 * 4];
|
||||||
};
|
};
|
||||||
|
|
||||||
/// Get pointer to block colors.
|
/** Get pointer to block colors. */
|
||||||
inline const Color32 *ColorBlock::colors() const
|
inline const Color32 *ColorBlock::colors() const
|
||||||
{
|
{
|
||||||
return m_color;
|
return m_color;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get block color.
|
/** Get block color. */
|
||||||
inline Color32 ColorBlock::color(uint i) const
|
inline Color32 ColorBlock::color(uint i) const
|
||||||
{
|
{
|
||||||
return m_color[i];
|
return m_color[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get block color.
|
/** Get block color. */
|
||||||
inline Color32 &ColorBlock::color(uint i)
|
inline Color32 &ColorBlock::color(uint i)
|
||||||
{
|
{
|
||||||
return m_color[i];
|
return m_color[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get block color.
|
/** Get block color. */
|
||||||
inline Color32 ColorBlock::color(uint x, uint y) const
|
inline Color32 ColorBlock::color(uint x, uint y) const
|
||||||
{
|
{
|
||||||
return m_color[y * 4 + x];
|
return m_color[y * 4 + x];
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Get block color.
|
/** Get block color. */
|
||||||
inline Color32 &ColorBlock::color(uint x, uint y)
|
inline Color32 &ColorBlock::color(uint x, uint y)
|
||||||
{
|
{
|
||||||
return m_color[y * 4 + x];
|
return m_color[y * 4 + x];
|
||||||
|
|||||||
@@ -73,7 +73,7 @@ struct DDSCaps {
|
|||||||
uint caps4;
|
uint caps4;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DDS file header for DX10.
|
/** DDS file header for DX10. */
|
||||||
struct DDSHeader10 {
|
struct DDSHeader10 {
|
||||||
uint dxgiFormat;
|
uint dxgiFormat;
|
||||||
uint resourceDimension;
|
uint resourceDimension;
|
||||||
@@ -82,7 +82,7 @@ struct DDSHeader10 {
|
|||||||
uint reserved;
|
uint reserved;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DDS file header.
|
/** DDS file header. */
|
||||||
struct DDSHeader {
|
struct DDSHeader {
|
||||||
uint fourcc;
|
uint fourcc;
|
||||||
uint size;
|
uint size;
|
||||||
@@ -132,7 +132,7 @@ struct DDSHeader {
|
|||||||
uint d3d9Format() const;
|
uint d3d9Format() const;
|
||||||
};
|
};
|
||||||
|
|
||||||
/// DirectDraw Surface. (DDS)
|
/** DirectDraw Surface. (DDS) */
|
||||||
class DirectDrawSurface {
|
class DirectDrawSurface {
|
||||||
public:
|
public:
|
||||||
DirectDrawSurface(unsigned char *mem, uint size);
|
DirectDrawSurface(unsigned char *mem, uint size);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include "Color.h"
|
#include "Color.h"
|
||||||
#include "Common.h"
|
#include "Common.h"
|
||||||
|
|
||||||
/// 32 bit RGBA image.
|
/** 32 bit RGBA image. */
|
||||||
class Image {
|
class Image {
|
||||||
public:
|
public:
|
||||||
enum Format {
|
enum Format {
|
||||||
|
|||||||
Reference in New Issue
Block a user