Cinder  0.8.6
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
ImageSourceFileQuartz.h
Go to the documentation of this file.
1 /*
2  Copyright (c) 2010, The Barbarian Group
3  All rights reserved.
4 
5  Redistribution and use in source and binary forms, with or without modification, are permitted provided that
6  the following conditions are met:
7 
8  * Redistributions of source code must retain the above copyright notice, this list of conditions and
9  the following disclaimer.
10  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
11  the following disclaimer in the documentation and/or other materials provided with the distribution.
12 
13  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
14  WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
15  PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
16  ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
17  TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
18  HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
19  NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
20  POSSIBILITY OF SUCH DAMAGE.
21 */
22 
23 #pragma once
24 
25 #include "cinder/Cinder.h"
26 #include "cinder/ImageIo.h"
27 #include "cinder/Exception.h"
29 
30 typedef struct CGImage *CGImageRef;
31 
32 namespace cinder {
33 
34 typedef std::shared_ptr<class ImageSourceFileQuartz> ImageSourceFileQuartzRef;
35 
37  public:
38  static ImageSourceRef createRef( DataSourceRef dataSourceRef, ImageSource::Options options ) { return createFileQuartzRef( dataSourceRef, options ); }
40 
45 
46  static void registerSelf();
47 
48  protected:
49  ImageSourceFileQuartz( CGImageRef imageRef, ImageSource::Options options, std::shared_ptr<const struct __CFDictionary> imageProperties, std::shared_ptr<const struct __CFDictionary> imageIndexProps );
50 
51  std::shared_ptr<const struct __CFDictionary> mImageProperties, mImageIndexProperties;
52 };
53 
55 
57 };
58 
59 } // namespace cinder
Definition: ImageSourceFileQuartz.h:36
ImageSourceFileQuartz(CGImageRef imageRef, ImageSource::Options options, std::shared_ptr< const struct __CFDictionary > imageProperties, std::shared_ptr< const struct __CFDictionary > imageIndexProps)
Definition: ImageSourceFileQuartz.cpp:127
CFDictionaryRef
Definition: QuickTime.cpp:61
std::shared_ptr< class ImageSourceFileQuartz > ImageSourceFileQuartzRef
Definition: ImageSourceFileQuartz.h:34
Definition: ImageSourceFileQuartz.h:56
CFDictionaryRef getQuartzIndexProperties() const
Returns a CFDictionaryRef of properties returned by Quartz ImageIO specific to the particular image i...
Definition: ImageSourceFileQuartz.cpp:137
static ImageSourceFileQuartzRef createFileQuartzRef(DataSourceRef dataSourceRef, ImageSource::Options options)
Definition: ImageSourceFileQuartz.cpp:81
Definition: ImageIo.h:201
CFDictionaryRef getQuartzProperties() const
Returns a CFDictionaryRef of properties returned by Quartz ImageIO. Result should not be freed...
Definition: ImageSourceFileQuartz.cpp:132
static ImageSourceRef createRef(DataSourceRef dataSourceRef, ImageSource::Options options)
Definition: ImageSourceFileQuartz.h:38
Definition: CinderCocoa.h:166
struct CGImage * CGImageRef
Definition: ImageSourceFileQuartz.h:30
Optional parameters passed when creating an Image.
Definition: ImageIo.h:92
#define REGISTER_IMAGE_IO_FILE_HANDLER(TYPE)
Definition: ImageIo.h:289
std::shared_ptr< const struct __CFDictionary > mImageProperties
Definition: ImageSourceFileQuartz.h:51
std::shared_ptr< const struct __CFDictionary > mImageIndexProperties
Definition: ImageSourceFileQuartz.h:51
std::shared_ptr< class ImageSource > ImageSourceRef
Definition: Channel.h:33
std::shared_ptr< class DataSource > DataSourceRef
Definition: DataSource.h:35
static void registerSelf()
Definition: ImageSourceFileQuartz.cpp:37