-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Skyline rectangle packing -- -- Skyline rectangle packing for font atlases and the like using -- stb_rect_pack.h @package atlas @version 0 -- | Details of the implementation. -- -- The contents of this module do not fall under the PVP. Use at your own -- risk. module Data.Atlas.Internal newtype Atlas s Atlas :: ForeignPtr AtlasContext -> Atlas s data AtlasContext type Coord = Word16 data Rect data Node heuristicId :: Heuristic -> CInt data Heuristic -- | bottom-left sort-height BottomLeft :: Heuristic -- | best first sort-height BestFirst :: Heuristic sizeOfAtlas :: Int sizeOfNode :: Int sizeOfRect :: Int -- | Use and cast back and forth to ints instead for more natural API? data Pt Pt :: Int -> Int -> Pt peekWH :: Ptr Rect -> IO Pt peekXY :: Ptr Rect -> IO Pt pokeWH :: Ptr Rect -> Pt -> IO () peekMaybeXY :: Ptr Rect -> IO (Maybe Pt) atlasCtx :: Context die :: (MonadIO m, HasCallStack) => String -> m a instance Language.Haskell.TH.Syntax.Lift Data.Atlas.Internal.Pt instance GHC.Read.Read Data.Atlas.Internal.Pt instance GHC.Show.Show Data.Atlas.Internal.Pt instance GHC.Classes.Ord Data.Atlas.Internal.Pt instance GHC.Classes.Eq Data.Atlas.Internal.Pt instance Language.Haskell.TH.Syntax.Lift Data.Atlas.Internal.Heuristic instance GHC.Enum.Bounded Data.Atlas.Internal.Heuristic instance GHC.Arr.Ix Data.Atlas.Internal.Heuristic instance GHC.Enum.Enum Data.Atlas.Internal.Heuristic instance GHC.Read.Read Data.Atlas.Internal.Heuristic instance GHC.Show.Show Data.Atlas.Internal.Heuristic instance GHC.Classes.Ord Data.Atlas.Internal.Heuristic instance GHC.Classes.Eq Data.Atlas.Internal.Heuristic instance GHC.Show.Show (Data.Atlas.Internal.Atlas s) instance GHC.Classes.Ord (Data.Atlas.Internal.Atlas s) instance GHC.Classes.Eq (Data.Atlas.Internal.Atlas s) instance GHC.Num.Num Data.Atlas.Internal.Pt instance Data.Default.Class.Default Data.Atlas.Internal.Heuristic -- | skyline packing using stb_rect_pack.h module Data.Atlas data Atlas s -- | Create a packing context. create :: (HasCallStack, PrimMonad m) => Int -> Int -> m (Atlas (PrimState m)) -- | Initialization with an optional node count, when node count < -- width is used this results in quantization unless -- setAllowOutOfMem is enabled. When no value is supplied, it -- defaults to the width of the Atlas. createExplicit :: HasCallStack => PrimMonad m => Int -> Int -> Maybe Int -> m (Atlas (PrimState m)) -- | Reinitialize an atlas with the same parameters reset :: PrimMonad m => Atlas (PrimState m) -> m () data Heuristic -- | bottom-left sort-height BottomLeft :: Heuristic -- | best first sort-height BestFirst :: Heuristic setHeuristic :: PrimMonad m => Atlas (PrimState m) -> Heuristic -> m () setAllowOutOfMem :: PrimMonad m => Atlas (PrimState m) -> Bool -> m () -- | Use and cast back and forth to ints instead for more natural API? data Pt Pt :: Int -> Int -> Pt pack :: (PrimMonad m, Traversable f) => Atlas (PrimState m) -> (a -> Pt) -> (Maybe Pt -> a -> b) -> (Pt -> a -> c) -> f a -> m (Either (f b) (f c)) -- | Add one rectangle to the Atlas. Using pack can yield -- significantly better packing than calling this one rectangle at a -- time. pack1 :: PrimMonad m => Atlas (PrimState m) -> Pt -> m (Maybe Pt) packM :: (PrimBase m, Traversable f) => Atlas (PrimState m) -> (a -> m Pt) -> (Maybe Pt -> a -> b) -> (Pt -> a -> c) -> f a -> m (Either (f b) (f c))