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

File options for manipulating image data on load or save. This class allows you to modify the incoming or outgoing image data by scaling, flipping, converting or cropping the data. It can be optionally passed to IMG_File::open() or IMG_File::create() More...

#include <IMG_FileParms.h>

Public Member Functions

 IMG_FileParms ()
 
void readAsIs ()
 
void setDataType (IMG_DataType dt)
 Convert to a different data type convert the image to this data type, if needed (default = use native) More...
 
void setColorModel (IMG_ColorModel cm)
 Convert to a different number of pixel components convert to a standard color model, if needed (RGB, RGBA, single). When moving from fewer components to more components, the data is either duplicated (1chan->RGB) or generated (RGB-RGBA, A=1). More...
 
void setComponentOrder (IMG_ComponentOrder order)
 Convert to either an RGBA or ABGR ordering converts the component ordering to RGBA or ABGR (or RGB/BGR, RG/GR) without forcing the color model to a specific number of components. More...
 
void setInterleaved (IMG_Interleave i)
 Interleaves or deinterleaves pixel data Determines how to format the data. More...
 
void setLuminanceFunc (PXL_LumFunction f)
 
void readAlphaAsPlane ()
 
void selectPlanes (const UT_IntArray &planeindices)
 
void selectPlanes (const char *pattern)
 
void selectPlaneNames (const char *name)
 
void scaleImageTo (int x, int y, UT_FilterType ft=UT_FILTER_BOX)
 Scale the image to resolution (x,y). (0 = use original dimension) More...
 
void scaleImageBy (fpreal x, fpreal y, UT_FilterType ft=UT_FILTER_BOX)
 scale the image by scaling factors (x,y). More...
 
void limitImageRes (int x, int y, UT_FilterType ft=UT_FILTER_BOX, bool preserve_aspect=true)
 
void powerTwoOnly ()
 images must be read as powers of two. Does not preserve aspect ratio. More...
 
void setDataWindowOnly ()
 
void setWindow (const UT_DimRect &area)
 
void setWindow (float u1, float v1, float u2, float v2)
 read the image region in 'area' in UV coords. Used only for reading. More...
 
void orientImage (IMG_XOrientation x, IMG_YOrientation y)
 
void flopImage ()
 rotate the image 90', flopping it on its side. More...
 
void applyLUT (const char *lut, const char *plane_scope="*")
 Color correct an image using a LUT apply a lookup table to the data, but only those planes that match the scope (ie, "C spec diff", "C*", "*beauty*") More...
 
void applyGamma (fpreal gamma, const char *gamma_scope="*")
 Color correct an image using a gamma setting Apply gamma to the planes matching the scope (ie, "C spec diff", "C*", "*beauty*") More...
 
void adjustGammaForFormat (const IMG_Stat &stat, const IMG_Format *format, IMG_DataType override_type=IMG_DT_ANY)
 
void detectAlphaDetails ()
 Returns information about the image's alpha channel Checks to see if the alpha plane is constant 1, cutout 0/1, constant valued, varying, out-of-range (>1 or <0) or absent. Load only. More...
 
void setOption (const char *option, const char *value)
 set an input/output tag option for the format. More...
 
void setOptions (const char **options)
 
void setOptionsString (const char *option_pair_string)
 options are in a whitespace separated string "Artist 'Tom Jones'" More...
 
void setOptions (const IMG_TileOptions &info_with_options)
 options are specified in the IMG_TileOptions structure More...
 
void setOptions (const UT_Options &options)
 
void useTileInterface ()
 Enable the tile inteface for reading or writing If called, we're reading or writing tiles using IMG_File::readTile and IMG_File::writeTile. The scanline versions will not work. More...
 
void continueOnError ()
 
void flipImageVertical ()
 Flip the image in either direction. flip the images in either direction. May cancel out any orientation flipping. More...
 
void flipImageHorizontal ()
 Flip the image in either direction. flip the images in either direction. May cancel out any orientation flipping. More...
 

Friends

class IMG_File
 

Detailed Description

File options for manipulating image data on load or save. This class allows you to modify the incoming or outgoing image data by scaling, flipping, converting or cropping the data. It can be optionally passed to IMG_File::open() or IMG_File::create()

Definition at line 34 of file IMG_FileParms.h.

Constructor & Destructor Documentation

IMG_FileParms::IMG_FileParms ( )

Member Function Documentation

void IMG_FileParms::adjustGammaForFormat ( const IMG_Stat stat,
const IMG_Format format,
IMG_DataType  override_type = IMG_DT_ANY 
)

Set the gamma and scope to apply any needed gamma correction to planes being written. This overwrites any applyGamma() changes.

void IMG_FileParms::applyGamma ( fpreal  gamma,
const char *  gamma_scope = "*" 
)

Color correct an image using a gamma setting Apply gamma to the planes matching the scope (ie, "C spec diff", "C*", "*beauty*")

void IMG_FileParms::applyLUT ( const char *  lut,
const char *  plane_scope = "*" 
)

Color correct an image using a LUT apply a lookup table to the data, but only those planes that match the scope (ie, "C spec diff", "C*", "*beauty*")

void IMG_FileParms::continueOnError ( )

If set, files will not report errors and subsequent scanlines will be returned as black.

void IMG_FileParms::detectAlphaDetails ( )

Returns information about the image's alpha channel Checks to see if the alpha plane is constant 1, cutout 0/1, constant valued, varying, out-of-range (>1 or <0) or absent. Load only.

