1 /* babl - dynamically extendable universal pixel conversion library. 2 * Copyright (C) 2005-2008, Øyvind Kolås and others. 3 * 4 * This library is free software; you can redistribute it and/or 5 * modify it under the terms of the GNU Lesser General Public 6 * License as published by the Free Software Foundation; either 7 * version 3 of the License, or (at your option) any later version. 8 * 9 * This library is distributed in the hope that it will be useful, 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of 11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 12 * Lesser General Public License for more details. 13 * 14 * You should have received a copy of the GNU Lesser General 15 * Public License along with this library; if not, see 16 * <https://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef _BABL_CLASSES_H 20 #define _BABL_CLASSES_H 21 22 #include "babl-class.h" 23 #include "babl-db.h" 24 25 /* magic number used at the start of all babl objects, used to do 26 * differentiation in polymorphic functions. (as well as manual type 27 * check assertions). 28 */ 29 #define BABL_MAGIC 0xbab100 30 31 /* class types */ 32 enum { 33 BABL_INSTANCE = BABL_MAGIC, 34 BABL_TYPE, 35 BABL_TYPE_INTEGER, 36 BABL_TYPE_FLOAT, 37 BABL_SAMPLING, 38 BABL_TRC, 39 BABL_COMPONENT, 40 BABL_MODEL, 41 BABL_FORMAT, 42 BABL_SPACE, 43 44 BABL_CONVERSION, 45 BABL_CONVERSION_LINEAR, 46 BABL_CONVERSION_PLANE, 47 BABL_CONVERSION_PLANAR, 48 49 BABL_FISH, 50 BABL_FISH_REFERENCE, 51 BABL_FISH_SIMPLE, 52 BABL_FISH_PATH, 53 BABL_IMAGE, 54 55 BABL_EXTENSION, 56 57 BABL_SKY 58 }; 59 60 #include "babl-type.h" 61 #include "babl-sampling.h" 62 #include "babl-trc.h" 63 #include "babl-space.h" 64 #include "babl-component.h" 65 #include "babl-model.h" 66 #include "babl-format.h" 67 #include "babl-image.h" 68 #include "babl-conversion.h" 69 #include "babl-fish.h" 70 #include "babl-extension.h" 71 72 73 /* This union can be used for convenient access to any field without 74 * the need to cast if the variable already is of the type Babl* 75 */ 76 typedef union _Babl 77 { 78 BablClassType class_type; 79 BablInstance instance; 80 BablType type; 81 BablSampling sampling; 82 BablSpace space; 83 BablTRC trc; 84 BablComponent component; 85 BablModel model; 86 BablFormat format; 87 BablConversion conversion; 88 BablImage image; 89 BablFish fish; 90 BablFishReference fish_reference; 91 BablFishSimple fish_simple; 92 BablFishPath fish_path; 93 BablExtension extension; 94 } _Babl; 95 96 97 #endif 98