HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMG_FormatPassThru Class Reference

#include <IMG_FormatPassThru.h>

+ Inheritance diagram for IMG_FormatPassThru:

Public Member Functions

 IMG_FormatPassThru (const IMG_File *parent_file)
 
 ~IMG_FormatPassThru () override
 
const char * getFormatName () const override
 
const char * getFormatLabel () const override
 
const char * getFormatDescription () const override
 
const char * getDefaultExtension () const override
 
const char * getFormatLocation () const override
 Describes how the format was loaded (i.e. DSO or internal formats) More...
 
int checkExtension (const char *filename) const override
 
int checkMagic (unsigned int magic) const override
 
int checkMagicSeekable (UT_IStream &is) const override
 
bool isPassThrough () const override
 
int checkDevice (const char *filename) const override
 
IMG_DataType getSupportedTypes () const override
 Returns a bitfield of data types supported by this format. More...
 
IMG_ColorModel getSupportedColorModels () const override
 
void getMaxResolution (unsigned &x, unsigned &y) const override
 
int isReadRandomAccess () const override
 
int isWriteRandomAccess () const override
 
int isTopFirst () const override
 
int isLeftFirst () const override
 
bool isDataWindowSupported () const override
 does this format support a data window or sub-area. More...
 
bool isDataWindowStreakSupported () const override
 
bool isDeepRasterSupported () const override
 
bool isDataInterleaved () const override
 
bool canPlaneTypesDiffer () const override
 
const IMG_FileOptionListgetOptions () const override
 
PXL_ColorSpace formatColorSpace () const override
 
fpreal formatColorSpaceGamma () const override
 
bool formatStoresColorSpace () const override
 Return true if the image format can store the colorspace. More...
 
- Public Member Functions inherited from IMG_Format
 IMG_Format ()
 
 IMG_Format (bool addtolist)
 
virtual ~IMG_Format ()
 
IMG_FileallocValidFile () const
 
virtual IMG_ImageType getSupportedImageTypes () const
 
fpreal adjustGammaForFormat (PXL_ColorSpace src_color_space, fpreal src_color_space_gamma, bool src_data_is_8bit, bool *dest_data_is_8bit=NULL) const
 
virtual bool isReadable () const
 
virtual bool isWritable () const
 
virtual bool isDataWindowCropOnly () const
 
virtual IMG_DeepRasterColor getDeepRasterRGBASupport () const
 
virtual const IMG_FormatresolvePriority (const IMG_Format *format) const
 

Protected Member Functions

IMG_FilecreateFile () const override
 
int isFormatOk (const IMG_Stat &) const override
 
const IMG_FormatgetParent () const
 
- Protected Member Functions inherited from IMG_Format
void removeFormatFromList ()
 
const IMG_FileTagListgetGlobalTags ()
 

Protected Attributes

const IMG_FilemyParent
 

Additional Inherited Members

- Public Types inherited from IMG_Format
enum  AccessType { READ_ACCESS, WRITE_ACCESS }
 
- Static Public Member Functions inherited from IMG_Format
static const IMG_FormatfindFormatByName (const char *format_name)
 
static const IMG_FormatfindFormatByLabel (const char *format_label)
 
static const IMG_FormatfindFormatSeekable (UT_IStream &is)
 
static const IMG_FormatfindFormatNonSeekable (UT_IStream &is)
 
static const IMG_FormatfindFormatByExtension (const char *filename)
 
static const IMG_FormatgetStdoutFormat ()
 
static int getNFormats ()
 
static const IMG_FormatgetFormat (int idx)
 Access to the list of currently installed image formats. More...
 
static const IMG_FormatfindFormatReadable (const char *filename, const IMG_Stat *stat=0)
 
static const IMG_FormatfindFormatWritable (const char *filename, const IMG_Stat *stat=0)
 
static void findFormatReadable (UT_Array< const IMG_Format * > &formats, const char *filename, const IMG_Stat *stat=nullptr)
 
static void findFormatWritable (UT_Array< const IMG_Format * > &formats, const char *filename, const IMG_Stat *stat=nullptr)
 
static void setGlobalOption (const char *name, const char *value)
 Set an option globally for all formats. Use with extreme care. More...
 
static void getGlobalOption (const char *name, UT_String &value)
 Read the value of a global option. May return a NULL string. More...
 
static bool setFormatOptionDefault (const char *format_name, const char *format_option, const char *defvalue)
 
static bool getFormatOptionDefault (const char *format_name, const char *format_option, UT_String &defvalue)
 
