some improvments
This commit is contained in:
@@ -1619,33 +1619,6 @@ func (pc *PdfColorspaceLab) ImageToRGB(img Image) (Image, error) {
|
||||
// ICC Based colors.
|
||||
// Each component is defined in the range 0.0 - 1.0 where 1.0 is the primary intensity.
|
||||
|
||||
/*
|
||||
type PdfColorICCBased []float64
|
||||
|
||||
func NewPdfColorICCBased(vals []float64) *PdfColorICCBased {
|
||||
color := PdfColorICCBased{}
|
||||
for _, val := range vals {
|
||||
color = append(color, val)
|
||||
}
|
||||
return &color
|
||||
}
|
||||
|
||||
func (this *PdfColorICCBased) GetNumComponents() int {
|
||||
return len(*this)
|
||||
}
|
||||
|
||||
// Convert to an integer format.
|
||||
func (this *PdfColorICCBased) ToInteger(bits int) []uint32 {
|
||||
maxVal := math.Pow(2, float64(bits)) - 1
|
||||
ints := []uint32{}
|
||||
for _, val := range *this {
|
||||
ints = append(ints, uint32(maxVal*val))
|
||||
}
|
||||
|
||||
return ints
|
||||
|
||||
}
|
||||
*/
|
||||
// See p. 157 for calculations...
|
||||
|
||||
// format [/ICCBased stream]
|
||||
|
||||
@@ -157,7 +157,6 @@ func (im *Image) ToGoImage() (goimage.Image, error) {
|
||||
aidx := 0
|
||||
|
||||
samples := im.GetSamples()
|
||||
//bytesPerColor := colorComponents * int(this.BitsPerComponent) / 8
|
||||
bytesPerColor := im.ColorComponents
|
||||
for i := 0; i+bytesPerColor-1 < len(samples); i += bytesPerColor {
|
||||
var c gocolor.Color
|
||||
|
||||
Reference in New Issue
Block a user