efl/src/lib/ector/ector_buffer.h

40 lines
1.1 KiB
C
Raw Normal View History

#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"
2015-12-07 22:11:57 -08:00
/**
* @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
{
2015-12-07 22:11:57 -08:00
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
} Ector_Generic_Buffer_Data;
typedef 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
unsigned int map_count;
Eina_Bool writable : 1; // pixels can be written to
Eina_Bool nofree : 1; // pixel data should not be free()'ed
Eina_Bool span_free : 1; // FIXME
} Ector_Software_Buffer_Base_Data;
#endif