Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func DecodePNGToRaw ¶
DecodePNGToRaw decodes PNG data into raw pixel bytes suitable for a PDF image XObject. Returns the raw bytes, pixel dimensions, and the PDF color space name.
func DetectDimensions ¶
DetectDimensions attempts to get pixel dimensions from PNG/JPEG data without full decode.
Types ¶
type ImageInfo ¶
type ImageInfo struct {
Raw []byte
WidthPx, HeightPx int
ColorSpace string
IsJPEG bool
BitsPerComponent int
}
ImageInfo holds processed image data.
func ProcessImage ¶
ProcessImage detects format and decodes if needed.
type Options ¶
type Options struct {
PageIndex int
X, Y float64
Width, Height float64
// Optional exact placement matrix (a,b,c,d,e,f) in page space. When non-zero, overrides X/Y/Width/Height.
Matrix [6]float64
Data []byte
PixelWidth int
PixelHeight int
BitsPerComponent int
ColorSpace string
AltText string
IsJPEG bool
Opacity float64
RotateDeg float64
ClipCircle bool
ClipCX, ClipCY float64
ClipRadius float64
IsArtifact bool
// Optional soft mask for alpha
HasMask bool
Mask []byte
MaskWidth int
MaskHeight int
}
Options configures image placement. Used by DrawImageWith and DrawTaggedImageWith as a cleaner alternative to methods with many positional parameters.
Click to show internal directories.
Click to hide internal directories.