From 02e009054d921cb23e2d95ebca5cabc74b958fb9 Mon Sep 17 00:00:00 2001 From: faiface Date: Tue, 11 Apr 2017 16:45:56 +0200 Subject: [PATCH] move ComposeTarget to separate file --- compose.go | 28 ++++++++++++++++++++++++++++ interface.go | 27 --------------------------- 2 files changed, 28 insertions(+), 27 deletions(-) create mode 100644 compose.go diff --git a/compose.go b/compose.go new file mode 100644 index 0000000..e64e439 --- /dev/null +++ b/compose.go @@ -0,0 +1,28 @@ +package pixel + +// ComposeTarget is a BasicTarget capable of Porter-Duff composition. +type ComposeTarget interface { + BasicTarget + + // SetComposeMethod sets a Porter-Duff composition method to be used. + SetComposeMethod(ComposeMethod) +} + +// ComposeMethod is a Porter-Duff composition method. +type ComposeMethod int + +// Here's the list of all available Porter-Duff composition methods. User ComposeOver for the basic +// alpha blending. +const ( + ComposeOver ComposeMethod = iota + ComposeIn + ComposeOut + ComposeAtop + ComposeRover + ComposeRin + ComposeRout + ComposeRatop + ComposeXor + ComposePlus + ComposeCopy +) diff --git a/interface.go b/interface.go index c5cb597..9aa5f2e 100644 --- a/interface.go +++ b/interface.go @@ -38,33 +38,6 @@ type BasicTarget interface { SetColorMask(color.Color) } -// ComposeTarget is a BasicTarget capable of Porter-Duff composition. -type ComposeTarget interface { - BasicTarget - - // SetComposeMethod sets a Porter-Duff composition method to be used. - SetComposeMethod(ComposeMethod) -} - -// ComposeMethod is a Porter-Duff composition method. -type ComposeMethod int - -// Here's the list of all available Porter-Duff composition methods. User ComposeOver for the basic -// alpha blending. -const ( - ComposeOver ComposeMethod = iota - ComposeIn - ComposeOut - ComposeAtop - ComposeRover - ComposeRin - ComposeRout - ComposeRatop - ComposeXor - ComposePlus - ComposeCopy -) - // Triangles represents a list of vertices, where each three vertices form a triangle. (First, // second and third is the first triangle, fourth, fifth and sixth is the second triangle, etc.) type Triangles interface {