some improvments

This commit is contained in:
Adrian Zürcher
2026-01-01 11:00:23 +01:00
parent 8f313c00f0
commit ef0778c8b3
20 changed files with 305 additions and 385 deletions

View File

@@ -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]

View File

@@ -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