-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add comments to exported types and methods
- Loading branch information
1 parent
3b112c5
commit 982cf59
Showing
22 changed files
with
141 additions
and
5 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
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
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,25 @@ | ||
package processor | ||
|
||
// CropPoint specifies which focus point in the image should be considered while cropping | ||
type CropPoint int | ||
|
||
const ( | ||
// CropTopLeft crops an image with focus point at top-left | ||
CropTopLeft CropPoint = 1 | ||
// CropTop crops an image with focus point at top | ||
CropTop CropPoint = 2 | ||
// CropTopRight crops an image with focus point at top-right | ||
CropTopRight CropPoint = 3 | ||
// CropLeft crops an image with focus point at left | ||
CropLeft CropPoint = 4 | ||
// CropCenter crops an image with focus point at center | ||
CropCenter CropPoint = 5 | ||
// CropRight crops an image with focus point at right | ||
CropRight CropPoint = 6 | ||
// CropBottomLeft crops an image with focus point at bottom-left | ||
CropBottomLeft CropPoint = 7 | ||
// CropBottom crops an image with focus point at bottom | ||
CropBottom CropPoint = 8 | ||
// CropBottomRight crops an image with focus point at bottom-right | ||
CropBottomRight CropPoint = 9 | ||
) |
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,9 +1,14 @@ | ||
package processor | ||
|
||
// Processor interface for performing operations on image | ||
// Processor interface for performing operations on image bytes | ||
type Processor interface { | ||
// Crop takes an input byte array, width, height and a CropPoint and returns the cropped image bytes or error | ||
Crop(input []byte, width, height int, point CropPoint) ([]byte, error) | ||
// Resize takes an input byte array, width and height and returns the re-sized image bytes or error | ||
Resize(input []byte, width, height int) ([]byte, error) | ||
// Watermark takes an input byte array, overlay byte array and opacity value | ||
// and returns the watermarked image bytes or error | ||
Watermark(base []byte, overlay []byte, opacity uint8) ([]byte, error) | ||
// GrayScale takes an input byte array and returns the grayscaled byte array or error | ||
GrayScale(input []byte) ([]byte, error) | ||
} |
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
Oops, something went wrong.