|
dng_mosaic_info Class ReferenceSupport for describing color filter array patterns and manipulating mosaic sample data.
More...
#include <dng_mosaic_info.h>
List of all members.
|
Public Member Functions |
virtual void | Parse (dng_host &host, dng_stream &stream, dng_info &info) |
virtual void | PostParse (dng_host &host, dng_negative &negative) |
bool | IsColorFilterArray () const |
virtual bool | SetFourColorBayer () |
virtual dng_point | FullScale () const |
virtual dng_point | DownScale (uint32 minSize, uint32 prefSize, real64 cropFactor) const |
virtual dng_point | DstSize (const dng_point &downScale) const |
virtual void | InterpolateGeneric (dng_host &host, dng_negative &negative, const dng_image &srcImage, dng_image &dstImage, uint32 srcPlane=0) const |
virtual void | InterpolateFast (dng_host &host, dng_negative &negative, const dng_image &srcImage, dng_image &dstImage, const dng_point &downScale, uint32 srcPlane=0) const |
virtual void | Interpolate (dng_host &host, dng_negative &negative, const dng_image &srcImage, dng_image &dstImage, const dng_point &downScale, uint32 srcPlane=0) const |
Public Attributes |
dng_point | fCFAPatternSize |
| Size of fCFAPattern.
|
uint8 | fCFAPattern [kMaxCFAPattern][kMaxCFAPattern] |
| CFA pattern from CFAPattern tag in the TIFF/EP specification..
|
uint32 | fColorPlanes |
| Number of color planes in DNG input.
|
uint8 | fCFAPlaneColor [kMaxColorPlanes] |
uint32 | fCFALayout |
uint32 | fBayerGreenSplit |
Protected Member Functions |
virtual bool | IsSafeDownScale (const dng_point &downScale) const |
uint32 | SizeForDownScale (const dng_point &downScale) const |
virtual bool | ValidSizeDownScale (const dng_point &downScale, uint32 minSize) const |
Protected Attributes |
dng_point | fSrcSize |
dng_point | fCroppedSize |
real64 | fAspectRatio |
Detailed Description
Support for describing color filter array patterns and manipulating mosaic sample data.
See CFAPattern tag in TIFF/EP specification and CFAPlaneColor, CFALayout, and BayerGreenSplit tags in the DNG 1.1.0 specification.
Member Function Documentation
dng_point dng_mosaic_info::DownScale |
( |
uint32 |
minSize, |
|
|
uint32 |
prefSize, |
|
|
real64 |
cropFactor | |
|
) |
| | const [virtual] |
Returns integer factors by which mosaic data must be downsampled to produce an image which is as close to prefSize as possible in longer dimension, but no smaller than minSize. - Parameters:
-
| minSize | Number of pixels as minium for longer dimension of downsampled image. |
| prefSize | Number of pixels as target for longer dimension of downsampled image. |
| cropFactor | Faction of the image to be used after cropping. |
- Return values:
-
| Point | containing integer factors by which image must be downsampled. |
References IsColorFilterArray().
dng_point dng_mosaic_info::DstSize |
( |
const dng_point & |
downScale |
) |
const [virtual] |
Return size of demosaiced image for passed in downscaling factor. - Parameters:
-
| downScale | Integer downsampling factor obtained from DownScale method. |
- Return values:
-
| Size | of resulting demosaiced image. |
References FullScale().
dng_point dng_mosaic_info::FullScale |
( |
|
) |
const [virtual] |
Returns scaling factor relative to input size needed to capture output data. Staggered (or rotated) sensing arrays are produced to a larger output than the number of input samples. This method indicates how much larger. - Return values:
-
| a | point with integer scaling factors for the horizotal and vertical dimensions. |
References fCFALayout.
Referenced by DstSize(), and InterpolateGeneric().
void dng_mosaic_info::Interpolate |
( |
dng_host & |
host, |
|
|
dng_negative & |
negative, |
|
|
const dng_image & |
srcImage, |
|
|
dng_image & |
dstImage, |
|
|
const dng_point & |
downScale, |
|
|
uint32 |
srcPlane = 0 | |
|
) |
| | const [virtual] |
Demosaic interpolation of a single plane. Chooses between generic and fast interpolators based on parameters. - Parameters:
-
| host | dng_host to use for buffer allocation requests, user cancellation testing, and progress updates. |
| negative | DNG negative of mosaiced data. |
| srcImage | Source image for mosaiced data. |
| dstImage | Destination image for resulting interpolated data. |
| downScale | Amount (in horizontal and vertical) by which to subsample image. |
| srcPlane | Which plane to interpolate. |
References InterpolateFast(), and InterpolateGeneric().
void dng_mosaic_info::InterpolateFast |
( |
dng_host & |
host, |
|
|
dng_negative & |
negative, |
|
|
const dng_image & |
srcImage, |
|
|
dng_image & |
dstImage, |
|
|
const dng_point & |
downScale, |
|
|
uint32 |
srcPlane = 0 | |
|
) |
| | const [virtual] |
Demosaic interpolation of a single plane for downsampled case. - Parameters:
-
| host | dng_host to use for buffer allocation requests, user cancellation testing, and progress updates. |
| negative | DNG negative of mosaiced data. |
| srcImage | Source image for mosaiced data. |
| dstImage | Destination image for resulting interpolated data. |
| downScale | Amount (in horizontal and vertical) by which to subsample image. |
| srcPlane | Which plane to interpolate. |
References dng_image::Bounds(), and dng_host::PerformAreaTask().
Referenced by Interpolate().
Demosaic interpolation of a single plane for non-downsampled case. - Parameters:
-
| host | dng_host to use for buffer allocation requests, user cancellation testing, and progress updates. |
| negative | DNG negative of mosaiced data. |
| srcImage | Source image for mosaiced data. |
| dstImage | Destination image for resulting interpolated data. |
| srcPlane | Which plane to interpolate. |
References dng_host::Allocate(), dng_image::Bounds(), dng_image::edge_repeat, fCFAPatternSize, FullScale(), dng_image::Get(), dng_image::PixelSize(), dng_image::PixelType(), dng_image::Put(), dng_image::RepeatingTile(), and dng_host::SniffForAbort().
Referenced by Interpolate().
bool dng_mosaic_info::IsColorFilterArray |
( |
|
) |
const [inline] |
bool dng_mosaic_info::SetFourColorBayer |
( |
|
) |
[virtual] |
Enable generating four-plane output from three-plane Bayer input. Extra plane is a second version of the green channel. First green is produced using green mosaic samples from one set of rows/columns (even/odd) and the second green channel is produced using the other set of rows/columns. One can compare the two versions to judge whether BayerGreenSplit needs to be set for a given input source.
References fCFAPattern, fCFAPatternSize, and fColorPlanes.
Member Data Documentation
Value of BayerGreeSplit tag in DNG file. BayerGreenSplit only applies to CFA images using a Bayer pattern filter array. This tag specifies, in arbitrary units, how closely the values of the green pixels in the blue/green rows track the values of the green pixels in the red/green rows.
A value of zero means the two kinds of green pixels track closely, while a non-zero value means they sometimes diverge. The useful range for this tag is from 0 (no divergence) to about 5000 (large divergence).
Value of CFALayout tag in the DNG 1.3 specification. CFALayout describes the spatial layout of the CFA. The currently defined values are:
- 1 = Rectangular (or square) layout.
- 2 = Staggered layout A: even columns are offset down by 1/2 row.
- 3 = Staggered layout B: even columns are offset up by 1/2 row.
- 4 = Staggered layout C: even rows are offset right by 1/2 column.
- 5 = Staggered layout D: even rows are offset left by 1/2 column.
- 6 = Staggered layout E: even rows are offset up by 1/2 row, even columns are offset left by 1/2 column.
- 7 = Staggered layout F: even rows are offset up by 1/2 row, even columns are offset right by 1/2 column.
- 8 = Staggered layout G: even rows are offset down by 1/2 row, even columns are offset left by 1/2 column.
- 9 = Staggered layout H: even rows are offset down by 1/2 row, even columns are offset right by 1/2 column.
Referenced by FullScale(), and dng_image_writer::WriteDNG().
The documentation for this class was generated from the following files:
|