-
Notifications
You must be signed in to change notification settings - Fork 1
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
1 parent
4e0e103
commit 9005b38
Showing
3 changed files
with
57 additions
and
57 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 was deleted.
Oops, something went wrong.
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,39 @@ | ||
package size | ||
|
||
type Size struct { | ||
Width int | ||
Height int | ||
} | ||
|
||
type Pair struct { | ||
Source Size | ||
Destination Size | ||
} | ||
|
||
func NewSizePair(srcWidth, srcHeight, dstWidth, dstHeight int) Pair { | ||
return Pair{ | ||
Source: Size{Width: srcWidth, Height: srcHeight}, | ||
Destination: Size{Width: dstWidth, Height: dstHeight}, | ||
} | ||
} | ||
|
||
func (p *Pair) SrcWidth() int { | ||
return p.Source.Width | ||
} | ||
|
||
func (p *Pair) SrcHeight() int { | ||
return p.Source.Height | ||
} | ||
|
||
func (p *Pair) DstWidth() int { | ||
return p.Destination.Width | ||
} | ||
|
||
func (p *Pair) DstHeight() int { | ||
return p.Destination.Height | ||
} | ||
|
||
type FloatSize struct { | ||
Width float64 | ||
Height float64 | ||
} |