Selaa lähdekoodia

consistency of indentation in comments

Grigory Dryapak 8 vuotta sitten
vanhempi
commit
01751cef8a
4 muutettua tiedostoa jossa 19 lisäystä ja 19 poistoa
  1. 9 9
      adjust.go
  2. 2 2
      effects.go
  3. 4 4
      resize.go
  4. 4 4
      tools.go

+ 9 - 9
adjust.go

@@ -10,17 +10,17 @@ import (
 //
 // Example:
 //
-// 	dstImage = imaging.AdjustFunc(
-// 		srcImage,
-// 		func(c color.NRGBA) color.NRGBA {
-// 			// shift the red channel by 16
+//	dstImage = imaging.AdjustFunc(
+//		srcImage,
+//		func(c color.NRGBA) color.NRGBA {
+//			// shift the red channel by 16
 //			r := int(c.R) + 16
 //			if r > 255 {
-// 				r = 255
-// 			}
-// 			return color.NRGBA{uint8(r), c.G, c.B, c.A}
-// 		}
-// 	)
+//				r = 255
+//			}
+//			return color.NRGBA{uint8(r), c.G, c.B, c.A}
+//		}
+//	)
 //
 func AdjustFunc(img image.Image, fn func(c color.NRGBA) color.NRGBA) *image.NRGBA {
 	src := toNRGBA(img)

+ 2 - 2
effects.go

@@ -14,7 +14,7 @@ func gaussianBlurKernel(x, sigma float64) float64 {
 //
 // Usage example:
 //
-//		dstImage := imaging.Blur(srcImage, 3.5)
+//	dstImage := imaging.Blur(srcImage, 3.5)
 //
 func Blur(img image.Image, sigma float64) *image.NRGBA {
 	if sigma <= 0 {
@@ -138,7 +138,7 @@ func blurVertical(src *image.NRGBA, kernel []float64) *image.NRGBA {
 //
 // Usage example:
 //
-//		dstImage := imaging.Sharpen(srcImage, 3.5)
+//	dstImage := imaging.Sharpen(srcImage, 3.5)
 //
 func Sharpen(img image.Image, sigma float64) *image.NRGBA {
 	if sigma <= 0 {

+ 4 - 4
resize.go

@@ -59,7 +59,7 @@ func precomputeWeights(dstSize, srcSize int, filter ResampleFilter) [][]indexWei
 //
 // Usage example:
 //
-//		dstImage := imaging.Resize(srcImage, 800, 600, imaging.Lanczos)
+//	dstImage := imaging.Resize(srcImage, 800, 600, imaging.Lanczos)
 //
 func Resize(img image.Image, width, height int, filter ResampleFilter) *image.NRGBA {
 	dstW, dstH := width, height
@@ -239,7 +239,7 @@ func resizeNearest(src *image.NRGBA, width, height int) *image.NRGBA {
 //
 // Usage example:
 //
-//		dstImage := imaging.Fit(srcImage, 800, 600, imaging.Lanczos)
+//	dstImage := imaging.Fit(srcImage, 800, 600, imaging.Lanczos)
 //
 func Fit(img image.Image, width, height int, filter ResampleFilter) *image.NRGBA {
 	maxW, maxH := width, height
@@ -284,7 +284,7 @@ func Fit(img image.Image, width, height int, filter ResampleFilter) *image.NRGBA
 //
 // Usage example:
 //
-//		dstImage := imaging.Fill(srcImage, 800, 600, imaging.Center, imaging.Lanczos)
+//	dstImage := imaging.Fill(srcImage, 800, 600, imaging.Center, imaging.Lanczos)
 //
 func Fill(img image.Image, width, height int, anchor Anchor, filter ResampleFilter) *image.NRGBA {
 	minW, minH := width, height
@@ -326,7 +326,7 @@ func Fill(img image.Image, width, height int, anchor Anchor, filter ResampleFilt
 //
 // Usage example:
 //
-//		dstImage := imaging.Thumbnail(srcImage, 100, 100, imaging.Lanczos)
+//	dstImage := imaging.Thumbnail(srcImage, 100, 100, imaging.Lanczos)
 //
 func Thumbnail(img image.Image, width, height int, filter ResampleFilter) *image.NRGBA {
 	return Fill(img, width, height, Center, filter)

+ 4 - 4
tools.go

@@ -136,11 +136,11 @@ func PasteCenter(background, img image.Image) *image.NRGBA {
 //
 // Usage examples:
 //
-//		// draw the sprite over the background at position (50, 50)
-//		dstImage := imaging.Overlay(backgroundImage, spriteImage, image.Pt(50, 50), 1.0)
+//	// draw the sprite over the background at position (50, 50)
+//	dstImage := imaging.Overlay(backgroundImage, spriteImage, image.Pt(50, 50), 1.0)
 //
-//		// blend two opaque images of the same size
-//		dstImage := imaging.Overlay(imageOne, imageTwo, image.Pt(0, 0), 0.5)
+//	// blend two opaque images of the same size
+//	dstImage := imaging.Overlay(imageOne, imageTwo, image.Pt(0, 0), 0.5)
 //
 func Overlay(background, img image.Image, pos image.Point, opacity float64) *image.NRGBA {
 	opacity = math.Min(math.Max(opacity, 0.0), 1.0) // check: 0.0 <= opacity <= 1.0