| 1 | // SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later |
|---|---|
| 2 | // Copyright 2010, SIL International, All rights reserved. |
| 3 | |
| 4 | #pragma once |
| 5 | |
| 6 | #include "inc/Main.h" |
| 7 | #include "inc/Face.h" |
| 8 | |
| 9 | namespace graphite2 { |
| 10 | |
| 11 | class Face; |
| 12 | |
| 13 | class Cmap |
| 14 | { |
| 15 | public: |
| 16 | |
| 17 | virtual ~Cmap() throw() {} |
| 18 | |
| 19 | virtual uint16 operator [] (const uint32) const throw() { return 0; } |
| 20 | |
| 21 | virtual operator bool () const throw() { return false; } |
| 22 | |
| 23 | CLASS_NEW_DELETE; |
| 24 | }; |
| 25 | |
| 26 | class DirectCmap : public Cmap |
| 27 | { |
| 28 | DirectCmap(const DirectCmap &); |
| 29 | DirectCmap & operator = (const DirectCmap &); |
| 30 | |
| 31 | public: |
| 32 | DirectCmap(const Face &); |
| 33 | virtual uint16 operator [] (const uint32 usv) const throw(); |
| 34 | virtual operator bool () const throw(); |
| 35 | |
| 36 | CLASS_NEW_DELETE; |
| 37 | private: |
| 38 | const Face::Table _cmap; |
| 39 | const void * _smp, |
| 40 | * _bmp; |
| 41 | }; |
| 42 | |
| 43 | class CachedCmap : public Cmap |
| 44 | { |
| 45 | CachedCmap(const CachedCmap &); |
| 46 | CachedCmap & operator = (const CachedCmap &); |
| 47 | |
| 48 | public: |
| 49 | CachedCmap(const Face &); |
| 50 | virtual ~CachedCmap() throw(); |
| 51 | virtual uint16 operator [] (const uint32 usv) const throw(); |
| 52 | virtual operator bool () const throw(); |
| 53 | CLASS_NEW_DELETE; |
| 54 | private: |
| 55 | bool m_isBmpOnly; |
| 56 | uint16 ** m_blocks; |
| 57 | }; |
| 58 | |
| 59 | } // namespace graphite2 |
| 60 |