~jesterking/blender/win32libs

« back to all changes in this revision

Viewing changes to openimageio/include/OpenImageIO/imageio.h

  • Committer: dingto
  • Date: 2013-12-06 17:01:28 UTC
  • Revision ID: svn-v4:954f8c5b-7b00-dc11-b283-0030488c597c:trunk/lib/windows:61249
MSVC 2008 x86
* Update OSL to 1.4.0 and OIIO to 1.3.9.

Show diffs side-by-side

added added

removed removed

Lines of Context:
381
381
    /// the image.  (Note that this differs slightly from the member
382
382
    /// data channelformats, which is empty if there are not separate
383
383
    /// per-channel formats.)
384
 
    void get_channelformats (std::vector<TypeDesc> &formats) {
 
384
    void get_channelformats (std::vector<TypeDesc> &formats) const {
385
385
        formats = channelformats;
386
386
        if ((int)formats.size() < nchannels)
387
387
            formats.resize (nchannels, format);
774
774
        return e;
775
775
    }
776
776
 
 
777
    /// An ImageInput::Creator is a function that creates and returns an
 
778
    /// ImageInput.  Once invoked, the resulting ImageInput is owned by
 
779
    /// the caller, who is responsible for deleting it when done with it.
 
780
    typedef ImageInput* (*Creator)();
 
781
 
777
782
protected:
778
783
    /// Error reporting for the plugin implementation: call this with
779
784
    /// printf-like arguments.  Note however that this is fully typesafe!
1064
1069
        return e;
1065
1070
    }
1066
1071
 
 
1072
    /// An ImageOutput::Creator is a function that creates and returns an
 
1073
    /// ImageOutput.  Once invoked, the resulting ImageOutput is owned by
 
1074
    /// the caller, who is responsible for deleting it when done with it.
 
1075
    typedef ImageOutput* (*Creator)();
 
1076
 
1067
1077
protected:
1068
1078
    /// Error reporting for the plugin implementation: call this with
1069
1079
    /// printf-like arguments.  Note however that this is fully typesafe!
1180
1190
}
1181
1191
 
1182
1192
 
 
1193
/// Register the input and output 'create' routines and list of file
 
1194
/// extensions for a particular format.
 
1195
OIIO_API void declare_imageio_format (const std::string &format_name,
 
1196
                                      ImageInput::Creator input_creator,
 
1197
                                      const char **input_extensions,
 
1198
                                      ImageOutput::Creator output_creator,
 
1199
                                      const char **output_extensions);
 
1200
 
 
1201
 
1183
1202
/// Helper routine: quantize a value to an integer given the
1184
1203
/// quantization parameters.
1185
1204
OIIO_API int quantize (float value, int quant_black, int quant_white,
1218
1237
                              stride_t dst_zstride,
1219
1238
                              int alpha_channel = -1, int z_channel = -1);
1220
1239
 
 
1240
/// A version of convert_image that will break up big jobs into multiple
 
1241
/// threads.
 
1242
OIIO_API bool parallel_convert_image (
 
1243
               int nchannels, int width, int height, int depth,
 
1244
               const void *src, TypeDesc src_type,
 
1245
               stride_t src_xstride, stride_t src_ystride,
 
1246
               stride_t src_zstride,
 
1247
               void *dst, TypeDesc dst_type,
 
1248
               stride_t dst_xstride, stride_t dst_ystride,
 
1249
               stride_t dst_zstride,
 
1250
               int alpha_channel=-1, int z_channel=-1, int nthreads=0);
 
1251
 
1221
1252
 
1222
1253
/// Helper routine for data conversion: Copy an image of nchannels x
1223
1254
/// width x height x depth from src to dst.  The src and dst may have
1277
1308
/// be part of ordinary TIFF or exif tags.
1278
1309
OIIO_API std::string encode_xmp (const ImageSpec &spec, bool minimal=false);
1279
1310
 
 
1311
// All the wrap_foo functions implement a wrap mode, wherein coord is
 
1312
// altered to be origin <= coord < origin+width.  The return value
 
1313
// indicates if the resulting wrapped value is valid (example, for
 
1314
// wrap_black, values outside the region are invalid and do not modify
 
1315
// the coord parameter).
 
1316
OIIO_API bool wrap_black (int &coord, int origin, int width);
 
1317
OIIO_API bool wrap_clamp (int &coord, int origin, int width);
 
1318
OIIO_API bool wrap_periodic (int &coord, int origin, int width);
 
1319
OIIO_API bool wrap_periodic_pow2 (int &coord, int origin, int width);
 
1320
OIIO_API bool wrap_mirror (int &coord, int origin, int width);
 
1321
 
 
1322
// Typedef for the function signature of a wrap implementation.
 
1323
typedef bool (*wrap_impl) (int &coord, int origin, int width);
 
1324
 
 
1325
 
1280
1326
// to force correct linkage on some systems
1281
1327
OIIO_API void _ImageIO_force_link ();
1282
1328