New 1.14 property: Evas.Image.orient

with a simple test
This commit is contained in:
Davide Andreoli 2015-04-12 12:35:57 +02:00
parent f20c56fe15
commit 0190d16c05
4 changed files with 88 additions and 2 deletions

View File

@ -668,6 +668,48 @@ Evas_Image_Animated_Loop_Hint
Pingpong
.. _Evas_Image_Orient:
Evas_Image_Orient
-------------------------------------
.. data:: EVAS_IMAGE_ORIENT_NONE
No orientation change
.. data:: EVAS_IMAGE_ORIENT_0
No orientation change
.. data:: EVAS_IMAGE_ORIENT_90
Orient 90 degrees clockwise
.. data:: EVAS_IMAGE_ORIENT_180
Orient 180 degrees clockwise
.. data:: EVAS_IMAGE_ORIENT_270
Rotate 90 degrees counter-clockwise (i.e. 270 degrees clockwise)
.. data:: EVAS_IMAGE_FLIP_HORIZONTAL
Flip image horizontally
.. data:: EVAS_IMAGE_FLIP_VERTICAL
Flip image vertically
.. data:: EVAS_IMAGE_FLIP_TRANSVERSE
Flip image along the y = (width - x) line (bottom-left to top-right)
.. data:: EVAS_IMAGE_ORIENT
Flip image along the y = x line (top-left to bottom-right)
.. _Evas_Engine_Render_Mode:
Evas_Engine_Render_Mode

View File

@ -903,6 +903,27 @@ cdef class Image(Object):
def load_orientation_get(self):
return bool(evas_object_image_load_orientation_get(self.obj))
property orient:
"""The image orientation.
This allows to rotate or flip the image.
:type: Evas_Image_Orient
.. versionadded:: 1.14
"""
def __set__(self, value):
evas_object_image_orient_set(self.obj, <Evas_Image_Orient>value)
def __get__(self):
return evas_object_image_orient_get(self.obj)
def orient_set(self, orient):
evas_object_image_orient_set(self.obj, <Evas_Image_Orient>orient)
def orient_get(self):
return evas_object_image_orient_get(self.obj)
property colorspace:
"""The colorspace of image data (pixels).

View File

@ -1,10 +1,15 @@
#!/usr/bin/env python
# encoding: utf-8
from efl.evas import Rectangle, Line, Text, Polygon
import os
from efl.evas import Rectangle, Line, Text, Polygon, FilledImage, \
EVAS_IMAGE_ORIENT_180
from efl import elementary
from efl.elementary.window import StandardWindow
img_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "images")
ic_file = os.path.join(img_path, "logo.png")
def events_cb1(rect, event_name):
print(event_name + " No data for event")
@ -33,6 +38,10 @@ def core_evas_objects_clicked(obj, item=None):
poly.point_add(20,30)
poly.show()
image = FilledImage(win.evas, file=ic_file, size=(50,70), pos=(120,70))
image.orient = EVAS_IMAGE_ORIENT_180
image.show()
win.resize(320, 320)
win.show()

View File

@ -243,6 +243,19 @@ cdef extern from "Evas.h":
ctypedef enum Evas_Image_Animated_Loop_Hint:
pass
cpdef enum Evas_Image_Orient:
EVAS_IMAGE_ORIENT_NONE
EVAS_IMAGE_ORIENT_0
EVAS_IMAGE_ORIENT_90
EVAS_IMAGE_ORIENT_180
EVAS_IMAGE_ORIENT_270
EVAS_IMAGE_FLIP_HORIZONTAL
EVAS_IMAGE_FLIP_VERTICAL
EVAS_IMAGE_FLIP_TRANSPOSE
EVAS_IMAGE_FLIP_TRANSVERSE
ctypedef enum Evas_Image_Orient:
pass
cpdef enum Evas_Engine_Render_Mode:
EVAS_RENDER_MODE_BLOCKING
EVAS_RENDER_MODE_NONBLOCKING
@ -910,7 +923,8 @@ cdef extern from "Evas.h":
int evas_object_image_animated_loop_count_get(const Evas_Object *obj)
double evas_object_image_animated_frame_duration_get(const Evas_Object *obj, int start_frame, int fram_num)
void evas_object_image_animated_frame_set(Evas_Object *obj, int frame_num)
Evas_Image_Orient evas_object_image_orient_get(Evas_Object *obj)
void evas_object_image_orient_set(Evas_Object *obj, Evas_Image_Orient orient)
####################################################################
# Polygon Object