dng_pixel_buffer Class Reference

Holds a buffer of pixel data with "pixel geometry" metadata. More...

#include <dng_pixel_buffer.h>

Inheritance diagram for dng_pixel_buffer:

dng_tile_buffer dng_const_tile_buffer dng_dirty_tile_buffer

List of all members.


Public Member Functions

 dng_pixel_buffer (const dng_pixel_buffer &buffer)
dng_pixel_bufferoperator= (const dng_pixel_buffer &buffer)
uint32 PixelRange () const
const dng_rect & Area () const
uint32 Planes () const
int32 RowStep () const
int32 PlaneStep () const
const void * ConstPixel (int32 row, int32 col, uint32 plane=0) const
void * DirtyPixel (int32 row, int32 col, uint32 plane=0)
const uint8 * ConstPixel_uint8 (int32 row, int32 col, uint32 plane=0) const
uint8 * DirtyPixel_uint8 (int32 row, int32 col, uint32 plane=0)
const int8 * ConstPixel_int8 (int32 row, int32 col, uint32 plane=0) const
int8 * DirtyPixel_int8 (int32 row, int32 col, uint32 plane=0)
const uint16 * ConstPixel_uint16 (int32 row, int32 col, uint32 plane=0) const
uint16 * DirtyPixel_uint16 (int32 row, int32 col, uint32 plane=0)
const int16 * ConstPixel_int16 (int32 row, int32 col, uint32 plane=0) const
int16 * DirtyPixel_int16 (int32 row, int32 col, uint32 plane=0)
const uint32 * ConstPixel_uint32 (int32 row, int32 col, uint32 plane=0) const
uint32 * DirtyPixel_uint32 (int32 row, int32 col, uint32 plane=0)
const int32 * ConstPixel_int32 (int32 row, int32 col, uint32 plane=0) const
int32 * DirtyPixel_int32 (int32 row, int32 col, uint32 plane=0)
const real32 * ConstPixel_real32 (int32 row, int32 col, uint32 plane=0) const
real32 * DirtyPixel_real32 (int32 row, int32 col, uint32 plane=0)
void SetConstant (const dng_rect &area, uint32 plane, uint32 planes, uint32 value)
void SetConstant_uint8 (const dng_rect &area, uint32 plane, uint32 planes, uint8 value)
void SetConstant_uint16 (const dng_rect &area, uint32 plane, uint32 planes, uint16 value)
void SetConstant_int16 (const dng_rect &area, uint32 plane, uint32 planes, int16 value)
void SetConstant_uint32 (const dng_rect &area, uint32 plane, uint32 planes, uint32 value)
void SetConstant_real32 (const dng_rect &area, uint32 plane, uint32 planes, real32 value)
void SetZero (const dng_rect &area, uint32 plane, uint32 planes)
void CopyArea (const dng_pixel_buffer &src, const dng_rect &area, uint32 srcPlane, uint32 dstPlane, uint32 planes)
void CopyArea (const dng_pixel_buffer &src, const dng_rect &area, uint32 plane, uint32 planes)
void RepeatArea (const dng_rect &srcArea, const dng_rect &dstArea)
void RepeatSubArea (const dng_rect subArea, uint32 repeatV=1, uint32 repeatH=1)
 Replicates a sub-area of a buffer to fill the entire buffer.
void ShiftRight (uint32 shift)
void FlipH ()
void FlipV ()
void FlipZ ()
bool EqualArea (const dng_pixel_buffer &rhs, const dng_rect &area, uint32 plane, uint32 planes) const
real64 MaximumDifference (const dng_pixel_buffer &rhs, const dng_rect &area, uint32 plane, uint32 planes) const

Static Public Member Functions

static dng_point RepeatPhase (const dng_rect &srcArea, const dng_rect &dstArea)

Public Attributes

dng_rect fArea
uint32 fPlane
uint32 fPlanes
int32 fRowStep
int32 fColStep
int32 fPlaneStep
uint32 fPixelType
uint32 fPixelSize
void * fData
bool fDirty

Detailed Description

Holds a buffer of pixel data with "pixel geometry" metadata.

The pixel geometry describes the layout in terms of how many planes, rows and columns plus the steps (in bytes) between each column, row and plane.


Member Function Documentation

const dng_rect& dng_pixel_buffer::Area (  )  const [inline]

Get extent of pixels in buffer

Return values:
Rectangle giving valid extent of buffer.

const void* dng_pixel_buffer::ConstPixel ( int32  row,
int32  col,
uint32  plane = 0 
) const [inline]

Get read-only untyped (void *) pointer to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as void *.

Referenced by ConstPixel_int16(), ConstPixel_int32(), ConstPixel_int8(), ConstPixel_real32(), ConstPixel_uint16(), ConstPixel_uint32(), ConstPixel_uint8(), CopyArea(), EqualArea(), MaximumDifference(), dng_image::Put(), and RepeatArea().

const int16* dng_pixel_buffer::ConstPixel_int16 ( int32  row,
int32  col,
uint32  plane = 0 
) const [inline]

Get read-only int16 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as int16 *.

References ConstPixel().

const int32* dng_pixel_buffer::ConstPixel_int32 ( int32  row,
int32  col,
uint32  plane = 0 
) const [inline]

Get read-only int32 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as int32 *.

References ConstPixel().

const int8* dng_pixel_buffer::ConstPixel_int8 ( int32  row,
int32  col,
uint32  plane = 0 
) const [inline]

Get read-only int8 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as int8 *.

References ConstPixel().

const real32* dng_pixel_buffer::ConstPixel_real32 ( int32  row,
int32  col,
uint32  plane = 0 
) const [inline]

Get read-only real32 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as real32 *.

References ConstPixel().

const uint16* dng_pixel_buffer::ConstPixel_uint16 ( int32  row,
int32  col,
uint32  plane = 0 
) const [inline]

Get read-only uint16 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as uint16 *.

References ConstPixel().

const uint32* dng_pixel_buffer::ConstPixel_uint32 ( int32  row,
int32  col,
uint32  plane = 0 
) const [inline]

Get read-only uint32 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as uint32 *.

References ConstPixel().

const uint8* dng_pixel_buffer::ConstPixel_uint8 ( int32  row,
int32  col,
uint32  plane = 0 
) const [inline]

Get read-only uint8 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as uint8 *.

References ConstPixel().

void dng_pixel_buffer::CopyArea ( const dng_pixel_buffer src,
const dng_rect &  area,
uint32  plane,
uint32  planes 
) [inline]

Copy image data from an area of one pixel buffer to same area of another.

Parameters:
src Buffer to copy from.
area Rectangle of pixel buffer to copy.
plane Plane to start copy in src and this.
planes Number of planes to copy.

References CopyArea().

void dng_pixel_buffer::CopyArea ( const dng_pixel_buffer src,
const dng_rect &  area,
uint32  srcPlane,
uint32  dstPlane,
uint32  planes 
)

Copy image data from an area of one pixel buffer to same area of another.

Parameters:
src Buffer to copy from.
area Rectangle of pixel buffer to copy.
srcPlane Plane to start copy in src.
dstPlane Plane to start copy in dst.
planes Number of planes to copy.

References ConstPixel(), DirtyPixel(), PixelRange(), and ThrowNotYetImplemented().

Referenced by CopyArea(), and dng_image::CopyArea().

void* dng_pixel_buffer::DirtyPixel ( int32  row,
int32  col,
uint32  plane = 0 
) [inline]

Get a writable untyped (void *) pointer to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as void *.

References DNG_ASSERT.

Referenced by CopyArea(), DirtyPixel_int16(), DirtyPixel_int32(), DirtyPixel_int8(), DirtyPixel_real32(), DirtyPixel_uint16(), DirtyPixel_uint32(), DirtyPixel_uint8(), dng_image::Get(), RepeatArea(), dng_simple_image::Rotate(), SetConstant(), ShiftRight(), and dng_simple_image::Trim().

int16* dng_pixel_buffer::DirtyPixel_int16 ( int32  row,
int32  col,
uint32  plane = 0 
) [inline]

Get a writable int16 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as int16 *.

References DirtyPixel().

int32* dng_pixel_buffer::DirtyPixel_int32 ( int32  row,
int32  col,
uint32  plane = 0 
) [inline]

