Changeset View
Changeset View
Standalone View
Standalone View
source/blender/imbuf/intern/dds/ColorBlock.cpp
| Show All 40 Lines | |||||
| /* Get the euclidean distance between the given colors. */ | /* Get the euclidean distance between the given colors. */ | ||||
| inline static uint colorDistance(Color32 c0, Color32 c1) | inline static uint colorDistance(Color32 c0, Color32 c1) | ||||
| { | { | ||||
| return (c0.r - c1.r) * (c0.r - c1.r) + (c0.g - c1.g) * (c0.g - c1.g) + | return (c0.r - c1.r) * (c0.r - c1.r) + (c0.g - c1.g) * (c0.g - c1.g) + | ||||
| (c0.b - c1.b) * (c0.b - c1.b); | (c0.b - c1.b) * (c0.b - c1.b); | ||||
| } | } | ||||
| #endif | #endif | ||||
| /** Default constructor. */ | |||||
| 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++) { | ||||
| color(i) = Color32(linearImage[i]); | color(i) = Color32(linearImage[i]); | ||||
| } | } | ||||
| } | } | ||||
| ▲ Show 20 Lines • Show All 432 Lines • Show Last 20 Lines | |||||