static int matchExtension (const char *filename, const char *ext)
 Matches a filename against a single extension. More...
 
static int matchExtensions (const char *filename, const char *ext[])
 
- Static Protected Member Functions inherited from IMG_Format
static const IMG_FormatfindFormat (const char *filename, const IMG_Stat *stat, AccessType access)
 
static void findFormat (UT_Array< const IMG_Format * > &list, const char *filename, const IMG_Stat *stat, AccessType access)
 

Detailed Description

Definition at line 21 of file IMG_FormatPassThru.h.

Constructor & Destructor Documentation

IMG_FormatPassThru::IMG_FormatPassThru ( const IMG_File parent_file)
inline

Definition at line 27 of file IMG_FormatPassThru.h.

IMG_FormatPassThru::~IMG_FormatPassThru ( )
inlineoverride

Definition at line 32 of file IMG_FormatPassThru.h.

Member Function Documentation

bool IMG_FormatPassThru::canPlaneTypesDiffer ( ) const
inlineoverridevirtual

if true, planes can have different data formats & components. Otherwise, all planes must have the same data type and number of components.

Reimplemented from IMG_Format.

Definition at line 86 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::checkDevice ( const char *  ) const
inlineoverridevirtual

The device method gives a higher priority to device checks. By default, this method returns 0 (no match). This is used to allow things like a60:3.pic (which uses the abekas device).

Reimplemented from IMG_Format.

Definition at line 54 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::checkExtension ( const char *  filename) const
inlineoverridevirtual

Methods to determine if this is one of our recognized files. The extension is the first try. If there are multiple matches, then we resort to the magic number (when reading)

Implements IMG_Format.

Definition at line 45 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::checkMagic ( unsigned int  int) const
inlineoverridevirtual

If possible, this magic numver checker will be called. This is used if the file is "seekable" (i.e. that we can rewind after checking)

Reimplemented from IMG_Format.

Definition at line 47 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::checkMagicSeekable ( UT_IStream is) const
inlineoverridevirtual

If possible, this second magic number checker will be called. This is used if the file is "seekable" (i.e. that we can rewind after checking)

Reimplemented from IMG_Format.

Definition at line 49 of file IMG_FormatPassThru.h.

IMG_File* IMG_FormatPassThru::createFile ( ) const
inlineoverrideprotectedvirtual

Implements IMG_Format.

Definition at line 101 of file IMG_FormatPassThru.h.

PXL_ColorSpace IMG_FormatPassThru::formatColorSpace ( ) const
inlineoverridevirtual

Some image formats have fixed color spaces, like JPEG (sRGB). The default is PXL_CS_UNKNOWN. For formats that can have colorspaces per plane, return PXL_CS_UNKNOWN and query the colorspace from IMG_Plane. formatColorSpaceGamma() is ignored unless the color space is PXL_CS_CUSTOM_GAMMA.

Reimplemented from IMG_Format.

Definition at line 92 of file IMG_FormatPassThru.h.

fpreal IMG_FormatPassThru::formatColorSpaceGamma ( ) const
inlineoverridevirtual

Specifies if this format can read an image file. One of isReadable() or isWritable() (or both) must return true.

Reimplemented from IMG_Format.

Definition at line 94 of file IMG_FormatPassThru.h.

bool IMG_FormatPassThru::formatStoresColorSpace ( ) const
inlineoverridevirtual

Return true if the image format can store the colorspace.

Reimplemented from IMG_Format.

Definition at line 96 of file IMG_FormatPassThru.h.

const char* IMG_FormatPassThru::getDefaultExtension ( ) const
inlineoverridevirtual

The default extension is used to determine whether the format should appear in the device/format menus. It should not contain the '.' (i.e. "tif" not ".tif")

Reimplemented from IMG_Format.

Definition at line 40 of file IMG_FormatPassThru.h.

const char* IMG_FormatPassThru::getFormatDescription ( ) const
inlineoverridevirtual

This can be optionally overridden to return a short description of the format. By default, no description is given.

Reimplemented from IMG_Format.

Definition at line 38 of file IMG_FormatPassThru.h.

const char* IMG_FormatPassThru::getFormatLabel ( ) const
inlineoverridevirtual

If getFormatLabel() is not overridden, the label will be the same as the name.

Reimplemented from IMG_Format.

Definition at line 36 of file IMG_FormatPassThru.h.

const char* IMG_FormatPassThru::getFormatLocation ( ) const
inlineoverridevirtual

