Documentation
¶
Overview ¶
Package npcolor implements the color types and models used by Netpbm.
RGBAM and RGBAM64 are analogous to the color package's RGBA and RGBA64 in that they represent, respectively, colors with 8 bits and 16 bits per color channel. They additionally store a maximum channel value. Consequently, while a color.RGBA has a hard-wired upper bound of 255 per color channel, npcolor.RGBAM supports any upper bound from 1–255. Likewise, while a color.RGBA64 has a hard-wired upper bound of 65,535 per color channel, npcolor.RGBAM64 supports any upper bound from 1–65,535.
RGBM and RGBM64 are also analogous to the color package's RGBA and RGBA64 in that they represent, respectively, colors with 8 bits and 16 bits per color channel. While color.RGBA and color.RGBA64 store red, green, blue, and alpha channels, npcolor.RGBM and npcolor.RGBM64 lack alpha channels. However, they store a maximum channel value. Consequently, while a color.RGBA has a hard-wired upper bound of 255 per color channel, npcolor.RGBM supports any upper bound from 1–255. Likewise, while a color.RGBA64 has a hard-wired upper bound of 65,535 per color channel, npcolor.RGBM64 supports any upper bound from 1–65,535.
GrayM and GrayM32 are analogous to the color package's Gray and Gray16 in that they represent, respectively, 8-bit and 16-bit grayscale values. However, while a color.Gray value has a hard-wired upper bound of 255, npcolor.GrayM supports any upper bound from 1–255. Likewise, while a color.Gray16 value has a hard-wired upper bound of 65,535, npcolor.GrayM32 supports any upper bound from 1–65,535.
GrayAM and GrayAM32 have no analogue in the color package. They represent, respectively, 8-bit and 16-bit grayscale values with an alpha channel. Like the other colors represented in this package, these support variable maximum channel values. npcolor.GrayAM supports any upper bound from 1–255, and npcolor.GrayM32 supports any upper bound from 1–65,535.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type GrayAM ¶ added in v1.2.0
type GrayAM struct {
Y, A, M uint8
}
GrayAM represents an 8-bit grayscale value with an alpha channel and the value to represent 100% white.
type GrayAM48 ¶ added in v1.2.0
type GrayAM48 struct {
Y, A, M uint16
}
GrayAM48 represents a 16-bit grayscale value with an alpha channel and the value to represent 100% white.
type GrayAM48Model ¶ added in v1.2.0
type GrayAM48Model struct {
M uint16 // Maximum value of the luminance channel
}
A GrayAM48Model represents the maximum value of a GrayAM48 (0-65535).
type GrayAMModel ¶ added in v1.2.0
type GrayAMModel struct {
M uint8 // Maximum value of the luminance channel
}
A GrayAMModel represents the maximum value of a GrayAM (0-255).
type GrayM ¶
type GrayM struct {
Y, M uint8
}
GrayM represents an 8-bit grayscale value and the value to represent 100% white. Because GrayM does not support alpha channels it does make sense to describe it as either "alpha-premultiplied" or "non-alpha-premultiplied".
type GrayM32 ¶
type GrayM32 struct {
Y, M uint16
}
GrayM32 represents a 16-bit grayscale value and the value to represent 100% white. Because GrayM16 does not support alpha channels it does make sense to describe it as either "alpha-premultiplied" or "non-alpha-premultiplied".
type GrayM32Model ¶
type GrayM32Model struct {
M uint16 // Maximum value of the luminance channel
}
A GrayM32Model represents the maximum value of a GrayM32 (0-65535).
type GrayMModel ¶
type GrayMModel struct {
M uint8 // Maximum value of the luminance channel
}
A GrayMModel represents the maximum value of a GrayM (0-255).
type RGBAM ¶
type RGBAM struct {
R, G, B, A, M uint8
}
RGBAM represents a 32-bit color and the value used for 100% of a color channel.
type RGBAM64 ¶
type RGBAM64 struct {
R, G, B, A, M uint16
}
RGBAM64 represents a 48-bit color and the value used for 100% of a color channel.
type RGBAM64Model ¶
type RGBAM64Model struct {
M uint16 // Maximum value of each color channel
}
An RGBAM64Model represents the maximum value of an RGBAM64 (0-65535).
type RGBAMModel ¶
type RGBAMModel struct {
M uint8 // Maximum value of each color channel
}
An RGBAMModel represents the maximum value of an RGBM (0-255).
type RGBM ¶
type RGBM struct {
R, G, B, M uint8
}
RGBM represents a 24-bit color and the value used for 100% of a color channel. Because RGBM does not support alpha channels it does not make sense to describe it as either "alpha-premultiplied" or "non-alpha-premultiplied".
type RGBM64 ¶
type RGBM64 struct {
R, G, B, M uint16
}
RGBM64 represents a 48-bit color and the value used for 100% of a color channel.
type RGBM64Model ¶
type RGBM64Model struct {
M uint16 // Maximum value of each color channel
}
An RGBM64Model represents the maximum value of an RGBM64 (0-65535).