Inherited by DD::Image::FileReader.
Classes | |
class | Description |
Public Member Functions | |
Reader (Read *iop) | |
virtual | ~Reader () |
virtual bool | supports_stereo () const |
virtual bool | fileStereo () const |
virtual bool | videosequence () const |
int | rowPadMultiple () const noexcept |
Rows must be padded to be multiples of this value, in bytes. 0 means no padding. | |
void | setRowPadMultiple (int rowPadMultiple) noexcept |
Rows must be padded to be multiples of this value, in bytes. 0 means no padding. | |
bool | aborted () const |
Allows a reader to check directly if its op has been aborted. | |
const Iop::Info & | info () const |
int | x () const |
int | y () const |
int | r () const |
int | t () const |
int | w () const |
int | h () const |
bool | is_constant () const |
int | clampx (int x) const |
int | clampy (int y) const |
const Format & | format () const |
const Format & | full_size_format () const |
int | ydirection () const |
ChannelMask | channels () const |
int | first_frame () const |
int | last_frame () const |
int | width () const |
int | height () const |
const char * | filename () const |
int | frame () const |
bool | premult () const |
Channel | channel (const char *name) |
const char * | channel_name (Channel c) |
void | format (const Format &f) |
void | full_size_format (const Format &f) |
virtual void | setLUT (LUT *lut) |
virtual LUT * | lut () |
virtual std::string | getDefaultColorspace () const |
ReaderImpl * | getImpl () |
Get private implementation. | |
ReaderImpl * | getImpl () const |
virtual AudioReaderI * | audioReader () |
Static Public Member Functions | |
static U32 | lsb32 (const unsigned char *p) |
static U32 | msb32 (const unsigned char *p) |
static U16 | lsb16 (const unsigned char *p) |
static U16 | msb16 (const unsigned char *p) |
static void | flip (U16 *p, unsigned n) |
static void | flip (U32 *p, unsigned n) |
static void | fromlsb (U32 *p, unsigned n) |
static void | frommsb (U32 *p, unsigned n) |
static void | fromlsb (U16 *p, unsigned n) |
static void | frommsb (U16 *p, unsigned n) |
static void | setInPreviewMode (bool preview) |
static bool | inPreviewMode () |
Protected Types | |
enum | PlanarPreference { ePlanarNever, ePlanarAllow, ePlanarAlways } |
Protected Member Functions | |
virtual void | prefetchMetaData () |
virtual const MetaData::Bundle & | fetchMetaData (const char *key) |
virtual PlanarPreference | planarPreference () const |
virtual bool | useStripes () const |
virtual size_t | stripeHeight () const |
virtual PlanarI::PlaneID | getPlaneFromChannel (Channel chan) |
virtual void | open () |
virtual void | engine (int y, int x, int r, ChannelMask, Row &) |
virtual void | fetchPlane (ImagePlane &imagePlane) |
void | from_byte (Channel z, float *, const uchar *, const uchar *, int W, int delta=1) |
void | from_short (Channel z, float *, const U16 *, const U16 *, int W, int bits, int delta=1) |
void | from_float (Channel z, float *, const float *, const float *, int W, int delta=1) |
void | set_info (int width, int height, int depth, double aspect=0) |
Protected Attributes | |
Read * | iop |
LUT * | lut_ |
Iop::Info | info_ |
Friends | |
class | Read |
Reads data from a single image file (or other image source).
The Read creates one of these for each file it reads. Each different file type is a different subclass. Each subclass defines a Reader_Description object, all of these are searched to figure out what subclass to use.
For most image file types you will want to use the FileReader subclass, which provides multi-threaded access to a Unix file.
The base class for Reader both provides default implementations and serves as the "NullReader" that is used when the type cannot be figured out.
Reader::Reader | ( | Read * | iop | ) |
Subclasses should have constructors that match Reader_Description::constructor.
References DD::Image::IopInfo::black_outside(), DD::Image::GeneralInfo::first_frame(), DD::Image::Info2D::full_size_format(), DD::Image::GeneralInfo::last_frame(), DD::Image::Format::None, DD::Image::Box::set(), and DD::Image::IopInfo::ydirection().
|
virtual |
The destructor must close any files (even though the Read may have opened them).
|
inlineprotectedvirtual |
This should be overriden by videosequence file formats who wish to set frame-varying metadata. Set the metadata from this, rather than in the constructor, which would be used for other metadata.
|
inlineprotectedvirtual |
Return a value to indicate the Reader's preference as to planar access.
It can return ePlanarNever if it never wants fetchPlane() to be called; ePlanarAlways if it wants engine() to be called.
Otherwise, it should return ePlanarAllow to allow both planar access or row-based access depending upon what the using code thinks appropriate (for example single Row fetching will use engine() but GeneralTile would use fetchPlane)
|
inlineprotectedvirtual |
This should be overriden by subclasses if they want striping.
|
inlineprotectedvirtual |
This should be overriden by subclasses to return the desired stripe height.
References DD::Image::Box::h().
|
inlineprotectedvirtual |
Override this if you want your planes to be different to the default.
By default Nuke will try and decode all the channels at once
|
protectedvirtual |
|
protectedvirtual |
Read a line from the file and convert it to floats.
Warning: row.x may be greater than zero, row.r may be less than the image width, and channels may be less than the number of channels. Usually uncompression code is difficult to write with such clipping. To expand the size of the buffers in the row to the full width, and to read all the channel, do this:
The floating point buffer returned by row.writable() may be used with a cast as a temporary buffer to store 8 or 16 bit data.
References DD::Image::Op::debug().
|
protectedvirtual |
If you override planarPreference to return anything other than ePlanarNever, you should implement this
References DD::Image::Op::debug().
|
protected |
Convert bytes to floating point.
from should point at a set of W bytes, spaced delta apart. These are converted and placed into to (1 apart).
z is the channel number. If z >= 3 then linear (divide by 255) conversion is done.
Otherwise the lut() is called to do a normal conversion.
If premult() is on and alpha is not null, it should point at an array of W bytes for an alpha channel, spaced delta apart. The lut() is then called to do an unpremult-convert of the values.
References DD::Image::IopInfoOwner::channels(), DD::Image::LUT::from_byte(), lut(), and premult().
|
protected |
Same as from_byte() but the source data is an array of shorts in the range 0 to (2<<bits)-1.
References DD::Image::IopInfoOwner::channels(), DD::Image::LUT::from_short(), DD::Image::Linear::from_short(), lut(), and premult().
|
protected |
Same as from_byte() but the source is floating point data. Linear conversion will leave the numbers unchanged.
References DD::Image::IopInfoOwner::channels(), DD::Image::LUT::from_float(), lut(), and premult().
|
protected |
Set all the fields in the info_ correctly for an image file that is the given width and height in pixels and has depth channels of color data. This sets the bounding box to 0,0,width,height and sets the channels so the first depth bits are turned on. This will try to use the Read::expected_format() if it is the right size (so user choices for pixel aspect ratio and image area are preserved), otherwise it will find or generate a new format that matches.
The option pixel_aspect value forces the pixel aspect to be the given value. Zero means that any format that matches the width & height is used, and the pixel aspect defined for that is used.
If your image file has more information such as an actual bounding box or real channel assignments, you should modify the fields of info_ directly after (or instead of) calling this.
References DD::Image::Format::add(), DD::Image::IopInfo::black_outside(), DD::Image::Read::expected_read_format(), DD::Image::Format::findExisting(), DD::Image::Format::height(), DD::Image::Format::is_none(), DD::Image::Format::pixel_aspect(), DD::Image::Box::set(), and DD::Image::Format::width().
|
inline |
Returns the width value passed to iop->set_info()
|
inline |
Returns the height value passed to iop->set_info()
const char * Reader::filename | ( | ) | const |
The filename (this is set before frame() is called)
Referenced by DD::Image::FileReader::lock().
int Reader::frame | ( | ) | const |
bool Reader::premult | ( | ) | const |
The premult() setting from the Read
Referenced by from_byte(), from_float(), and from_short().
|
inline |
Calls Iop::channel(), turn a name into a channel number assignment.
References DD::Image::Iop::channel().
|
inline |
Calls Iop::channel_name(), turn channel number into name
References DD::Image::Iop::channel_name().
|
inline |
|
inline |
Change the full-size format.
References DD::Image::Info2D::full_size_format().
|
inlinevirtual |
Set LUT. This is virtual to allow override in movReader which performs additional processing
|
inlinevirtual |
Get LUT. This is virtual to allow override in movReader which performs additional processing
Referenced by from_byte(), from_float(), and from_short().
|
inlinevirtual |
Overrides lut() with a specific colorspace name (if non-empty). If the colorspace name isn't found the Node will error and the user will have to choose an acceptable alternative.
Referenced by DD::Image::ReaderImpl::updateColorspaceDefaultValue().
|
inlinestatic |
Get a 32-bit value stored low byte first in a buffer
|
inlinestatic |
Get a 32-bit value stored high byte first in a buffer
|
inlinestatic |
Get a 16-bit value stored low byte first in a buffer
|
inlinestatic |
Get a 16-bit value stored high byte first in a buffer
|
static |
For convenience and speed when reading file formats defined by C data structures, you can use this to flip adjacent locations of the same type into machine alignment. This should only be done to lock() data if you are sure you will only do this once and that no other thread will attempt to do it at the same time.
|
static |
Same as previous flip but for an array of 32-bit objects.
|
inlinestatic |
Calls flip() if necessary to convert an array of 32 bit values stored low-byte first so that they can be read by your machine.
Referenced by DD::Image::Writer::tolsb().
|
inlinestatic |
Calls flip() if necessary to convert an array of 32 bit values stored high-byte first so that they can be read by your machine.
|
inlinestatic |
Calls flip() if necessary to convert an array of 16 bit values stored low-byte first so that they can be read by your machine.
|
inlinestatic |
Calls flip() if necessary to convert an array of 16 bit values stored high-byte first so that they can be read by your machine.
|
virtual |
If the reader supports audio decoding, it can implement this
©2021 The Foundry Visionmongers, Ltd. All Rights Reserved. |