Scroom
0.14
tile.hh
Go to the documentation of this file.
1
/*
2
* Scroom - Generic viewer for 2D data
3
* Copyright (C) 2009-2022 Kees-Jan Dijkzeul
4
*
5
* SPDX-License-Identifier: LGPL-2.1
6
*/
7
8
#pragma once
9
10
#include <utility>
11
12
#include <boost/shared_ptr.hpp>
13
#include <boost/weak_ptr.hpp>
14
15
#include <
scroom/global.hh
>
16
#include <
scroom/memoryblobs.hh
>
17
18
class
Tile
19
{
20
public
:
21
using
Ptr
= boost::shared_ptr<Tile>;
22
using
WeakPtr
= boost::weak_ptr<Tile>;
23
24
int
width
;
25
int
height
;
26
int
bpp
;
27
Scroom::MemoryBlobs::RawPageData::Ptr
data
;
28
29
public
:
30
Tile
(
int
width_,
int
height_,
int
bpp_,
Scroom::MemoryBlobs::RawPageData::Ptr
data_)
31
:
width
(width_)
32
,
height
(height_)
33
,
bpp
(bpp_)
34
,
data
(std::move(data_))
35
{
36
}
37
38
static
Tile::Ptr
create
(
int
width
,
int
height
,
int
bpp
,
Scroom::MemoryBlobs::RawPageData::Ptr
data
)
39
{
40
return
Ptr
(
new
Tile
(
width
,
height
,
bpp
, std::move(
data
)));
41
}
42
};
43
44
class
ConstTile
45
{
46
public
:
47
using
Ptr
= boost::shared_ptr<ConstTile>;
48
using
WeakPtr
= boost::weak_ptr<ConstTile>;
49
50
int
width
;
51
int
height
;
52
int
bpp
;
53
Scroom::MemoryBlobs::RawPageData::ConstPtr
data
;
54
55
public
:
56
ConstTile
(
int
width_,
int
height_,
int
bpp_,
Scroom::MemoryBlobs::RawPageData::ConstPtr
data_)
57
:
width
(width_)
58
,
height
(height_)
59
,
bpp
(bpp_)
60
,
data
(std::move(data_))
61
{
62
}
63
64
static
ConstTile::Ptr
create
(
int
width
,
int
height
,
int
bpp
,
Scroom::MemoryBlobs::RawPageData::ConstPtr
data
)
65
{
66
return
Ptr
(
new
ConstTile
(
width
,
height
,
bpp
, std::move(
data
)));
67
}
68
};
Tile::data
Scroom::MemoryBlobs::RawPageData::Ptr data
Definition:
tile.hh:27
ConstTile::data
Scroom::MemoryBlobs::RawPageData::ConstPtr data
Definition:
tile.hh:53
ConstTile::ConstTile
ConstTile(int width_, int height_, int bpp_, Scroom::MemoryBlobs::RawPageData::ConstPtr data_)
Definition:
tile.hh:56
global.hh
Scroom::MemoryBlobs::RawPageData::ConstPtr
boost::shared_ptr< const uint8_t > ConstPtr
Definition:
memoryblobs.hh:28
ConstTile::bpp
int bpp
Definition:
tile.hh:52
Tile::create
static Tile::Ptr create(int width, int height, int bpp, Scroom::MemoryBlobs::RawPageData::Ptr data)
Definition:
tile.hh:38
Tile
Definition:
tile.hh:18
ConstTile::Ptr
boost::shared_ptr< ConstTile > Ptr
Definition:
tile.hh:47
Tile::bpp
int bpp
Definition:
tile.hh:26
Tile::width
int width
Definition:
tile.hh:24
ConstTile::create
static ConstTile::Ptr create(int width, int height, int bpp, Scroom::MemoryBlobs::RawPageData::ConstPtr data)
Definition:
tile.hh:64
Scroom::MemoryBlobs::RawPageData::Ptr
boost::shared_ptr< uint8_t > Ptr
Definition:
memoryblobs.hh:27
memoryblobs.hh
Tile::height
int height
Definition:
tile.hh:25
ConstTile::width
int width
Definition:
tile.hh:50
Tile::Ptr
boost::shared_ptr< Tile > Ptr
Definition:
tile.hh:21
ConstTile::height
int height
Definition:
tile.hh:51
Tile::Tile
Tile(int width_, int height_, int bpp_, Scroom::MemoryBlobs::RawPageData::Ptr data_)
Definition:
tile.hh:30
ConstTile::WeakPtr
boost::weak_ptr< ConstTile > WeakPtr
Definition:
tile.hh:48
ConstTile
Definition:
tile.hh:44
Tile::WeakPtr
boost::weak_ptr< Tile > WeakPtr
Definition:
tile.hh:22
inc
scroom
tile.hh
Generated by
1.8.17