Skip to content

Commit

Permalink
GRBW
Browse files Browse the repository at this point in the history
  • Loading branch information
scottjoplin committed Oct 6, 2023
1 parent 1834fe9 commit b739063
Showing 1 changed file with 15 additions and 12 deletions.
27 changes: 15 additions & 12 deletions pixarray/pixarray.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,27 @@ const (
GBR
RGB
RBG
GRBW
)

var StringOrders map[string]int = map[string]int{
"GRB": GRB,
"BRG": BRG,
"BGR": BGR,
"GBR": GBR,
"RGB": RGB,
"RBG": RBG,
"GRB": GRB,
"BRG": BRG,
"BGR": BGR,
"GBR": GBR,
"RGB": RGB,
"RBG": RBG,
"GRBW": GRBW,
}

var offsets map[int][]int = map[int][]int{
GRB: {0, 1, 2, -1},
BRG: {2, 1, 0, -1},
BGR: {1, 2, 0, -1},
GBR: {0, 2, 1, -1},
RGB: {1, 0, 2, -1},
RBG: {2, 0, 1, -1},
GRB: {0, 1, 2, -1},
BRG: {2, 1, 0, -1},
BGR: {1, 2, 0, -1},
GBR: {0, 2, 1, -1},
RGB: {1, 0, 2, -1},
RBG: {2, 0, 1, -1},
GRBW: {0, 1, 2, 3},
}

func abs(i int) int {
Expand Down

0 comments on commit b739063

Please sign in to comment.