• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

saitoha / libsixel / 19389365033

15 Nov 2025 11:44AM UTC coverage: 43.379% (-0.4%) from 43.821%
19389365033

push

github

saitoha
palette: refactor palette helpers into dedicated modules

8474 of 27744 branches covered (30.54%)

44 of 650 new or added lines in 4 files covered. (6.77%)

106 existing lines in 9 files now uncovered.

11581 of 26697 relevant lines covered (43.38%)

973309.3 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/palette-common-snap.c
1
/*
2
 * SPDX-License-Identifier: MIT
3
 *
4
 * Safe-tone snapping helpers for palettes.  The implementation mirrors the
5
 * reversible tone logic historically embedded inside palette.c but now lives in
6
 * a dedicated module so other translation units can reuse it without dragging
7
 * in unrelated merge infrastructure.
8
 */
9

10
#include "config.h"
11

12
#include <stddef.h>
13

14
#include "lut.h"
15
#include "palette-common-snap.h"
16

17
void
NEW
18
sixel_palette_reversible_palette(unsigned char *palette,
×
19
                                 unsigned int colors,
20
                                 unsigned int depth)
21
{
22
    unsigned int index;
23
    unsigned int plane;
24
    unsigned int count;
25
    unsigned int value;
26
    size_t offset;
27

NEW
28
    index = 0U;
×
NEW
29
    plane = 0U;
×
NEW
30
    count = colors;
×
NEW
31
    value = 0U;
×
NEW
32
    offset = 0U;
×
NEW
33
    if (palette == NULL) {
×
NEW
34
        return;
×
35
    }
NEW
36
    for (index = 0U; index < count; ++index) {
×
NEW
37
        for (plane = 0U; plane < depth; ++plane) {
×
NEW
38
            offset = (size_t)index * (size_t)depth + (size_t)plane;
×
NEW
39
            value = palette[offset];
×
NEW
40
            palette[offset] = sixel_palette_reversible_value(value);
×
41
        }
42
    }
43
}
44

45
/* emacs Local Variables:      */
46
/* emacs mode: c               */
47
/* emacs tab-width: 4          */
48
/* emacs indent-tabs-mode: nil */
49
/* emacs c-basic-offset: 4     */
50
/* emacs End:                  */
51
/* vim: set expandtab ts=4 sts=4 sw=4 : */
52
/* EOF */
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc