Welcome to mirror list, hosted at ThFree Co, Russian Federation.

image.hpp « graphics - github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: cd5752b118324272153a12a4d1506e4e3c33ca9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#pragma once

#include "defines.hpp"
#include "resource.hpp"

#include "../std/string.hpp"

#include "../geometry/point2d.hpp"

namespace graphics
{
  /// get dimensions of PNG image specified by it's resName.
  m2::PointU const GetDimensions(string const & resName, EDensity density);

  struct Image : public Resource
  {
    struct Info : public Resource::Info
    {
      string m_resourceName;
      m2::PointU m_size;
      vector<unsigned char> m_data;

      Info();
      Info(char const * resName, EDensity density);

      unsigned width() const;
      unsigned height() const;
      unsigned char const * data() const;

      Resource::Info const & cacheKey() const;
      m2::PointU const resourceSize() const;
      Resource * createResource(m2::RectU const & texRect,
                                uint8_t pipelineID) const;
      bool lessThan(Resource::Info const * r) const;
    };

    Info m_info;

    Image(m2::RectU const & texRect,
          int pipelineID,
          Info const & info);

    void render(void * dst);
    Resource::Info const * info() const;
  };
}