HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
HDK_Sample::IMG_SampleFormat Class Reference
+ Inheritance diagram for HDK_Sample::IMG_SampleFormat:

Public Member Functions

 IMG_SampleFormat ()
 
 ~IMG_SampleFormat () override
 
const char * getFormatName () const override
 
const char * getFormatLabel () const override
 
const char * getFormatDescription () const override
 
const char * getDefaultExtension () const override
 
IMG_File * createFile () const override
 
int checkExtension (const char *filename) const override
 
int checkMagic (unsigned int) 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
 
- Public Member Functions inherited from IMG_Format
 IMG_Format ()
 
 IMG_Format (bool addtolist)
 
virtual ~IMG_Format ()
 
IMG_File * allocValidFile () const
 
virtual bool isPassThrough () const
 
virtual const char * getFormatLocation () const
 Describes how the format was loaded (i.e. DSO or internal formats) More...
 
virtual int checkDevice (const char *) const
 
virtual IMG_ImageType getSupportedImageTypes () const
 
virtual int isTopFirst () const
 
virtual int isLeftFirst () const
 
virtual const IMG_FormatresolvePriority (const IMG_Format *format) const
 
virtual bool formatStoresColorSpace () const
 Return true if the image format can store the colorspace. More...
 
virtual const char * getMetadataKey () const
 
virtual int checkMagicSeekable (UT_IStream &is) const
 
virtual PXL_ColorSpace formatColorSpace () const
 
virtual fpreal formatColorSpaceGamma () 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
 
fpreal adjustGammaForFormat (PXL_ColorSpace *src_color_space, fpreal src_color_space_gamma, bool src_data_is_8bit, bool *dest_data_is_8bit) const
 
virtual bool isReadable () const
 
virtual bool isWritable () const
 
virtual bool isDataWindowSupported () const
 does this format support a data window or sub-area. More...
 
virtual bool isDataWindowCropOnly () const
 
virtual bool isDataWindowStreakSupported () const
 
virtual bool isDeepRasterSupported () const
 
virtual IMG_DeepRasterColor getDeepRasterRGBASupport () const
 
virtual bool isDataInterleaved () const
 
virtual bool canPlaneTypesDiffer () const
 
virtual const IMG_FileOptionListgetOptions () const
 
virtual const IMG_MetadataOptionsformatMetadata () const
 Returns list of well known metadata for the format. More...
 

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 const IMG_FormatmetadataPrefix (const char *key)
 
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 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, const UT_Array< const IMG_Format * > *image_formats=nullptr)
 
static void findFormatWritable (UT_Array< const IMG_Format * > &formats, const char *filename, const IMG_Stat *stat=nullptr, const UT_Array< const IMG_Format * > *image_formats=nullptr)
 
static UT_StringHolder artistDefault ()
 
static UT_StringHolder hostnameDefault ()
 
- Protected Member Functions inherited from IMG_Format
virtual int isFormatOk (const IMG_Stat &stat) const
 
void removeFormatFromList ()
 
const IMG_MetadatagetGlobalTags ()
 
- 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, const UT_Array< const IMG_Format * > *image_formats=nullptr)
 

Detailed Description

Custom image file format definition. This class defines the properties of the custom image format.

See Also
IMG_Sample
Examples:
IMG/IMG_Sample.C.

Definition at line 55 of file IMG_Sample.C.

Constructor & Destructor Documentation

HDK_Sample::IMG_SampleFormat::IMG_SampleFormat ( )
inline
Examples:
IMG/IMG_Sample.C.

Definition at line 57 of file IMG_Sample.C.

HDK_Sample::IMG_SampleFormat::~IMG_SampleFormat ( )
inlineoverride
Examples:
IMG/IMG_Sample.C.

Definition at line 58 of file IMG_Sample.C.

Member Function Documentation

int IMG_SampleFormat::checkExtension ( const char *  filename) const
overridevirtual

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.

Examples:
IMG/IMG_Sample.C.

Definition at line 125 of file IMG_Sample.C.

int IMG_SampleFormat::checkMagic ( unsigned  int) const
overridevirtual

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.

Examples:
IMG/IMG_Sample.C.

Definition at line 132 of file IMG_Sample.C.

IMG_File * IMG_SampleFormat::createFile ( ) const
overridevirtual

Implements IMG_Format.

Examples:
IMG/IMG_Sample.C.

Definition at line 119 of file IMG_Sample.C.

const char * IMG_SampleFormat::getDefaultExtension ( ) const
overridevirtual

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.

Examples:
IMG/IMG_Sample.C.

Definition at line 110 of file IMG_Sample.C.

const char * IMG_SampleFormat::getFormatDescription ( ) const
overridevirtual

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

Reimplemented from IMG_Format.

Examples:
IMG/IMG_Sample.C.

Definition at line 102 of file IMG_Sample.C.

const char * IMG_SampleFormat::getFormatLabel ( ) const
overridevirtual

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

Reimplemented from IMG_Format.

Examples:
IMG/IMG_Sample.C.

Definition at line 95 of file IMG_Sample.C.

const char * IMG_SampleFormat::getFormatName ( ) const
overridevirtual

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

Implements IMG_Format.

Examples:
IMG/IMG_Sample.C.

Definition at line 88 of file IMG_Sample.C.

void IMG_SampleFormat::getMaxResolution ( unsigned &  x,
unsigned &  y 
) const
overridevirtual

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.

Examples:
IMG/IMG_Sample.C.

Definition at line 139 of file IMG_Sample.C.

IMG_ColorModel HDK_Sample::IMG_SampleFormat::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.

Examples:
IMG/IMG_Sample.C.

Definition at line 73 of file IMG_Sample.C.

IMG_DataType HDK_Sample::IMG_SampleFormat::getSupportedTypes ( ) const
inlineoverridevirtual

Returns a bitfield of data types supported by this format.

Implements IMG_Format.

Examples:
IMG/IMG_Sample.C.

Definition at line 71 of file IMG_Sample.C.

int HDK_Sample::IMG_SampleFormat::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.

Examples:
IMG/IMG_Sample.C.

Definition at line 80 of file IMG_Sample.C.

int HDK_Sample::IMG_SampleFormat::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.

Examples:
IMG/IMG_Sample.C.

Definition at line 81 of file IMG_Sample.C.


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