summaryrefslogtreecommitdiffstats
path: root/kernel/kls_ttf/ftview/gblblit.h
blob: 564a21da8890e4eaae8f563c67675889a1a96e43 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#ifndef __GBLENDER_BLIT_H__
#define __GBLENDER_BLIT_H__

#include "gblender.h"

/*
 * blitting interface
 *   
 */

typedef enum
{
  GBLENDER_SOURCE_GRAY8 = 0,
  GBLENDER_SOURCE_HRGB,
  GBLENDER_SOURCE_HBGR,
  GBLENDER_SOURCE_VRGB,
  GBLENDER_SOURCE_VBGR,
  
  GBLENDER_SOURCE_MAX

} GBlenderSourceFormat;


typedef enum
{
  GBLENDER_TARGET_GRAY8 = 0,
  GBLENDER_TARGET_RGB32,
  GBLENDER_TARGET_RGB24,
  GBLENDER_TARGET_RGB565,
  GBLENDER_TARGET_BGR565,
  
  GBLENDER_TARGET_MAX
  
} GBlenderTargetFormat;

typedef struct GBlenderBlitRec_*    GBlenderBlit;

typedef void  (*GBlenderBlitFunc)( GBlenderBlit   blit,
                                   GBlenderPixel  color );

typedef struct GBlenderBlitRec_
{
  int                   width;
  int                   height;
  const unsigned char*  src_line;
  int                   src_pitch;
  int                   src_x;
  int                   src_y;
  unsigned char*        dst_line;
  int                   dst_pitch;
  int                   dst_x;
  int                   dst_y;
  GBlenderSourceFormat  src_format;
  GBlenderTargetFormat  dst_format;

  GBlender              blender;
  GBlenderBlitFunc      blit_func;

} GBlenderBlitRec;



GBLENDER_API( int )
gblender_blit_init( GBlenderBlit           blit,
                    GBlender               blender,
                    int                    dst_x,
                    int                    dst_y,
                    GBlenderSourceFormat   src_format,
                    const unsigned char*   src_buffer,
                    int                    src_pitch,
                    int                    src_width,
                    int                    src_height,
                    GBlenderTargetFormat   dst_format,
                    unsigned char*         dst_buffer,
                    int                    dst_pitch,
                    int                    dst_width,
                    int                    dst_height );

#define  gblender_blit_run(b,color)  (b)->blit_func( (b), (color) )


#endif /* __GBLENDER_BLIT_H__ */