Documentation ¶
Index ¶
- Constants
- func Decode(quadtreePath string, outputPath string, cfg *config.Config) (io.Reader, *map[string]io.Reader, error)
- type ArchiveMode
- type ArchiveReader
- type ArchiveWriter
- type QuadtreeElement
- type QuadtreeImage
- func (q *QuadtreeImage) Encode(archiveMode ArchiveMode) (io.Reader, *map[string]io.Reader, error)
- func (q *QuadtreeImage) GetBlockImage(padded bool) image.Image
- func (q *QuadtreeImage) GetBoxImage(padded bool, deduplicated bool, palette map[*image.Image]color.Color) (image.Image, map[*image.Image]color.Color)
- func (q *QuadtreeImage) Partition()
- type VisualizationElement
Constants ¶
const ( BlockSize = 8 ChildCount = 4 MetaFile = "meta" )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ArchiveMode ¶
type ArchiveMode string
const ( ArchiveModeGzip ArchiveMode = "gzip" ArchiveModeZip ArchiveMode = "zip" )
type ArchiveReader ¶
type ArchiveReader struct {
// contains filtered or unexported fields
}
ArchiveReader is an abstraction that allows reading several different compression algorithms.
func OpenArchiveReader ¶
func OpenArchiveReader(name string) (*ArchiveReader, error)
OpenArchiveReader will open the archive file specified by name and return a reader.
func (*ArchiveReader) Files ¶
func (r *ArchiveReader) Files() map[string]*[]byte
File returns the list of files contained in the archive.
type ArchiveWriter ¶
type ArchiveWriter struct {
// contains filtered or unexported fields
}
ArchiveWriter is an abstraction that allows writing several different compression algorithms.
func NewArchiveWriter ¶
func NewArchiveWriter(mode ArchiveMode, writer io.Writer) (*ArchiveWriter, error)
NewArchiveWriter creates a new archive writer for the archive type mode and configures it to write to writer.
func (*ArchiveWriter) Close ¶
func (w *ArchiveWriter) Close() error
Close flushes the underlying archive to its writer.
type QuadtreeElement ¶
type QuadtreeElement struct {
// contains filtered or unexported fields
}
QuadtreeElement represents a node in the quadtree that can either be the parent of ChildCount children or contain a block image
func NewQuadtreeElement ¶
func NewQuadtreeElement(id string, baseImage image.Image, globalBounds *image.Rectangle, existingBlocks **[]*image.Image, existingBlocksMutex *sync.RWMutex, cfg *config.Config) *QuadtreeElement
NewQuadtreeElement returns a fully populated QuadtreeImage occupying the space of baseImage
type QuadtreeImage ¶
type QuadtreeImage struct {
// contains filtered or unexported fields
}
QuadtreeImage holds and manages a quadtree image
func NewQuadtreeImage ¶
func NewQuadtreeImage(baseImage image.Image, cfg *config.Config) *QuadtreeImage
NewQuadtreeImage constructs a well-formed instance of QuadtreeImage from a baseImage
func (*QuadtreeImage) Encode ¶
func (q *QuadtreeImage) Encode(archiveMode ArchiveMode) (io.Reader, *map[string]io.Reader, error)
Encode encodes a quadtree image into a single buffer and returns it
func (*QuadtreeImage) GetBlockImage ¶
func (q *QuadtreeImage) GetBlockImage(padded bool) image.Image
GetBlockImage creates a representation of the image encoded in the quadtree. If padded is true, the padding area around the original image is included as well.
func (*QuadtreeImage) GetBoxImage ¶
func (q *QuadtreeImage) GetBoxImage(padded bool, deduplicated bool, palette map[*image.Image]color.Color) (image.Image, map[*image.Image]color.Color)
GetBoxImage creates a representation of the bounding boxes of the quadtree. If padded is true, the padding area around the original image is included as well. If deduplicated is true, groups of deduplicated blocks should be colored the same The used palette is returned. It can be passed in further calls and thus be used again to color the same blocks in the same way.
func (*QuadtreeImage) Partition ¶
func (q *QuadtreeImage) Partition()
Partition splits the BaseImage into an appropriate number of sub images and calls their partition method TODO: Make this private and call it from Encode. Also rework Encode to work as a static function and handle creating the quadtree in there.
type VisualizationElement ¶
type VisualizationElement struct {
// contains filtered or unexported fields
}
VisualizationElement holds an image section and additional information relevant during visualization