From 4bc03d038a2d71b43358d67824005d65ff76ade1 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Sun, 2 Jul 2017 13:05:33 +0800 Subject: [PATCH] code refined --- include/nana/paint/pixel_buffer.hpp | 2 +- source/paint/pixel_buffer.cpp | 9 ++++----- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/include/nana/paint/pixel_buffer.hpp b/include/nana/paint/pixel_buffer.hpp index 6b6a4994..9ca86090 100644 --- a/include/nana/paint/pixel_buffer.hpp +++ b/include/nana/paint/pixel_buffer.hpp @@ -1,7 +1,7 @@ /* * Pixel Buffer Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2015 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at diff --git a/source/paint/pixel_buffer.cpp b/source/paint/pixel_buffer.cpp index 207905d1..4297c476 100644 --- a/source/paint/pixel_buffer.cpp +++ b/source/paint/pixel_buffer.cpp @@ -1,7 +1,7 @@ /* * Pixel Buffer Implementation * Nana C++ Library(http://www.nanapro.org) - * Copyright(C) 2003-2016 Jinhao(cnjinhao@hotmail.com) + * Copyright(C) 2003-2017 Jinhao(cnjinhao@hotmail.com) * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at @@ -515,13 +515,12 @@ namespace nana{ namespace paint else if(16 == image->depth) { //The format of Xorg 16bits depth is 565 - std::unique_ptr table_5bit_holder{new unsigned[32]}; - auto * const table_5bit = table_5bit_holder.get(); + std::unique_ptr table_holder{new unsigned[96]}; + auto * const table_5bit = table_holder.get(); for(std::size_t i = 0; i < 32; ++i) table_5bit[i] = (i * 255 / 31); - std::unique_ptr table_6bit_holder{new unsigned[64]}; - auto * const table_6bit = table_6bit_holder.get(); + auto * const table_6bit = table_holder.get() + 32; for(std::size_t i = 0; i < 64; ++i) table_6bit[i] = (i* 255 / 63);