void IMG_FileParms::flipImageHorizontal ( )

Flip the image in either direction. flip the images in either direction. May cancel out any orientation flipping.

void IMG_FileParms::flipImageVertical ( )

Flip the image in either direction. flip the images in either direction. May cancel out any orientation flipping.

void IMG_FileParms::flopImage ( )

rotate the image 90', flopping it on its side.

void IMG_FileParms::limitImageRes ( int  x,
int  y,
UT_FilterType  ft = UT_FILTER_BOX,
bool  preserve_aspect = true 
)

limit the image to a maximum resolution. Scale to this res, preserving the aspect ratio if requested.

void IMG_FileParms::orientImage ( IMG_XOrientation  x,
IMG_YOrientation  y 
)

options for orienting and flipping the image. Default orientation is LEFT_FIRST, BOTTOM_FIRST. You can set each to 'none' if you don't care.

void IMG_FileParms::powerTwoOnly ( )

images must be read as powers of two. Does not preserve aspect ratio.

void IMG_FileParms::readAlphaAsPlane ( )

If true, alpha will be read into its own plane, instead of an RGBA color plane. Color will be read as its own plane as well, RGB.

void IMG_FileParms::readAsIs ( )

This method turns off any option that would result in image translation.

void IMG_FileParms::scaleImageBy ( fpreal  x,
fpreal  y,
UT_FilterType  ft = UT_FILTER_BOX 
)

scale the image by scaling factors (x,y).

void IMG_FileParms::scaleImageTo ( int  x,
int  y,
UT_FilterType  ft = UT_FILTER_BOX 
)

Scale the image to resolution (x,y). (0 = use original dimension)

RESOLUTION -----------------------------------------------------—— using these methods always scales. To crop, use the data window methods Note that the filter is shared, so if more than one of these is called, the last filter setting is used.

void IMG_FileParms::selectPlaneNames ( const char *  name)

If demoting from a deep raster to an RGB(A) image, these methods allow you to specify the plane(s) to copy to RGB(A), by name or index. Selects serveral planes by name pattern, such as "C", "C A Pz" "P? C*"

void IMG_FileParms::selectPlanes ( const UT_IntArray planeindices)

If demoting from a deep raster to an RGB(A) image, these methods allow you to specify the plane(s) to copy to RGB(A), by name or index. Selects a plane by index. Indices are specified from 1 to # planes.

void IMG_FileParms::selectPlanes ( const char *  pattern)

If demoting from a deep raster to an RGB(A) image, these methods allow you to specify the plane(s) to copy to RGB(A), by name or index. Selects several planes by numeric pattern, ie. "1", "1 3 4", "[1-3] 5"

void IMG_FileParms::setColorModel ( IMG_ColorModel  cm)

Convert to a different number of pixel components convert to a standard color model, if needed (RGB, RGBA, single). When moving from fewer components to more components, the data is either duplicated (1chan->RGB) or generated (RGB-RGBA, A=1).

void IMG_FileParms::setComponentOrder ( IMG_ComponentOrder  order)

Convert to either an RGBA or ABGR ordering converts the component ordering to RGBA or ABGR (or RGB/BGR, RG/GR) without forcing the color model to a specific number of components.

void IMG_FileParms::setDataType ( IMG_DataType  dt)

Convert to a different data type convert the image to this data type, if needed (default = use native)

void IMG_FileParms::setDataWindowOnly ( )

Normally, a data window is expanded or cropped to the image resolution. calling this will always read only the data window. Used only for reading.

void IMG_FileParms::setInterleaved ( IMG_Interleave  i)

Interleaves or deinterleaves pixel data Determines how to format the data.

  • IMG_INTERLEAVE_AS_IS - leave it interleaved or non, as in the file.
  • IMG_INTERLEAVED - always interleave (rgbrgbrgb). Default.
  • IMG_NON_INTERLEAVED - always non-interleaved (rrrgggbbb)
void IMG_FileParms::setLuminanceFunc ( PXL_LumFunction  f)

If the color model is set to IMG_1CHAN, and the actual color model is RGB or higher, this method determines how to convert the vector into a scalar. By default, the luminance is taken.

void IMG_FileParms::setOption ( const char *  option,
const char *  value 
)

set an input/output tag option for the format.

void IMG_FileParms::setOptions ( const char **  options)

options are a list of argument pairs, such as "artist", "Tom Smith". The options list is terminated by a NULL.

void IMG_FileParms::setOptions ( const IMG_TileOptions info_with_options)

options are specified in the IMG_TileOptions structure

void IMG_FileParms::setOptions ( const UT_Options options)

set options based on a UT_Options (this is similar to using IMG_TileOptions)

void IMG_FileParms::setOptionsString ( const char *  option_pair_string)

options are in a whitespace separated string "Artist 'Tom Jones'"

void IMG_FileParms::setWindow ( const UT_DimRect area)

read the image region in 'area' only (even if we need to crop or expand the image to fill it). Used only for reading.

void IMG_FileParms::setWindow ( float  u1,
float  v1,
float  u2,
float  v2 
)

read the image region in 'area' in UV coords. Used only for reading.

void IMG_FileParms::useTileInterface ( )

Enable the tile inteface for reading or writing If called, we're reading or writing tiles using IMG_File::readTile and IMG_File::writeTile. The scanline versions will not work.

Friends And Related Function Documentation

friend class IMG_File
friend

Definition at line 240 of file IMG_FileParms.h.


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