Lines Matching +full:x +full:- +full:mask

7 /* for creating built-in cursors */
13 unsigned int line = 0, i, r, g, b, x, y, pixel; in cursor_parse_xpm() local
33 if (sscanf(name, "#%02x%02x%02x", &r, &g, &b) == 3) { in cursor_parse_xpm()
52 for (x = 0; x < height; x++, pixel++) { in cursor_parse_xpm()
53 idx = xpm[line][x]; in cursor_parse_xpm()
54 c->data[pixel] = ctab[idx]; in cursor_parse_xpm()
63 uint32_t *data = c->data; in cursor_print_ascii_art()
64 int x,y; in cursor_print_ascii_art() local
66 for (y = 0; y < c->height; y++) { in cursor_print_ascii_art()
68 for (x = 0; x < c->width; x++, data++) { in cursor_print_ascii_art()
74 fprintf(stderr, "X"); /* black */ in cursor_print_ascii_art()
104 c->width = width; in cursor_alloc()
105 c->height = height; in cursor_alloc()
106 c->refcount = 1; in cursor_alloc()
112 c->refcount++; in cursor_ref()
120 c->refcount--; in cursor_unref()
121 if (c->refcount) in cursor_unref()
128 return DIV_ROUND_UP(c->width, 8); in cursor_get_mono_bpl()
133 int transparent, uint8_t *mask) in cursor_set_mono() argument
135 uint32_t *data = c->data; in cursor_set_mono()
137 int x,y,bpl; in cursor_set_mono() local
138 bool expand_bitmap_only = image == mask; in cursor_set_mono()
143 * Converts a monochrome bitmap with XOR mask 'image' and AND mask 'mask': in cursor_set_mono()
144 * https://docs.microsoft.com/en-us/windows-hardware/drivers/display/drawing-monochrome-pointers in cursor_set_mono()
147 for (y = 0; y < c->height; y++) { in cursor_set_mono()
149 for (x = 0; x < c->width; x++, data++) { in cursor_set_mono()
150 if (transparent && mask[x/8] & bit) { in cursor_set_mono()
151 if (!expand_bitmap_only && image[x / 8] & bit) { in cursor_set_mono()
157 } else if (!transparent && !(mask[x/8] & bit)) { in cursor_set_mono()
159 } else if (image[x/8] & bit) { in cursor_set_mono()
169 mask += bpl; in cursor_set_mono()
179 data = c->data; in cursor_set_mono()
180 for (y = 0; y < c->height; y++) { in cursor_set_mono()
181 for (x = 0; x < c->width; x++, data++) { in cursor_set_mono()
183 ((x > 0 && data[-1] == inverted) || in cursor_set_mono()
184 (x + 1 < c->width && data[1] == inverted) || in cursor_set_mono()
185 (y > 0 && data[-c->width] == inverted) || in cursor_set_mono()
186 (y + 1 < c->height && data[c->width] == inverted))) { in cursor_set_mono()
191 data = c->data; in cursor_set_mono()
192 for (x = 0; x < c->width * c->height; x++, data++) { in cursor_set_mono()
200 void cursor_get_mono_mask(QEMUCursor *c, int transparent, uint8_t *mask) in cursor_get_mono_mask() argument
202 uint32_t *data = c->data; in cursor_get_mono_mask()
204 int x,y,bpl; in cursor_get_mono_mask() local
207 memset(mask, 0, bpl * c->height); in cursor_get_mono_mask()
208 for (y = 0; y < c->height; y++) { in cursor_get_mono_mask()
210 for (x = 0; x < c->width; x++, data++) { in cursor_get_mono_mask()
213 mask[x/8] |= bit; in cursor_get_mono_mask()
217 mask[x/8] |= bit; in cursor_get_mono_mask()
225 mask += bpl; in cursor_get_mono_mask()