Describes how the format was loaded (i.e. DSO or internal formats)

Reimplemented from IMG_Format.

Definition at line 42 of file IMG_FormatPassThru.h.

const char* IMG_FormatPassThru::getFormatName ( ) const
inlineoverridevirtual

All formats must have a unique name (like "JPEG").

Implements IMG_Format.

Definition at line 34 of file IMG_FormatPassThru.h.

void IMG_FormatPassThru::getMaxResolution ( unsigned &  x,
unsigned &  y 
) const
inlineoverridevirtual

Maximum allowable resolution for the file. If a user attempts to write an image larger than this, the image will be scaled to this resolution.

Implements IMG_Format.

Definition at line 61 of file IMG_FormatPassThru.h.

const IMG_FileOptionList* IMG_FormatPassThru::getOptions ( ) const
inlineoverridevirtual

Returns a list of options that can be set on the format when reading or writing (like 'compression' or 'comment').

Reimplemented from IMG_Format.

Definition at line 89 of file IMG_FormatPassThru.h.

const IMG_Format* IMG_FormatPassThru::getParent ( ) const
inlineprotected

Definition at line 106 of file IMG_FormatPassThru.h.

IMG_ColorModel IMG_FormatPassThru::getSupportedColorModels ( ) const
inlineoverridevirtual

Returns a bitfield of supported color models. If IMG_CM_REVERSED is set, this format stores data in BGR/ABGR format.

Implements IMG_Format.

Definition at line 59 of file IMG_FormatPassThru.h.

IMG_DataType IMG_FormatPassThru::getSupportedTypes ( ) const
inlineoverridevirtual

Returns a bitfield of data types supported by this format.

Implements IMG_Format.

Definition at line 57 of file IMG_FormatPassThru.h.

bool IMG_FormatPassThru::isDataInterleaved ( ) const
inlineoverridevirtual

Specifies whether this format stores its data interleaved (RGBRGBRGB) or non-interleaved (RRRGGGBBB). If your format supports both, pick one.

Reimplemented from IMG_Format.

Definition at line 83 of file IMG_FormatPassThru.h.

bool IMG_FormatPassThru::isDataWindowStreakSupported ( ) const
inlineoverridevirtual

does this format support saving whether the data outside the window is streaked from the window edges?

Reimplemented from IMG_Format.

Definition at line 77 of file IMG_FormatPassThru.h.

bool IMG_FormatPassThru::isDataWindowSupported ( ) const
inlineoverridevirtual

does this format support a data window or sub-area.

Reimplemented from IMG_Format.

Definition at line 75 of file IMG_FormatPassThru.h.

bool IMG_FormatPassThru::isDeepRasterSupported ( ) const
inlineoverridevirtual

does this format support deep rasters or multiple images? If not, only one plane of the color models that this format supports is allowed.

Reimplemented from IMG_Format.

Definition at line 80 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::isFormatOk ( const IMG_Stat ) const
inlineoverrideprotectedvirtual

Reimplemented from IMG_Format.

Definition at line 103 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::isLeftFirst ( ) const
inlineoverridevirtual

horizontal data orientation. Where (0,0) lies in the image (top-left by default).

Reimplemented from IMG_Format.

Definition at line 72 of file IMG_FormatPassThru.h.

bool IMG_FormatPassThru::isPassThrough ( ) const
inlineoverridevirtual

Flags whether the format is a pass through format like Flip or Scale. Specific image formats (like JPEG) are never pass-through.

Reimplemented from IMG_Format.

Definition at line 52 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::isReadRandomAccess ( ) const
inlineoverridevirtual

Some formats can be read and written in random order. Others require strict sequential order. If these methods return false, you should read and write scanlines in ascending order. When writing, they will be cached until they can be written sequentially.

Reimplemented from IMG_Format.

Definition at line 66 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::isTopFirst ( ) const
inlineoverridevirtual

vertical data orientation. Where (0,0) lies in the image (top-left by default).

Reimplemented from IMG_Format.

Definition at line 70 of file IMG_FormatPassThru.h.

int IMG_FormatPassThru::isWriteRandomAccess ( ) const
inlineoverridevirtual

If 0 is returned, the scanlines must be written in sequential order or they will be cached until all scanlines can be written sequentially.

Reimplemented from IMG_Format.

Definition at line 68 of file IMG_FormatPassThru.h.

Member Data Documentation

const IMG_File* IMG_FormatPassThru::myParent
protected

Definition at line 109 of file IMG_FormatPassThru.h.


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