New style enums for ethumb
...not really tested as there are no test nor examples for ethumb :(
This commit is contained in:
parent
bbb747eb5e
commit
4bc8d227a9
|
@ -1,26 +0,0 @@
|
|||
cdef extern from "Ethumb.h":
|
||||
ctypedef enum Ethumb_Thumb_Orientation:
|
||||
ETHUMB_THUMB_ORIENT_NONE # keep orientation as pixel data is
|
||||
ETHUMB_THUMB_ROTATE_90_CW # rotate 90° clockwise
|
||||
ETHUMB_THUMB_ROTATE_180 # rotate 180°
|
||||
ETHUMB_THUMB_ROTATE_90_CCW # rotate 90° counter-clockwise
|
||||
ETHUMB_THUMB_FLIP_HORIZONTAL # flip horizontally
|
||||
ETHUMB_THUMB_FLIP_VERTICAL # flip vertically
|
||||
ETHUMB_THUMB_FLIP_TRANSPOSE # transpose
|
||||
ETHUMB_THUMB_FLIP_TRANSVERSE # transverse
|
||||
ETHUMB_THUMB_ORIENT_ORIGINAL # use orientation from metadata (EXIF-only currently)
|
||||
|
||||
ctypedef enum Ethumb_Thumb_FDO_Size:
|
||||
ETHUMB_THUMB_NORMAL # 128x128 as defined by FreeDesktop.Org standard
|
||||
ETHUMB_THUMB_LARGE # 256x256 as defined by FreeDesktop.Org standard
|
||||
|
||||
ctypedef enum Ethumb_Thumb_Format:
|
||||
ETHUMB_THUMB_FDO # PNG as defined by FreeDesktop.Org standard
|
||||
ETHUMB_THUMB_JPEG # JPEGs are often smaller and faster to read/write
|
||||
ETHUMB_THUMB_EET # EFL's own storage system, supports key parameter
|
||||
|
||||
ctypedef enum Ethumb_Thumb_Aspect:
|
||||
ETHUMB_THUMB_KEEP_ASPECT # keep original proportion between width and height
|
||||
ETHUMB_THUMB_IGNORE_ASPECT # ignore aspect and force it to match thumbnail's width and height
|
||||
ETHUMB_THUMB_CROP # keep aspect but crop (cut) the largest dimension
|
||||
|
|
@ -16,25 +16,68 @@
|
|||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from efl.eina cimport Eina_Bool, Eina_Free_Cb
|
||||
from efl.ethumb.enums cimport Ethumb_Thumb_FDO_Size, Ethumb_Thumb_Format, \
|
||||
Ethumb_Thumb_Aspect, Ethumb_Thumb_Orientation
|
||||
|
||||
|
||||
cdef extern from "Ethumb.h":
|
||||
|
||||
####################################################################
|
||||
# Enums
|
||||
#
|
||||
cpdef enum Ethumb_Thumb_Orientation:
|
||||
ETHUMB_THUMB_ORIENT_NONE
|
||||
ETHUMB_THUMB_ROTATE_90_CW
|
||||
ETHUMB_THUMB_ROTATE_180
|
||||
ETHUMB_THUMB_ROTATE_90_CCW
|
||||
ETHUMB_THUMB_FLIP_HORIZONTAL
|
||||
ETHUMB_THUMB_FLIP_VERTICAL
|
||||
ETHUMB_THUMB_FLIP_TRANSPOSE
|
||||
ETHUMB_THUMB_FLIP_TRANSVERSE
|
||||
ETHUMB_THUMB_ORIENT_ORIGINAL
|
||||
ctypedef enum Ethumb_Thumb_Orientation:
|
||||
pass
|
||||
|
||||
cpdef enum Ethumb_Thumb_FDO_Size:
|
||||
ETHUMB_THUMB_NORMAL
|
||||
ETHUMB_THUMB_LARGE
|
||||
ctypedef enum Ethumb_Thumb_FDO_Size:
|
||||
pass
|
||||
|
||||
cpdef enum Ethumb_Thumb_Format:
|
||||
ETHUMB_THUMB_FDO
|
||||
ETHUMB_THUMB_JPEG
|
||||
ETHUMB_THUMB_EET
|
||||
ctypedef enum Ethumb_Thumb_Format:
|
||||
pass
|
||||
|
||||
cpdef enum Ethumb_Thumb_Aspect:
|
||||
ETHUMB_THUMB_KEEP_ASPECT
|
||||
ETHUMB_THUMB_IGNORE_ASPECT
|
||||
ETHUMB_THUMB_CROP
|
||||
ctypedef enum Ethumb_Thumb_Aspect:
|
||||
pass
|
||||
|
||||
####################################################################
|
||||
# Structs
|
||||
#
|
||||
cdef struct Ethumb:
|
||||
int tw
|
||||
int th
|
||||
int format
|
||||
int aspect
|
||||
|
||||
####################################################################
|
||||
# Other typedefs
|
||||
#
|
||||
ctypedef void (*Ethumb_Generate_Cb)(void *data, Ethumb *e, Eina_Bool success)
|
||||
|
||||
# Ethumb
|
||||
####################################################################
|
||||
# Functions
|
||||
#
|
||||
int ethumb_init()
|
||||
void ethumb_shutdown()
|
||||
Ethumb * ethumb_new()
|
||||
void ethumb_free(Ethumb *e)
|
||||
|
||||
# Setup
|
||||
Eina_Bool ethumb_frame_set(Ethumb *e, const char *theme_file, const char *group, const char *swallow)
|
||||
void ethumb_frame_get(Ethumb *e, const char **theme_file, const char **group, const char **swallow)
|
||||
|
||||
|
@ -84,7 +127,6 @@ cdef extern from "Ethumb.h":
|
|||
void ethumb_video_fps_set(Ethumb *e, unsigned int fps)
|
||||
unsigned int ethumb_video_fps_get(Ethumb *e)
|
||||
|
||||
# Basics
|
||||
void ethumb_document_page_set(Ethumb *e, unsigned int page)
|
||||
unsigned int ethumb_document_page_get(Ethumb *e)
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@
|
|||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from efl.eina cimport Eina_Bool, Eina_Free_Cb
|
||||
from efl.ethumb.enums cimport Ethumb_Thumb_Orientation
|
||||
from efl.ethumb cimport Ethumb_Thumb_Orientation
|
||||
|
||||
cdef extern from "Ethumb_Client.h":
|
||||
ctypedef struct Ethumb_Client
|
||||
|
|
Loading…
Reference in New Issue