coastline 0.0.4
Loading...
Searching...
No Matches
rgb565image.h
Go to the documentation of this file.
1#ifndef COASTLINE_PLATFORM_WIN_GLIDE_RGB565IMAGE_H
2#define COASTLINE_PLATFORM_WIN_GLIDE_RGB565IMAGE_H
3
9
10#include <stdint.h>
11
12#include <windows.h>
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
19typedef struct Rgb565Image {
20 uint16_t *pixels;
21 int width;
22 int height;
23 uint16_t colorKey;
25
29Rgb565Image *CreateRgb565Image(int width, int height);
30
34
43 uint16_t *destination, const uint8_t *source, int width, int height, int sourceStride);
44
49
53Rgb565Image *LoadBitmapToRgb565Image(const char *name, int width, int height);
54
56#define RGB565_BLIT_COLOR_KEYED 0x1
57
71 unsigned x,
72 unsigned y,
73 const Rgb565Image *source,
74 const RECT *rect,
75 DWORD flags);
76
85void CopyRgb565Rect(void *destination,
86 int destinationStride,
87 unsigned width,
88 int height,
89 const void *source,
90 int sourceStride);
91
101void CopyRgb565RectColorKeyed(uint16_t *destination,
102 int destinationStride,
103 int width,
104 int height,
105 const uint16_t *source,
106 int sourceStride,
107 uint16_t colorKey);
108
112
120
121#ifdef __cplusplus
122}
123#endif
124
125#endif /* COASTLINE_PLATFORM_WIN_GLIDE_RGB565IMAGE_H */
void SetRgb565ImageColorKey(Rgb565Image *image, COLORREF color)
Convert a Windows RGB colour to the image's RGB 565 transparency key.
Rgb565Image * LoadBitmapToRgb565Image(const char *name, int width, int height)
Load a bitmap resource or file at the requested dimensions and convert it to RGB 565.
Rgb565Image * CreateRgb565Image(int width, int height)
Allocate an RGB 565 image and an uninitialised pixel buffer.
Rgb565Image * CreateRgb565ImageFromBitmap(const BITMAP *bitmap)
Convert a 24-bit Windows bitmap to an RGB 565 image.
void ConvertBgr24ToRgb565FlipVertical(uint16_t *destination, const uint8_t *source, int width, int height, int sourceStride)
Convert 24-bit BGR rows to RGB 565 while reversing their vertical order.
void WriteRgb565ImageToGlideLfb(const Rgb565Image *image)
Write an image to the back buffer of Glide at its top left.
void FreeRgb565Image(Rgb565Image *image)
Free image and its pixel buffer, accepting NULL.
void CopyRgb565RectColorKeyed(uint16_t *destination, int destinationStride, int width, int height, const uint16_t *source, int sourceStride, uint16_t colorKey)
Copy RGB 565 rows, omitting source pixels equal to colorKey.
void BlitRgb565ImageRegion(Rgb565Image *destination, unsigned x, unsigned y, const Rgb565Image *source, const RECT *rect, DWORD flags)
Copy a rectangle of an image into another at a position, clipped to the right and bottom edges of the...
void CopyRgb565Rect(void *destination, int destinationStride, unsigned width, int height, const void *source, int sourceStride)
Copy RGB 565 rows without clipping or interpreting colour keys.
A bitmap of RGB 565 pixels with a transparent colour key.
Definition rgb565image.h:19
int height
Definition rgb565image.h:22
uint16_t colorKey
Definition rgb565image.h:23
int width
Definition rgb565image.h:21
uint16_t * pixels
Definition rgb565image.h:20
typedef COLORREF
typedef DWORD