summaryrefslogtreecommitdiff
path: root/src/lib/ector/ector_buffer.h
blob: 9399b17214ac1a2bd0f898398c88a83db3907142 (plain) (blame)
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
#ifndef ECTOR_BUFFER_H
#define ECTOR_BUFFER_H

#include <Ector.h>

#include "ector_generic_buffer.eo.h"
#include "software/ector_software_buffer_base.eo.h"

/**
 * @typedef Ector_Buffer
 * A generic pixel buffer type (2D). May be readable or writeable or both.
 */
typedef Ector_Generic_Buffer Ector_Buffer;

typedef struct _Ector_Generic_Buffer_Data Ector_Generic_Buffer_Data;
typedef struct _Ector_Software_Buffer_Base_Data Ector_Software_Buffer_Base_Data;

struct _Ector_Generic_Buffer_Data
{
   Ector_Buffer       *eo;
   unsigned int        w, h;
   unsigned char       l, r, t, b;
   Efl_Gfx_Colorspace  cspace;
   Eina_Bool            immutable : 1; // pixels_set is forbidden
};

struct _Ector_Software_Buffer_Base_Data
{
   Ector_Generic_Buffer_Data *generic; /* ugly */
   union {
      unsigned int     *u32;
      unsigned char    *u8;
   } pixels;
   unsigned int         stride;
   unsigned int         pixel_size; // in bytes
   struct {
      Eina_Inlist      *maps; // Ector_Software_Buffer_Map
   } internal;
   Eina_Bool            writable : 1; // pixels can be written to
   Eina_Bool            nofree : 1; // pixel data should not be free()'ed
};

#endif