dng_filter_task Class Reference

Represents a task which filters an area of a source dng_image to an area of a destination dng_image. More...

#include <dng_filter_task.h>

Inheritance diagram for dng_filter_task:

dng_area_task

List of all members.


Public Member Functions

 dng_filter_task (const dng_image &srcImage, dng_image &dstImage)
virtual dng_rect SrcArea (const dng_rect &dstArea)
virtual dng_point SrcTileSize (const dng_point &dstTileSize)
virtual void ProcessArea (uint32 threadIndex, dng_pixel_buffer &srcBuffer, dng_pixel_buffer &dstBuffer)=0
virtual void Start (uint32 threadCount, const dng_point &tileSize, dng_memory_allocator *allocator, dng_abort_sniffer *sniffer)
virtual void Process (uint32 threadIndex, const dng_rect &area, dng_abort_sniffer *sniffer)

Protected Attributes

const dng_imagefSrcImage
dng_imagefDstImage
uint32 fSrcPlane
uint32 fSrcPlanes
uint32 fSrcPixelType
uint32 fDstPlane
uint32 fDstPlanes
uint32 fDstPixelType
dng_point fSrcRepeat
AutoPtr< dng_memory_blockfSrcBuffer [kMaxMPThreads]
AutoPtr< dng_memory_blockfDstBuffer [kMaxMPThreads]

Detailed Description

Represents a task which filters an area of a source dng_image to an area of a destination dng_image.

Constructor & Destructor Documentation

dng_filter_task::dng_filter_task ( const dng_image srcImage,
dng_image dstImage 
)

Construct a filter task given a source and destination images.

Parameters:
srcImage Image from which source pixels are read.
dstImage Image to which result pixels are written.


Member Function Documentation

void dng_filter_task::Process ( uint32  threadIndex,
const dng_rect &  area,
dng_abort_sniffer sniffer 
) [virtual]

Process one tile or partitioned area. Should not be overridden. Instead, override ProcessArea, which is where to implement filter processing for a specific type of dng_filter_task. There is no allocator parameter as all allocation should be done in Start.

Parameters:
threadIndex 0 to threadCount - 1 index indicating which thread this is. (Can be used to get a thread-specific buffer allocated in the Start method.)
area Size of tiles to be used for sizing buffers, etc. (Edges of processing can be smaller.)
sniffer dng_abort_sniffer to use to check for user cancellation and progress updates.

Implements dng_area_task.

References dng_image::edge_repeat, dng_image::Get(), ProcessArea(), dng_image::Put(), and SrcArea().

virtual void dng_filter_task::ProcessArea ( uint32  threadIndex,
dng_pixel_buffer srcBuffer,
dng_pixel_buffer dstBuffer 
) [pure virtual]

Implements filtering operation from one buffer to another. Source and destination pixels are set up in member fields of this class. Ideally, no allocation should be done in this routine.

Parameters:
threadIndex The thread on which this routine is being called, between 0 and threadCount - 1 for the threadCount passed to Start method.
srcBuffer Input area and source pixels.
dstBuffer Output area and destination pixels.

Referenced by Process().

virtual dng_rect dng_filter_task::SrcArea ( const dng_rect &  dstArea  )  [inline, virtual]

Compute the source area needed for a given destination area. Default implementation assumes destination area is equal to source area for all cases.

Parameters:
dstArea Area to for which pixels will be computed.
Return values:
The source area needed as input to calculate the requested destination area.

Referenced by Process(), and SrcTileSize().

virtual dng_point dng_filter_task::SrcTileSize ( const dng_point &  dstTileSize  )  [inline, virtual]

Given a destination tile size, calculate input tile size. Simlar to SrcArea, and should seldom be overridden.

Parameters:
dstTileSize The destination tile size that is targeted for output.
Return values:
The source tile size needed to compute a tile of the destination size.

References SrcArea().

Referenced by Start().

void dng_filter_task::Start ( uint32  threadCount,
const dng_point &  tileSize,
dng_memory_allocator allocator,
dng_abort_sniffer sniffer 
) [virtual]

Called prior to processing on specific threads. Can be used to allocate per-thread memory buffers, etc.

Parameters:
threadCount Total number of threads that will be used for processing. Less than or equal to MaxThreads of dng_area_task.
tileSize Size of source tiles which will be processed. (Not all tiles will be this size due to edge conditions.)
allocator dng_memory_allocator to use for allocating temporary buffers, etc.
sniffer Sniffer to test for user cancellation and to set up progress.

Reimplemented from dng_area_task.

References dng_memory_allocator::Allocate(), and SrcTileSize().


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