MCPcopy Create free account
hub / github.com/BatchDrake/SigDigger / updateThumbnail

Method updateThumbnail

Misc/Palette.cpp:60–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

58
59
60void
61Palette::updateThumbnail(void)
62{
63 int i, j;
64 int index;
65 QRgb rgb;
66 /* Compose thumbnail */
67 for (i = 0; i < SIGDIGGER_PALETTE_THUMB_WIDTH; ++i) {
68 index = ((SIGDIGGER_PALETTE_MAX_STOPS - 1) * i)
69 / (SIGDIGGER_PALETTE_THUMB_WIDTH - 1);
70
71 rgb = this->gradient[static_cast<unsigned>(index)].rgb();
72
73 for (j = 0; j < SIGDIGGER_PALETTE_THUMB_HEIGHT; ++j)
74 this->thumbnail.setPixel(i, j, rgb);
75 }
76}
77
78void
79Palette::compose(void)

Callers 2

PaletteMethod · 0.95
composeMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected