Merge pull request #10 from gunyarakun/fix-invalid-return
[cocotron.git] / Onyx2D / O2Paint_ramp.h
blob9addfdefbef2bf8efb817235285d3c6690d9828b
1 /*------------------------------------------------------------------------
3 * Derivative of the OpenVG 1.0.1 Reference Implementation
4 * -------------------------------------
6 * Copyright (c) 2007 The Khronos Group Inc.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and /or associated documentation files
10 * (the "Materials "), to deal in the Materials without restriction,
11 * including without limitation the rights to use, copy, modify, merge,
12 * publish, distribute, sublicense, and/or sell copies of the Materials,
13 * and to permit persons to whom the Materials are furnished to do so,
14 * subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Materials.
19 * THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
20 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
21 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
22 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,
23 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
24 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE MATERIALS OR
25 * THE USE OR OTHER DEALINGS IN THE MATERIALS.
27 *-------------------------------------------------------------------*/
28 #import <Onyx2D/O2Paint.h>
30 @class O2Shading;
32 typedef struct {
33 O2Float offset;
34 O2argb32f color32f;
35 O2argb8u color8u;
36 } GradientStop;
38 @interface O2Paint_ramp : O2Paint {
39 O2Point _startPoint;
40 O2Point _endPoint;
41 BOOL _extendStart;
42 BOOL _extendEnd;
44 size_t _numberOfColorStops;
45 GradientStop *_colorStops;
48 O2argb32f O2PaintIntegrateColorRamp(O2Paint_ramp *self, O2Float gmin, O2Float gmax);
49 O2argb32f O2PaintColorRamp(O2Paint_ramp *self, O2Float gradient, O2Float rho, int *skip);
51 - initWithShading:(O2Shading *)shading deviceTransform:(O2AffineTransform)deviceTransform numberOfSamples:(int)numberOfSamples;
53 @end