-
Notifications
You must be signed in to change notification settings - Fork 21
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
111 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,39 @@ | ||
cdef enum Centering: | ||
BEGIN = -1 | ||
MIDDLE = 0 | ||
END = 1 | ||
|
||
cdef extern from "echomesh/color/Tile.h" namespace "echomesh::color": | ||
FColorList tile(FColorList, int xMult, int yMult, int columns) | ||
FColorList tile_pieces(FColorList, int columns, int newColumns, int newRows, | ||
int xCenter, int yCenter) | ||
|
||
def tile_color_list(object fcl, int x_mult, int y_mult, int columns=0): | ||
def tile_color_list(object fcl, int x_mult, int y_mult): | ||
cdef ColorList source | ||
cdef ColorList result | ||
|
||
source = toColorList(fcl) | ||
columns = columns or fcl.columns | ||
if not columns: | ||
if not fcl.columns: | ||
return source | ||
|
||
result = ColorList(columns=columns * x_mult) | ||
result.thisptr.copy(tile(source.thisptr[0], x_mult, y_mult, columns)) | ||
result = ColorList(columns=fcl.columns * x_mult) | ||
result.thisptr.copy(tile(source.thisptr[0], x_mult, y_mult, fcl.columns)) | ||
return result | ||
|
||
def tile_colors(object fcl, int new_columns, int new_rows, | ||
int x_center=-1, int y_center=-1): | ||
|
||
cdef ColorList source | ||
cdef ColorList result | ||
|
||
source = toColorList(fcl) | ||
if not fcl.columns: | ||
return source | ||
|
||
result = ColorList(columns=new_columns) | ||
result.thisptr.copy(tile_pieces( | ||
source.thisptr[0], fcl.columns, | ||
new_columns, new_rows, x_center, y_center)) | ||
return result | ||
|
||
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
__all__ = 'Alias', 'Broadcast', 'Transfer', 'Save', 'Window' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters