Cinder  0.9.1
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
cinder::cocoa::ImageSourceCgImage Class Reference

#include <CinderCocoa.h>

Inherits cinder::ImageSource.

Inherited by cinder::ImageSourceFileQuartz.

Public Types

typedef void(ImageSource::* RowFunc) (ImageTargetRef, int32_t, const void *)
 
enum  ColorModel { CM_RGB, CM_GRAY, CM_UNKNOWN }
 
typedef enum cinder::ImageIo::ColorModel ColorModel
 
enum  DataType {
  UINT8, UINT16, FLOAT32, FLOAT16,
  DATA_UNKNOWN
}
 
typedef enum cinder::ImageIo::DataType DataType
 
enum  ChannelType {
  CHAN_RGB_R, CHAN_RGB_G, CHAN_RGB_B, CHAN_GRAY,
  CHAN_ALPHA, CHAN_MASK, CHAN_LAB_L, CHAN_LAB_A,
  CHAN_LAB_B, CHAN_YUV_Y, CHAN_YUV_U, CHAN_YUV_V,
  CHAN_CMYK_C, CHAN_CMYK_M, CHAN_CMYK_Y, CHAN_CMYK_K,
  CHAN_UNKNOWN
}
 
typedef enum cinder::ImageIo::ChannelType ChannelType
 
enum  ChannelOrder {
  RGBA, BGRA, ARGB, ABGR,
  RGBX, BGRX, XRGB, XBGR,
  RGB, BGR, Y, YA,
  CUSTOM
}
 
typedef enum cinder::ImageIo::ChannelOrder ChannelOrder
 

Public Member Functions

virtual ~ImageSourceCgImage ()
 
virtual void load (ImageTargetRef target)
 
float getPixelAspectRatio () const
 
bool isPremultiplied () const
 
size_t getRowBytes () const
 
int32_t getCount () const
 
int32_t getWidth () const
 
int32_t getHeight () const
 
ColorModel getColorModel () const
 
DataType getDataType () const
 
ChannelOrder getChannelOrder () const
 
virtual bool hasAlpha () const
 

Static Public Member Functions

static ImageSourceCgImageRef createRef (::CGImageRef imageRef, ImageSource::Options options=ImageSource::Options())
 
static void translateRgbColorModelToOffsets (ChannelOrder channelOrder, int8_t *red, int8_t *green, int8_t *blue, int8_t *alpha, int8_t *inc)
 
static void translateGrayColorModelToOffsets (ChannelOrder channelOrder, int8_t *gray, int8_t *alpha, int8_t *inc)
 
static bool channelOrderHasAlpha (ChannelOrder channelOrder)
 
static int8_t channelOrderNumChannels (ChannelOrder channelOrder)
 
static uint8_t dataTypeBytes (DataType dataType)
 
static std::vector< std::string > getLoadExtensions ()
 
static std::vector< std::string > getWriteExtensions ()
 

Protected Member Functions

 ImageSourceCgImage (::CGImageRef imageRef, ImageSource::Options options)
 
void setPixelAspectRatio (float pixelAspectRatio)
 
void setPremultiplied (bool premult=true)
 
void setCustomPixelInc (int8_t customPixelInc)
 
void setFrameCount (int32_t frameCount)
 
RowFunc setupRowFunc (ImageTargetRef target)
 
void setupRowFuncRgbSource (ImageTargetRef target)
 
void setupRowFuncGraySource (ImageTargetRef target)
 
template<typename SD , typename TD , ColorModel TCS>
RowFunc setupRowFuncForTypesAndTargetColorModel (ImageTargetRef target)
 
template<typename SD , typename TD >
RowFunc setupRowFuncForTypes (ImageTargetRef target)
 
template<typename SD >
RowFunc setupRowFuncForSourceType (ImageTargetRef target)
 
template<typename SD , typename TD , ImageIo::ColorModel TCM, bool ALPHA>
void rowFuncSourceRgb (ImageTargetRef target, int32_t row, const void *data)
 
template<typename SD , typename TD , ColorModel TCM, bool ALPHA>
void rowFuncSourceGray (ImageTargetRef target, int32_t row, const void *data)
 
void setSize (int32_t width, int32_t height)
 
void setColorModel (ColorModel colorModel)
 
void setDataType (DataType aDataType)
 
void setChannelOrder (ChannelOrder aChannelOrder)
 

Protected Attributes

bool mIsIndexed
 
bool mIs16BitPacked
 
Color8u mColorTable [256]
 
std::shared_ptr< CGImage > mImageRef
 
uint16_t m16BitPackedRedOffset
 
uint16_t m16BitPackedGreenOffset
 
uint16_t m16BitPackedBlueOffset
 
float mPixelAspectRatio
 
bool mIsPremultiplied
 
int8_t mCustomPixelInc
 
int32_t mFrameCount
 
int8_t mRowFuncSourceRed
 
int8_t mRowFuncSourceGreen
 
int8_t mRowFuncSourceBlue
 
int8_t mRowFuncSourceAlpha
 
int8_t mRowFuncTargetRed
 
int8_t mRowFuncTargetGreen
 
int8_t mRowFuncTargetBlue
 
int8_t mRowFuncTargetAlpha
 
int8_t mRowFuncSourceGray
 
int8_t mRowFuncTargetGray
 
int8_t mRowFuncSourceInc
 
int8_t mRowFuncTargetInc
 
int32_t mWidth
 
int32_t mHeight
 
ColorModel mColorModel
 
DataType mDataType
 
ChannelOrder mChannelOrder
 

Member Typedef Documentation

typedef void(ImageSource::* cinder::ImageSource::RowFunc) (ImageTargetRef, int32_t, const void *)
inherited

Member Enumeration Documentation

Enumerator
CM_RGB 
CM_GRAY 
CM_UNKNOWN 
enum cinder::ImageIo::DataType
inherited
Enumerator
UINT8 
UINT16 
FLOAT32 
FLOAT16 
DATA_UNKNOWN 
Enumerator
CHAN_RGB_R 
CHAN_RGB_G 
CHAN_RGB_B 
CHAN_GRAY 
CHAN_ALPHA 
CHAN_MASK 
CHAN_LAB_L 
CHAN_LAB_A 
CHAN_LAB_B 
CHAN_YUV_Y 
CHAN_YUV_U 
CHAN_YUV_V 
CHAN_CMYK_C 
CHAN_CMYK_M 
CHAN_CMYK_Y 
CHAN_CMYK_K 
CHAN_UNKNOWN 
Enumerator
RGBA 
BGRA 
ARGB 
ABGR 
RGBX 
BGRX 
XRGB 
XBGR 
RGB 
BGR 
YA 
CUSTOM 

Constructor & Destructor Documentation

virtual cinder::cocoa::ImageSourceCgImage::~ImageSourceCgImage ( )
virtual
cinder::cocoa::ImageSourceCgImage::ImageSourceCgImage ( ::CGImageRef  imageRef,
ImageSource::Options  options 
)
protected

Retains (and later releases) imageRef.

Member Function Documentation

ImageSourceCgImageRef cinder::cocoa::ImageSourceCgImage::createRef ( ::CGImageRef  imageRef,
ImageSource::Options  options = ImageSource::Options() 
)
static

Retains (and later releases) imageRef.

void cinder::cocoa::ImageSourceCgImage::load ( ImageTargetRef  target)
virtual

Implements cinder::ImageSource.

float cinder::ImageSource::getPixelAspectRatio ( ) const
inherited

Returns the aspect ratio of individual pixels to accommodate non-square pixels.

bool cinder::ImageSource::isPremultiplied ( ) const
inherited

Returns whether the ImageSource's color data has been premultiplied by its alpha channel.

size_t cinder::ImageSource::getRowBytes ( ) const
inherited

Returns the number of bytes necessary to represent a row of the ImageSource.

int32_t cinder::ImageSource::getCount ( ) const
inherited

Returns the number of images. Generally 1 but may not be in the case of animated GIFs.

See also
Options::index()
void cinder::ImageSource::setPixelAspectRatio ( float  pixelAspectRatio)
protectedinherited
void cinder::ImageSource::setPremultiplied ( bool  premult = true)
protectedinherited
void cinder::ImageSource::setCustomPixelInc ( int8_t  customPixelInc)
protectedinherited

Allows declaration of a pixel increment different from what its ColorModel would imply. For example a non-planar Channel.

void cinder::ImageSource::setFrameCount ( int32_t  frameCount)
protectedinherited
ImageSource::RowFunc cinder::ImageSource::setupRowFunc ( ImageTargetRef  target)
protectedinherited
void cinder::ImageSource::setupRowFuncRgbSource ( ImageTargetRef  target)
protectedinherited
void cinder::ImageSource::setupRowFuncGraySource ( ImageTargetRef  target)
protectedinherited
template<typename SD , typename TD , ImageIo::ColorModel TCM>
ImageSource::RowFunc cinder::ImageSource::setupRowFuncForTypesAndTargetColorModel ( ImageTargetRef  target)
protectedinherited
template<typename SD , typename TD >
ImageSource::RowFunc cinder::ImageSource::setupRowFuncForTypes ( ImageTargetRef  target)
protectedinherited
template<typename SD >
ImageSource::RowFunc cinder::ImageSource::setupRowFuncForSourceType ( ImageTargetRef  target)
protectedinherited
template<typename SD , typename TD , ImageIo::ColorModel TCM, bool ALPHA>
void cinder::ImageSource::rowFuncSourceRgb ( ImageTargetRef  target,
int32_t  row,
const void *  data 
)
protectedinherited
template<typename SD , typename TD , ImageIo::ColorModel TCM, bool ALPHA>
void cinder::ImageSource::rowFuncSourceGray ( ImageTargetRef  target,
int32_t  row,
const void *  data 
)
protectedinherited
int32_t cinder::ImageIo::getWidth ( ) const
inherited
int32_t cinder::ImageIo::getHeight ( ) const
inherited
ColorModel cinder::ImageIo::getColorModel ( ) const
inherited
DataType cinder::ImageIo::getDataType ( ) const
inherited
ChannelOrder cinder::ImageIo::getChannelOrder ( ) const
inherited
virtual bool cinder::ImageIo::hasAlpha ( ) const
virtualinherited
void cinder::ImageIo::translateRgbColorModelToOffsets ( ChannelOrder  channelOrder,
int8_t *  red,
int8_t *  green,
int8_t *  blue,
int8_t *  alpha,
int8_t *  inc 
)
staticinherited
void cinder::ImageIo::translateGrayColorModelToOffsets ( ChannelOrder  channelOrder,
int8_t *  gray,
int8_t *  alpha,
int8_t *  inc 
)
staticinherited
bool cinder::ImageIo::channelOrderHasAlpha ( ChannelOrder  channelOrder)
staticinherited
int8_t cinder::ImageIo::channelOrderNumChannels ( ChannelOrder  channelOrder)
staticinherited
uint8_t cinder::ImageIo::dataTypeBytes ( DataType  dataType)
staticinherited
vector< string > cinder::ImageIo::getLoadExtensions ( )
staticinherited

Returns a vector of the extensions ImageIo supports for loading. Suitable for the extensions parameters of getOpenFilePath()

vector< string > cinder::ImageIo::getWriteExtensions ( )
staticinherited

Returns a vector of the extensions ImageIo supports for writing. Suitable for the extensions parameters of getSaveFilePath()

void cinder::ImageIo::setSize ( int32_t  width,
int32_t  height 
)
protectedinherited
void cinder::ImageIo::setColorModel ( ColorModel  colorModel)
protectedinherited
void cinder::ImageIo::setDataType ( DataType  aDataType)
protectedinherited
void cinder::ImageIo::setChannelOrder ( ChannelOrder  aChannelOrder)
protectedinherited

Member Data Documentation

bool cinder::cocoa::ImageSourceCgImage::mIsIndexed
protected
bool cinder::cocoa::ImageSourceCgImage::mIs16BitPacked
protected
Color8u cinder::cocoa::ImageSourceCgImage::mColorTable[256]
protected
std::shared_ptr<CGImage> cinder::cocoa::ImageSourceCgImage::mImageRef
protected
uint16_t cinder::cocoa::ImageSourceCgImage::m16BitPackedRedOffset
protected
uint16_t cinder::cocoa::ImageSourceCgImage::m16BitPackedGreenOffset
protected
uint16_t cinder::cocoa::ImageSourceCgImage::m16BitPackedBlueOffset
protected
float cinder::ImageSource::mPixelAspectRatio
protectedinherited
bool cinder::ImageSource::mIsPremultiplied
protectedinherited
int8_t cinder::ImageSource::mCustomPixelInc
protectedinherited
int32_t cinder::ImageSource::mFrameCount
protectedinherited
int8_t cinder::ImageSource::mRowFuncSourceRed
protectedinherited
int8_t cinder::ImageSource::mRowFuncSourceGreen
protectedinherited
int8_t cinder::ImageSource::mRowFuncSourceBlue
protectedinherited
int8_t cinder::ImageSource::mRowFuncSourceAlpha
protectedinherited
int8_t cinder::ImageSource::mRowFuncTargetRed
protectedinherited
int8_t cinder::ImageSource::mRowFuncTargetGreen
protectedinherited
int8_t cinder::ImageSource::mRowFuncTargetBlue
protectedinherited
int8_t cinder::ImageSource::mRowFuncTargetAlpha
protectedinherited
int8_t cinder::ImageSource::mRowFuncSourceGray
protectedinherited
int8_t cinder::ImageSource::mRowFuncTargetGray
protectedinherited
int8_t cinder::ImageSource::mRowFuncSourceInc
protectedinherited
int8_t cinder::ImageSource::mRowFuncTargetInc
protectedinherited
int32_t cinder::ImageIo::mWidth
protectedinherited
int32_t cinder::ImageIo::mHeight
protectedinherited
ColorModel cinder::ImageIo::mColorModel
protectedinherited
DataType cinder::ImageIo::mDataType
protectedinherited
ChannelOrder cinder::ImageIo::mChannelOrder
protectedinherited

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