Blender  V2.59
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 46 of file ColorBlock.h.


Constructor & Destructor Documentation

ColorBlock::ColorBlock ( )

Default constructor.

Definition at line 57 of file ColorBlock.cpp.

ColorBlock::ColorBlock ( const uint linearImage)

Init the color block from an array of colors.

Definition at line 62 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 70 of file ColorBlock.cpp.

References color(), and i.

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

Initialize this color block.

Definition at line 79 of file ColorBlock.cpp.

References init().


Member Function Documentation

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

Get block color.

Definition at line 92 of file ColorBlock.h.

References i.

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

Get block color.

Definition at line 98 of file ColorBlock.h.

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

Get block color.

Definition at line 104 of file ColorBlock.h.

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

Get pointer to block colors.

Definition at line 80 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 246 of file ColorBlock.cpp.

References i.

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

Definition at line 84 of file ColorBlock.cpp.

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

Referenced by ColorBlock().

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

Definition at line 89 of file ColorBlock.cpp.

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

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

Definition at line 112 of file ColorBlock.cpp.

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

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

Returns true if the block has a single color.

Definition at line 165 of file ColorBlock.cpp.

References i, and Color32::u.

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

Definition at line 151 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: