Blender  V2.93
Public Member Functions | List of all members
ColorBlock Struct Reference

#include <ColorBlock.h>

Public Member Functions

 ColorBlock ()=default
 
 ColorBlock (const uint *linearImage)
 
 ColorBlock (const ColorBlock &block)
 
 ColorBlock (const Image *img, uint x, uint y)
 
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
 
bool hasAlpha () const
 
const Color32colors () const
 
Color32 color (uint i) const
 
Color32color (uint i)
 
Color32 color (uint x, uint y) const
 
Color32color (uint x, uint y)
 

Detailed Description

Uncompressed 4x4 color block.

Definition at line 36 of file ColorBlock.h.

Constructor & Destructor Documentation

◆ ColorBlock() [1/4]

ColorBlock::ColorBlock ( )
default

◆ ColorBlock() [2/4]

ColorBlock::ColorBlock ( const uint linearImage)

Init the color block from an array of colors.

Definition at line 50 of file ColorBlock.cpp.

References color().

◆ ColorBlock() [3/4]

ColorBlock::ColorBlock ( const ColorBlock block)

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

Definition at line 58 of file ColorBlock.cpp.

References color().

◆ ColorBlock() [4/4]

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

Initialize this color block.

Definition at line 66 of file ColorBlock.cpp.

References init(), x, and y.

Member Function Documentation

◆ color() [1/4]

Color32 & ColorBlock::color ( uint  i)
inline

Get block color.

Definition at line 77 of file ColorBlock.h.

◆ color() [2/4]

Color32 ColorBlock::color ( uint  i) const
inline

◆ color() [3/4]

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

Get block color.

Definition at line 89 of file ColorBlock.h.

References x, and y.

◆ color() [4/4]

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

Get block color.

Definition at line 83 of file ColorBlock.h.

References x, and y.

◆ colors()

const Color32 * ColorBlock::colors ( ) const
inline

Get pointer to block colors.

Definition at line 65 of file ColorBlock.h.

◆ hasAlpha()

bool ColorBlock::hasAlpha ( ) const

Return true if the block is not fully opaque.

Definition at line 239 of file ColorBlock.cpp.

◆ init() [1/3]

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

Definition at line 71 of file ColorBlock.cpp.

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

Referenced by ColorBlock().

◆ init() [2/3]

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

Definition at line 97 of file ColorBlock.cpp.

References Freestyle::c, CLAMP, color(), data, e, MIN, w(), x, and y.

◆ init() [3/3]

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

Definition at line 76 of file ColorBlock.cpp.

References color(), data, e, MIN, Color32::u, w(), x, and y.

◆ isSingleColor()

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

Returns true if the block has a single color.

Definition at line 158 of file ColorBlock.cpp.

References mask(), and Color32::u.

◆ swizzle()

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

Definition at line 146 of file ColorBlock.cpp.

References Color32::a, Color32::b, Freestyle::c, color(), component(), Color32::g, Color32::r, w(), x, y, and z.


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