summaryrefslogtreecommitdiff
path: root/src/data.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2015-11-28 13:15:37 +0000
committerCarl Hetherington <cth@carlh.net>2015-11-28 13:15:37 +0000
commit8ccf9e982971a8eca1027ad5c04d837b6ad068dc (patch)
treef1f4785df95a266a7d1a511729e379913096f57a /src/data.cc
parent257b936e9ed24043cfc1ed6e7e762858250bc388 (diff)
Add compress_j2k method and simple benchmark.
Diffstat (limited to 'src/data.cc')
-rw-r--r--src/data.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/data.cc b/src/data.cc
index a326ed3b..66970c91 100644
--- a/src/data.cc
+++ b/src/data.cc
@@ -47,3 +47,10 @@ Data::Data (boost::filesystem::path file)
throw FileError ("could not read file", file, -1);
}
}
+
+Data::Data (uint8_t const * data_, boost::uintmax_t size_)
+ : data (new uint8_t[size])
+ , size (size_)
+{
+ memcpy (data.get(), data_, size);
+}