Exemple #1
0
        public void TestCreateAxisMapForInvalidDataTypeShouldThrowArgumentException()
        {
            var column = new ColumnBuilder().WithDataType(typeof(Object)).Build();

            var colorPalette = new ColorPaletteBuilder().Build();

            Assert.That(() => _factory.Create(column, colorPalette, SortOrder.Ascending),
                        Throws.ArgumentException);
        }
Exemple #2
0
        public void Initialize(double[] data, int width, int height, IColorTable colorTable, IColorMap colorMap)
        {
            // set members
            _width   = width;
            _height  = height;
            _rawData = data;

            // set default for this
            _invalidPixelValueColor = Color.White;

            // allocate image buffer
            _data = new int[width * height];

            // set color table now, we need it during raw buffer creation
            // TODO: throw if null, initialize?
            _colorTable = colorTable;

            // create color map
            if (colorMap != null)
            {
                _colorMap = colorMap;
            }
            else
            {
                _colorMap = ColorMapFactory.Create(ColorMapTypes.Gray);
                _colorMap.Initialize();
                _colorMap.Bias     = 0.5;
                _colorMap.Contrast = 1;
            }

            // create raw image buffer.
            // separating this will  add more granularity saving time if we want to rebuild
            // since we dont want to recalc extremes again...etc
            CreateRawImageBuffer();
        }