File: libraw_checked_buffer.h

package info (click to toggle)
libraw 0.22.0-1~exp1
  • links: PTS, VCS
  • area: main
  • in suites: experimental
  • size: 3,648 kB
  • sloc: cpp: 55,742; ansic: 2,812; makefile: 135; sh: 78; perl: 58
file content (31 lines) | stat: -rw-r--r-- 917 bytes parent folder | download | duplicates (3)
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
#pragma once

#include <vector>
#include "../libraw/libraw_types.h"

class checked_buffer_t
{
public:
  // create with internal storage
	checked_buffer_t(short ord, int size);
	checked_buffer_t(short ord, unsigned char *dd, int ss);
	ushort sget2(int offset);
	ushort sget2LL(INT64 offset) { return sget2(int(offset)); }
	void checkoffset(int off);
	unsigned char operator[](int idx);
	unsigned sget4(int offset);
	unsigned sget4LL(INT64 offset) { return sget4(int(offset)); }
	double sgetreal(int type, int offset);
	float sgetrealf(int type, int offset) { return float(sgetreal(type, offset)); }
    unsigned char *data() { return _data; }
 
	int tiff_sget(unsigned save, INT64 *tag_offset, unsigned *tag_id, unsigned *tag_type, INT64 *tag_dataoffset,
		unsigned *tag_datalen, int *tag_dataunitlen);
protected:
  short _order;

 private:
  unsigned char *_data;
  int _len;
  std::vector<unsigned char> storage;
};