Get a writable int32 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as int32 *.

References DirtyPixel().

int8* dng_pixel_buffer::DirtyPixel_int8 ( int32  row,
int32  col,
uint32  plane = 0 
) [inline]

Get a writable int8 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as int8 *.

References DirtyPixel().

real32* dng_pixel_buffer::DirtyPixel_real32 ( int32  row,
int32  col,
uint32  plane = 0 
) [inline]

Get a writable real32 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as real32 *.

References DirtyPixel().

uint16* dng_pixel_buffer::DirtyPixel_uint16 ( int32  row,
int32  col,
uint32  plane = 0 
) [inline]

Get a writable uint16 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as uint16 *.

References DirtyPixel().

uint32* dng_pixel_buffer::DirtyPixel_uint32 ( int32  row,
int32  col,
uint32  plane = 0 
) [inline]

Get a writable uint32 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as uint32 *.

References DirtyPixel().

uint8* dng_pixel_buffer::DirtyPixel_uint8 ( int32  row,
int32  col,
uint32  plane = 0 
) [inline]

Get a writable uint8 * to pixel data starting at a specific pixel in the buffer.

Parameters:
row Start row for buffer pointer.
col Start column for buffer pointer.
plane Start plane for buffer pointer.
Return values:
Pointer to pixel data as uint8 *.

References DirtyPixel().

bool dng_pixel_buffer::EqualArea ( const dng_pixel_buffer rhs,
const dng_rect &  area,
uint32  plane,
uint32  planes 
) const

Return true if the contents of an area of the pixel buffer area are the same as those of another.

Parameters:
rhs Buffer to compare against.
area Rectangle of pixel buffer to test.
plane Plane to start comparing.
planes Number of planes to compare.
Return values:
bool true if areas are equal, false otherwise.

References ConstPixel(), and ThrowNotYetImplemented().

Referenced by dng_image::EqualArea().

void dng_pixel_buffer::FlipH (  ) 

Change metadata so pixels are iterated in opposite horizontal order. This operation does not require movement of actual pixel data.

void dng_pixel_buffer::FlipV (  ) 

Change metadata so pixels are iterated in opposite vertical order. This operation does not require movement of actual pixel data.

void dng_pixel_buffer::FlipZ (  ) 

Change metadata so pixels are iterated in opposite plane order. This operation does not require movement of actual pixel data.

real64 dng_pixel_buffer::MaximumDifference ( const dng_pixel_buffer rhs,
const dng_rect &  area,
uint32  plane,
uint32  planes 
) const

Return the absolute value of the maximum difference between two pixel buffers. Used for comparison testing with tolerance

Parameters:
rhs Buffer to compare against.
area Rectangle of pixel buffer to test.
plane Plane to start comparing.
planes Number of planes to compare.
Return values:
larges absolute value difference between the corresponding pixels each buffer across area.

References ConstPixel(), ThrowNotYetImplemented(), and ThrowProgramError().

uint32 dng_pixel_buffer::PixelRange (  )  const

Get the range of pixel values.

Return values:
Range of value a pixel can take. (Meaning [0, max] for unsigned case. Signed case is biased so [-32768, max - 32768].)

Referenced by CopyArea().

uint32 dng_pixel_buffer::Planes (  )  const [inline]

Number of planes of image data.

Return values:
Number of planes held in buffer.

int32 dng_pixel_buffer::PlaneStep (  )  const [inline]

Step, in pixels not bytes, between planes of data in buffer.

Return values:
plane step in pixels. May be negative.

void dng_pixel_buffer::RepeatArea ( const dng_rect &  srcArea,
const dng_rect &  dstArea 
)

Repeat the image data in srcArea across dstArea. (Generally used for padding operations.)

Parameters:
srcArea Area to repeat from.
dstArea Area to fill with data from srcArea.

References ConstPixel(), DirtyPixel(), RepeatPhase(), and ThrowNotYetImplemented().

Referenced by RepeatSubArea().

dng_point dng_pixel_buffer::RepeatPhase ( const dng_rect &  srcArea,
const dng_rect &  dstArea 
) [static]

