Debian Codegraph @

core/libs/dngwriter/extra/dng_sdk/dng_simple_image.h

raw
1 /*****************************************************************************/
2 // Copyright 2006-2019 Adobe Systems Incorporated
3 // All Rights Reserved.
4 //
5 // NOTICE: Adobe permits you to use, modify, and distribute this file in
6 // accordance with the terms of the Adobe license agreement accompanying it.
7 /*****************************************************************************/
8
9 #ifndef __dng_simple_image__
10 #define __dng_simple_image__
11
12 /*****************************************************************************/
13
14 #include "dng_auto_ptr.h"
15 #include "dng_image.h"
16 #include "dng_memory.h"
17 #include "dng_pixel_buffer.h"
18
19 /*****************************************************************************/
20
21 /// dng_image derived class with simple Trim and Rotate functionality.
22
23 class dng_simple_image : public dng_image
24 {
25
26 protected:
27
28 dng_pixel_buffer fBuffer;
29
30 AutoPtr<dng_memory_block> fMemory;
31
32 dng_memory_allocator &fAllocator;
33
34 public:
35
36 dng_simple_image (const dng_rect &bounds,
37 uint32 planes,
38 uint32 pixelType,
39 dng_memory_allocator &allocator = gDefaultDNGMemoryAllocator);
40
41 dng_simple_image (dng_pixel_buffer &buffer,
42 dng_memory_allocator &allocator = gDefaultDNGMemoryAllocator);
43
44 virtual ~dng_simple_image ();
45
46 virtual dng_image * Clone () const;
47
48 /// Setter for pixel type.
49
50 virtual void SetPixelType (uint32 pixelType);
51
52 /// Trim image data outside of given bounds. Memory is not reallocated or freed.
53
54 virtual void Trim (const dng_rect &r);
55
56 /// Rotate image according to orientation.
57
58 virtual void Rotate (const dng_orientation &orientation);
59
60 /// Offset image.
61
62 virtual void Offset (const dng_point &offset);
63
64 /// Get the buffer for direct processing. (Unique to dng_simple_image.)
65
66 void GetPixelBuffer (dng_pixel_buffer &buffer)
67 {
68 buffer = fBuffer;
69 }
70
71 protected:
72
73 virtual void AcquireTileBuffer (dng_tile_buffer &buffer,
74 const dng_rect &area,
75 bool dirty) const;
76
77 };
78
79 /*****************************************************************************/
80
81 #endif
82
83 /*****************************************************************************/