1 2//---------------------------------------------------------------------------- 3// Anti-Grain Geometry - Version 2.3 4// Copyright (C) 2002-2005 Maxim Shemanarev (http://www.antigrain.com) 5// 6// Permission to copy, use, modify, sell and distribute this software 7// is granted provided this copyright notice appears in all copies. 8// This software is provided "as is" without express or implied 9// warranty, and with no claim as to its suitability for any purpose. 10// 11//---------------------------------------------------------------------------- 12// Contact: mcseem@antigrain.com 13// mcseemagg@yahoo.com 14// http://www.antigrain.com 15//---------------------------------------------------------------------------- 16// 17// Adaptation for high precision colors has been sponsored by 18// Liberty Technology Systems, Inc., visit http://lib-sys.com 19// 20// Liberty Technology Systems, Inc. is the provider of 21// PostScript and PDF technology for software developers. 22// 23//---------------------------------------------------------------------------- 24// 25// color types gray8, gray16 26// 27//---------------------------------------------------------------------------- 28#ifndef AGG_COLOR_GRAY_INCLUDED 29#define AGG_COLOR_GRAY_INCLUDED 30#include "agg_basics.h" 31namespace agg 32{ 33struct gray8 { 34 typedef int8u value_type; 35 typedef int32u calc_type; 36 typedef int32 long_type; 37 enum base_scale_e { 38 base_shift = 8, 39 base_size = 1 << base_shift, 40 base_mask = base_size - 1 41 }; 42 typedef gray8 self_type; 43 value_type v; 44 value_type a; 45 gray8() {} 46 gray8(unsigned v_, unsigned a_ = base_mask) : 47 v(int8u(v_)), a(int8u(a_)) {} 48}; 49} 50#endif 51