]> Cypherpunks repositories - gostls13.git/commit
image: spin off a new color package out of the image package.
authorNigel Tao <nigeltao@golang.org>
Tue, 4 Oct 2011 00:09:03 +0000 (11:09 +1100)
committerNigel Tao <nigeltao@golang.org>
Tue, 4 Oct 2011 00:09:03 +0000 (11:09 +1100)
commita2846e65dc1a09088bbebbf71eade1a232c7a6e2
tree733cedd02e3ce1470af6ff12fe6c49f77d0b99f5
parent934c76801938aaaa9f2d66513a3c0c1652783586
image: spin off a new color package out of the image package.

The spin-off renames some types. The new names are simply better:
image.Color              -> color.Color
image.ColorModel         -> color.Model
image.ColorModelFunc     -> color.ModelFunc
image.PalettedColorModel -> color.Palette
image.RGBAColor          -> color.RGBA
image.RGBAColorModel     -> color.RGBAModel
image.RGBA64Color        -> color.RGBA64
image.RGBA64ColorModel   -> color.RGBA64Model
(similarly for NRGBAColor, GrayColorModel, etc)

The image.ColorImage type stays in the image package, but is renamed:
image.ColorImage -> image.Uniform

The image.Image implementations (image.RGBA, image.RGBA64, image.NRGBA,
image.Alpha, etc) do not change their name, and gain a nice symmetry:
an image.RGBA is an image of color.RGBA, etc.

The image.Black, image.Opaque uniform images remain unchanged (although
their type is renamed from image.ColorImage to image.Uniform). The
corresponding color types (color.Black, color.Opaque, etc) are new.

Nothing in the image/ycbcr is renamed yet. The ycbcr.YCbCrColor and
ycbcr.YCbCrImage types will eventually migrate to color.YCbCr and
image.YCbCr, but that will be a separate CL.

R=r, bsiegert
CC=golang-dev
https://golang.org/cl/5132048
25 files changed:
src/cmd/gofix/Makefile
src/cmd/gofix/imagecolor.go [new file with mode: 0644]
src/cmd/gofix/imagecolor_test.go [new file with mode: 0644]
src/cmd/gofix/imagenew_test.go
src/pkg/Makefile
src/pkg/image/Makefile
src/pkg/image/bmp/reader.go
src/pkg/image/color/Makefile [new file with mode: 0644]
src/pkg/image/color/color.go [new file with mode: 0644]
src/pkg/image/decode_test.go
src/pkg/image/draw/bench_test.go
src/pkg/image/draw/draw.go
src/pkg/image/draw/draw_test.go
src/pkg/image/gif/reader.go
src/pkg/image/image.go
src/pkg/image/image_test.go
src/pkg/image/jpeg/reader.go
src/pkg/image/jpeg/writer_test.go
src/pkg/image/names.go
src/pkg/image/png/reader.go
src/pkg/image/png/reader_test.go
src/pkg/image/png/writer.go
src/pkg/image/png/writer_test.go
src/pkg/image/tiff/reader.go
src/pkg/image/ycbcr/ycbcr.go