You.i Engine
YiSDFTextAtlas.h
Go to the documentation of this file.
1 // © You i Labs Inc. All rights reserved.
2 #ifndef _YI_SDF_TEXT_ATLAS_H_
3 #define _YI_SDF_TEXT_ATLAS_H_
4 
6 
23 {
24 public:
25  CYISDFTextAtlas(int32_t sDFFontSize = 64, int32_t sDFRadius = 4);
26  virtual ~CYISDFTextAtlas();
27 
28  virtual bool CreateNewFontAtlas(uint32_t width, uint32_t height) override;
29 
33  virtual void SetRegion(ssize_t id, void *pReference, YI_REGION region, GlyphData glyphData) override;
34 
38  int32_t GetSDFFontSize() const;
39 
43  int32_t GetSDFRadius() const;
44 
45 protected:
49  virtual bool CompareGlyphDetails(YI_GLYPH_DETAILS *pLeft, YI_GLYPH_DETAILS *pRight) const override;
50 
51 private:
52  void CopyGlyphDataIntoImage(const uint8_t *pGlyphData, int32_t glyphDataStride, size_t page, int32_t x, int32_t y, int32_t width, int32_t height);
53  void CreateAndAddTexture(ssize_t id, void *pReference, size_t page, int32_t x, int32_t y, int32_t width, int32_t height);
54  void SetRegionPreprocessed(ssize_t id, void *pReference, YI_REGION region, GlyphData glyphData);
55 
56  int32_t m_sDFFontSize;
57  int32_t m_sDFRadius;
58 };
59 
62 #endif
virtual void SetRegion(ssize_t id, void *pReference, YI_REGION region, GlyphData glyphData) override
CYISDFTextAtlas(int32_t sDFFontSize=64, int32_t sDFRadius=4)
Definition: YiAbstractTextAtlas.h:15
long long ssize_t
Definition: YiPredefWindows.h:21
virtual ~CYISDFTextAtlas()
Definition: YiAbstractTextAtlas.h:35
Definition: YiTextureAtlas.h:42
virtual bool CompareGlyphDetails(YI_GLYPH_DETAILS *pLeft, YI_GLYPH_DETAILS *pRight) const override
int32_t GetSDFRadius() const
Abstract class for a text atlas.
Definition: YiAbstractTextAtlas.h:29
Class for a signed distance field text atlas.
Definition: YiSDFTextAtlas.h:22
Definition: YiSignalHandler.h:175
virtual bool CreateNewFontAtlas(uint32_t width, uint32_t height) override
int32_t GetSDFFontSize() const