blit
Loading...
Searching...
No Matches
scan.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 1996, 1998, 1999, 2002, Roy Ratcliffe, Northumberland, United Kingdom
3 * SPDX-License-Identifier: MIT
4 */
13#ifndef __BLIT_SCAN_H__
14#define __BLIT_SCAN_H__
15
16#include <stdint.h>
17
24typedef uint8_t blit_scanline_t;
25
59
73#define BLIT_SCAN_DEFINE(name, width, height) \
74 blit_scanline_t name##_store[(((width) + 7) >> 3) * (height)]; \
75 struct blit_scan name = {name##_store, (width), (height), ((width) + 7) >> 3}
76
90#define BLIT_SCAN_DEFINE_STATIC(name, width, height) \
91 static blit_scanline_t name##_store[(((width) + 7) >> 3) * (height)]; \
92 static struct blit_scan name = {name##_store, (width), (height), ((width) + 7) >> 3}
93
106static inline blit_scanline_t *blit_scan_find(const struct blit_scan *scan, int x, int y) { return scan->store + scan->stride * y + (x >> 3); }
107
108#endif /* __BLIT_SCAN_H__ */
uint8_t blit_scanline_t
Type definition for a scanline element.
Definition scan.h:24
Scanline structure.
Definition scan.h:32
int height
Height of the scanline buffer in pixels.
Definition scan.h:50
int stride
Stride of the scanline buffer.
Definition scan.h:57
int width
Width of the scanline buffer in pixels.
Definition scan.h:45
blit_scanline_t * store
Pointer to the scanline data buffer.
Definition scan.h:39