Blender V2.61 - r43446
Public Member Functions

ColorBlock Struct Reference

Uncompressed 4x4 color block. More...

#include <ColorBlock.h>

List of all members.

Public Member Functions

 ColorBlock ()
 Default constructor.
 ColorBlock (const uint *linearImage)
 Init the color block from an array of colors.
 ColorBlock (const ColorBlock &block)
 Init the color block with the contents of the given block.
 ColorBlock (const Image *img, uint x, uint y)
 Initialize this color block.
void init (const Image *img, uint x, uint y)
void init (uint w, uint h, const uint *data, uint x, uint y)
void init (uint w, uint h, const float *data, uint x, uint y)
void swizzle (uint x, uint y, uint z, uint w)
bool isSingleColor (Color32 mask=Color32(0xFF, 0xFF, 0xFF, 0x00)) const
 Returns true if the block has a single color.
bool hasAlpha () const
 Count number of unique colors in this color block.
const Color32colors () const
 Get pointer to block colors.
Color32 color (uint i) const
 Get block color.
Color32color (uint i)
 Get block color.
Color32 color (uint x, uint y) const
 Get block color.
Color32color (uint x, uint y)
 Get block color.

Detailed Description

Uncompressed 4x4 color block.

Definition at line 44 of file ColorBlock.h.


Constructor & Destructor Documentation

ColorBlock::ColorBlock ( )

Default constructor.

Definition at line 55 of file ColorBlock.cpp.

ColorBlock::ColorBlock ( const uint linearImage)

Init the color block from an array of colors.

Definition at line 60 of file ColorBlock.cpp.

References color(), and i.

ColorBlock::ColorBlock ( const ColorBlock block)

Init the color block with the contents of the given block.

Definition at line 68 of file ColorBlock.cpp.

References color(), and i.

ColorBlock::ColorBlock ( const Image img,
uint  x,
uint  y 
)

Initialize this color block.

Definition at line 77 of file ColorBlock.cpp.

References init().


Member Function Documentation

Color32 ColorBlock::color ( uint  i) const [inline]
Color32 & ColorBlock::color ( uint  x,
uint  y 
) [inline]

Get block color.

Definition at line 102 of file ColorBlock.h.

Color32 & ColorBlock::color ( uint  i) [inline]

Get block color.

Definition at line 90 of file ColorBlock.h.

References i.

Color32 ColorBlock::color ( uint  x,
uint  y 
) const [inline]

Get block color.

Definition at line 96 of file ColorBlock.h.

const Color32 * ColorBlock::colors ( ) const [inline]

Get pointer to block colors.

Definition at line 78 of file ColorBlock.h.

bool ColorBlock::hasAlpha ( ) const

Count number of unique colors in this color block.

Return true if the block is not fully opaque.

Definition at line 244 of file ColorBlock.cpp.

References i.

void ColorBlock::init ( uint  w,
uint  h,
const float *  data,
uint  x,
uint  y 
)

Definition at line 110 of file ColorBlock.cpp.

References Color32::a, Color32::b, clamp, color(), credits_svn_gen::e, Color32::g, i, min, Color32::r, and U.

void ColorBlock::init ( uint  w,
uint  h,
const uint data,
uint  x,
uint  y 
)

Definition at line 87 of file ColorBlock.cpp.

References color(), credits_svn_gen::e, i, min, Color32::u, and U.

void ColorBlock::init ( const Image img,
uint  x,
uint  y 
)

Definition at line 82 of file ColorBlock.cpp.

References Image::height(), Image::pixels(), and Image::width().

Referenced by ColorBlock().

bool ColorBlock::isSingleColor ( Color32  mask = Color32(0xFF, 0xFF, 0xFF, 0x00)) const

Returns true if the block has a single color.

Definition at line 163 of file ColorBlock.cpp.

References i, and Color32::u.

void ColorBlock::swizzle ( uint  x,
uint  y,
uint  z,
uint  w 
)

Definition at line 149 of file ColorBlock.cpp.

References Color32::a, Color32::b, component(), Color32::g, i, and Color32::r.


The documentation for this struct was generated from the following files: