Blender V2.27
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 swizzleDXT5n ()
void splatX ()
void splatY ()
bool isSingleColor () const
 Returns true if the block has a single color.
bool isSingleColorNoAlpha () const
 Returns true if the block has a single color, ignoring transparent pixels.
uint countUniqueColors () const
 Count number of unique colors in this color block.
Color32 averageColor () const
 Get average color of the block.
bool hasAlpha () const
 Return true if the block is not fully opaque.
void diameterRange (Color32 *start, Color32 *end) const
 Get diameter color range.
void luminanceRange (Color32 *start, Color32 *end) const
 Get luminance color range.
void boundsRange (Color32 *start, Color32 *end) const
 Get color range based on the bounding box.
void boundsRangeAlpha (Color32 *start, Color32 *end) const
 Get color range based on the bounding box.
void sortColorsByAbsoluteValue ()
 Sort colors by abosolute value in their 16 bit representation.
float volume () const
const Color32 * colors () const
 Get pointer to block colors.
Color32 color (uint i) const
 Get block color.
Color32 & color (uint i)
 Get block color.
Color32 color (uint x, uint y) const
 Get block color.
Color32 & color (uint x, uint y)
 Get block color.

Detailed Description

Uncompressed 4x4 color block.

Id:
ColorBlock.h 26841 2010-02-12 13:34:04Z campbellbarton

***** BEGIN GPL LICENSE BLOCK *****

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Contributors: Amorilia (amorilia@gamebox.net)

***** END GPL LICENSE BLOCK *****

Definition at line 41 of file ColorBlock.h.


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