Calculate the offset phase of destination rectangle relative to source rectangle. Phase is based on a 0,0 origin and the notion of repeating srcArea across dstArea. It is the number of pixels into srcArea to start repeating from when tiling dstArea.

Return values:
dng_point containing horizontal and vertical phase.

Referenced by RepeatArea().

int32 dng_pixel_buffer::RowStep (  )  const [inline]

Step, in pixels not bytes, between rows of data in buffer.

Return values:
row step in pixels. May be negative.

void dng_pixel_buffer::SetConstant ( const dng_rect &  area,
uint32  plane,
uint32  planes,
uint32  value 
)

Initialize a rectangular area of pixel buffer to a constant.

Parameters:
area Rectangle of pixel buffer to set.
plane Plane to start filling on.
planes Number of planes to fill.
value Constant value to set pixels to.

References DirtyPixel(), and ThrowNotYetImplemented().

Referenced by SetConstant_int16(), SetConstant_real32(), SetConstant_uint16(), SetConstant_uint32(), SetConstant_uint8(), and SetZero().

void dng_pixel_buffer::SetConstant_int16 ( const dng_rect &  area,
uint32  plane,
uint32  planes,
int16  value 
) [inline]

Initialize a rectangular area of pixel buffer to a constant signed 16-bit value.

Parameters:
area Rectangle of pixel buffer to set.
plane Plane to start filling on.
planes Number of planes to fill.
value Constant int16 value to set pixels to.

References DNG_ASSERT, and SetConstant().

void dng_pixel_buffer::SetConstant_real32 ( const dng_rect &  area,
uint32  plane,
uint32  planes,
real32  value 
) [inline]

Initialize a rectangular area of pixel buffer to a constant real 32-bit value.

Parameters:
area Rectangle of pixel buffer to set.
plane Plane to start filling on.
planes Number of planes to fill.
value Constant real32 value to set pixels to.

References DNG_ASSERT, and SetConstant().

void dng_pixel_buffer::SetConstant_uint16 ( const dng_rect &  area,
uint32  plane,
uint32  planes,
uint16  value 
) [inline]

Initialize a rectangular area of pixel buffer to a constant unsigned 16-bit value.

Parameters:
area Rectangle of pixel buffer to set.
plane Plane to start filling on.
planes Number of planes to fill.
value Constant uint16 value to set pixels to.

References DNG_ASSERT, and SetConstant().

void dng_pixel_buffer::SetConstant_uint32 ( const dng_rect &  area,
uint32  plane,
uint32  planes,
uint32  value 
) [inline]

Initialize a rectangular area of pixel buffer to a constant unsigned 32-bit value.

Parameters:
area Rectangle of pixel buffer to set.
plane Plane to start filling on.
planes Number of planes to fill.
value Constant uint32 value to set pixels to.

References DNG_ASSERT, and SetConstant().

void dng_pixel_buffer::SetConstant_uint8 ( const dng_rect &  area,
uint32  plane,
uint32  planes,
uint8  value 
) [inline]

Initialize a rectangular area of pixel buffer to a constant unsigned 8-bit value.

Parameters:
area Rectangle of pixel buffer to set.
plane Plane to start filling on.
planes Number of planes to fill.
value Constant uint8 value to set pixels to.

References DNG_ASSERT, and SetConstant().

void dng_pixel_buffer::SetZero ( const dng_rect &  area,
uint32  plane,
uint32  planes 
)

Initialize a rectangular area of pixel buffer to zeros.

Parameters:
area Rectangle of pixel buffer to zero.
area Area to zero
plane Plane to start filling on.
planes Number of planes to fill.

References SetConstant(), and ThrowNotYetImplemented().

void dng_pixel_buffer::ShiftRight ( uint32  shift  ) 

Apply a right shift (C++ oerpator >>) to all pixel values. Only implemented for 16-bit (signed or unsigned) pixel buffers.

Parameters:
shift Number of bits by which to right shift each pixel value.

References DirtyPixel(), and ThrowNotYetImplemented().


The documentation for this class was generated from the following files:

Copyright © 2006-2009 Adobe Systems Incorporated.

Use of this website signifies your agreement to the Terms of Use and Online Privacy Policy.

Search powered by Google