KiCad PCB EDA Suite
Loading...
Searching...
No Matches
bitmap_store.cpp
Go to the documentation of this file.
1/*
2 * This program source code file is part of KiCad, a free EDA CAD application.
3 *
4 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
5 *
6 * This program is free software: you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation, either version 3 of the License, or (at your
9 * option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <https://www.gnu.org/licenses/>.
18 */
19
20#include <limits>
21#include <set>
22
23#include <wx/bitmap.h>
24#include <wx/filename.h>
25#include <wx/log.h>
26#include <wx/mstream.h>
27#include <wx/stdpaths.h>
28#include <wx/utils.h>
29
30#include <advanced_config.h>
31#include <asset_archive.h>
32#include <bitmaps.h>
33#include <bitmap_store.h>
34#include <bitmaps/bitmap_info.h>
35#include <hash.h>
36#include <kiplatform/ui.h>
37#include <paths.h>
38#include <pgm_base.h>
40
41
43static const unsigned char s_imageNotFound[] = {
44 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
45 0x00, 0x00, 0x00, 0x18, 0x00, 0x00, 0x00, 0x18, 0x08, 0x04, 0x00, 0x00, 0x00, 0x4a, 0x7e, 0xf5,
46 0x73, 0x00, 0x00, 0x01, 0xab, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x8d, 0xd4, 0x3f, 0x2c, 0x03,
47 0x51, 0x18, 0x00, 0xf0, 0x4b, 0x0c, 0x22, 0xb1, 0x19, 0x8c, 0x46, 0x09, 0x62, 0x60, 0x68, 0x62,
48 0x20, 0xb1, 0x98, 0x24, 0x24, 0x77, 0x08, 0xd2, 0x10, 0x03, 0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a, 0x7d, 0x0a, 0x96, 0x80, 0x7f, 0x72, 0x34, 0x83, 0xd6, 0x28, 0xf1, 0x4f, 0x28, 0x82,
72 0x24, 0x59, 0x75, 0xd1, 0x00, 0xe5, 0x9a, 0xb1, 0x2e, 0x1a, 0xce, 0xa0, 0x3d, 0x67, 0xe1, 0x13,
73 0xb5, 0xc5, 0x7e, 0xb7, 0x69, 0x08, 0x53, 0x5c, 0x00, 0x00, 0x00, 0x00, 0x49, 0x45, 0x4e, 0x44,
74 0xae, 0x42, 0x60, 0x82,
75};
76
77
80static const unsigned char s_dummyItem[] = {
81 0x89, 0x50, 0x4e, 0x47, 0x0d, 0x0a, 0x1a, 0x0a, 0x00, 0x00, 0x00, 0x0d, 0x49, 0x48, 0x44, 0x52,
82 0x00, 0x00, 0x00, 0x10, 0x00, 0x00, 0x00, 0x10, 0x08, 0x06, 0x00, 0x00, 0x00, 0x1f, 0xf3, 0xff,
83 0x61, 0x00, 0x00, 0x00, 0x5f, 0x49, 0x44, 0x41, 0x54, 0x38, 0xcb, 0x63, 0xf8, 0xff, 0xff, 0x3f,
84 0x03, 0x25, 0x98, 0x61, 0x68, 0x1a, 0x00, 0x04, 0x46, 0x40, 0xfc, 0x02, 0x88, 0x45, 0x41, 0x1c,
85 0x76, 0x20, 0xfe, 0x01, 0xc4, 0xbe, 0x24, 0x18, 0x60, 0x01, 0xc4, 0x20, 0x86, 0x04, 0x88, 0xc3,
86 0x01, 0xe5, 0x04, 0x0c, 0xb8, 0x01, 0x37, 0x81, 0xf8, 0x04, 0x91, 0xf8, 0x0a, 0x54, 0x8f, 0x06,
87 0xb2, 0x01, 0x9b, 0x81, 0x78, 0x02, 0x91, 0x78, 0x05, 0x54, 0x8f, 0xca, 0xe0, 0x08, 0x03, 0x36,
88 0xa8, 0xbf, 0xec, 0xc8, 0x32, 0x80, 0xcc, 0x84, 0x04, 0x0a, 0xbc, 0x1d, 0x40, 0x2c, 0xc8, 0x30,
89 0xf4, 0x33, 0x13, 0x00, 0x6b, 0x1a, 0x46, 0x7b, 0x68, 0xe7, 0x0f, 0x0b, 0x00, 0x00, 0x00, 0x00,
90 0x49, 0x45, 0x4e, 0x44, 0xae, 0x42, 0x60, 0x82,
91};
92
93
94static const wxString traceBitmaps = wxT( "KICAD_BITMAPS" );
95
96static const wxString IMAGE_ARCHIVE = wxT( "images.tar.gz" );
97
98
99size_t std::hash<std::pair<BITMAPS, int>>::operator()( const std::pair<BITMAPS, int>& aPair ) const
100{
101 std::size_t seed = 0xa82de1c0;
102 hash_combine( seed, static_cast<size_t>( aPair.first ), static_cast<size_t>( aPair.second ) );
103
104 return seed;
105}
106
107
109 m_theme( BITMAP_INFO::THEME::LIGHT )
110{
111 wxFileName path( PATHS::GetStockDataPath() + wxT( "/resources" ), IMAGE_ARCHIVE );
112
113 wxLogTrace( traceBitmaps, "Loading bitmaps from " + path.GetFullPath() );
114
115 m_archive = std::make_unique<ASSET_ARCHIVE>( path.GetFullPath() );
116
118
119 ThemeChanged();
120}
121
122
123wxBitmap BITMAP_STORE::GetBitmap( BITMAPS aBitmapId, int aHeight )
124{
125 return wxBitmap( getImage( aBitmapId, aHeight ) );
126}
127
128
129wxBitmapBundle BITMAP_STORE::GetBitmapBundle( BITMAPS aBitmapId, int aMinHeight )
130{
131 wxVector<wxBitmap> bmps;
132
133 for( const BITMAP_INFO& info : m_bitmapInfoCache[aBitmapId] )
134 {
135 if( info.theme != m_theme )
136 continue;
137
138 if( aMinHeight > 0 && info.height < aMinHeight )
139 continue;
140
141 bmps.push_back( wxBitmap( getImage( info.id, info.height ) ) );
142 }
143
144 return wxBitmapBundle::FromBitmaps( bmps );
145}
146
147
148// Better scaling algorithm, taken from wx 3.3
149static wxImage resampleImage( const wxImage& aImg, int aWidth, int aHeight )
150{
151 wxImage image;
152 int old_width = aImg.GetWidth();
153 int old_height = aImg.GetHeight();
154
155 // When downscaling, use bilinear algorithm for shrinking to an
156 // integer multiple of the target size and then box average by the
157 // integer part.
158 if( aWidth <= old_width && aHeight <= old_height )
159 {
160 const double shrinkFactorX = double( old_width ) / aWidth;
161 const double shrinkFactorY = double( old_height ) / aHeight;
162
163 const int shrinkInt( wxMin( shrinkFactorX, shrinkFactorY ) );
164
165 image = aImg.ResampleBilinear( aWidth * shrinkInt, aHeight * shrinkInt );
166 if( shrinkInt != 1 )
167 image = image.ResampleBox( aWidth, aHeight );
168 }
169 else // Use box average algorithm for upscaling.
170 {
171 image = aImg.ResampleBox( aWidth, aHeight );
172 }
173
174 return image;
175}
176
177
178wxBitmapBundle BITMAP_STORE::GetBitmapBundleDef( BITMAPS aBitmapId, int aDefHeight )
179{
180 wxVector<wxBitmap> bmps;
181 std::set<int> sizes;
182 int largestHeight = 0;
183 wxImage largestImage;
184
185 for( const BITMAP_INFO& info : m_bitmapInfoCache[aBitmapId] )
186 {
187 if( info.theme != m_theme )
188 continue;
189
190 wxImage img = getImage( info.id, info.height );
191
192 // A native-size icon (height < 0) has no fixed height. Treat it as the largest source so the
193 // resample-to-default below can build a bundle from it.
194 int effectiveHeight = info.height < 0 ? std::numeric_limits<int>::max() : info.height;
195
196 if( effectiveHeight > largestHeight )
197 {
198 largestHeight = effectiveHeight;
199 largestImage = img;
200 }
201
202 if( info.height >= aDefHeight )
203 {
204 sizes.emplace( info.height );
205 bmps.push_back( wxBitmap( img ) );
206 }
207 }
208
209 if( !sizes.contains( aDefHeight ) && largestImage.IsOk() )
210 bmps.push_back( wxBitmap( resampleImage( largestImage, aDefHeight, aDefHeight ) ) );
211
212 if( bmps.empty() )
213 {
214 wxFAIL_MSG( wxString::Format( "Missing bitmap for ID %d", static_cast<int>( aBitmapId ) ) );
215 wxMemoryInputStream is( s_imageNotFound, sizeof( s_imageNotFound ) );
216 largestImage = resampleImage( wxImage( is, wxBITMAP_TYPE_PNG ), aDefHeight, aDefHeight );
217 bmps.push_back( wxBitmap( largestImage ) );
218 }
219
220#ifdef __WXOSX__
221 // OSX doesn't align text in trees properly when 2x bitmaps are not provided, apparently
222 int size2x = aDefHeight * 2;
223
224 if( !sizes.contains( size2x ) && largestImage.IsOk() )
225 bmps.push_back( wxBitmap( resampleImage( largestImage, size2x, size2x ) ) );
226#endif
227
228 return wxBitmapBundle::FromBitmaps( bmps );
229}
230
231
232wxBitmapBundle BITMAP_STORE::MakeBitmapBundleDef( const wxVector<wxBitmap>& aBitmaps, int aDefHeight )
233{
234 wxVector<wxBitmap> bmps;
235 std::set<int> sizes;
236 int largestHeight = 0;
237 wxImage largestImage;
238
239 for( const wxBitmap& bmp : aBitmaps )
240 {
241 wxImage img = bmp.ConvertToImage();
242
243 if( !img.IsOk() )
244 continue;
245
246 if( img.GetHeight() > largestHeight )
247 {
248 largestHeight = img.GetHeight();
249 largestImage = img;
250 }
251
252 if( img.GetHeight() >= aDefHeight )
253 {
254 sizes.emplace( img.GetHeight() );
255 bmps.push_back( wxBitmap( img ) );
256 }
257 }
258
259 if( !sizes.contains( aDefHeight ) && largestImage.IsOk() )
260 bmps.push_back( wxBitmap( resampleImage( largestImage, aDefHeight, aDefHeight ) ) );
261
262 if( bmps.empty() )
263 return wxBitmapBundle();
264
265#ifdef __WXOSX__
266 // OSX doesn't align text in trees properly when 2x bitmaps are not provided, apparently
267 int size2x = aDefHeight * 2;
268
269 if( !sizes.contains( size2x ) && largestImage.IsOk() )
270 bmps.push_back( wxBitmap( resampleImage( largestImage, size2x, size2x ) ) );
271#endif
272
273 return wxBitmapBundle::FromBitmaps( bmps );
274}
275
276
277wxBitmapBundle BITMAP_STORE::GetDisabledBitmapBundle( BITMAPS aBitmapId, int aMinHeight )
278{
279 wxVector<wxBitmap> bmps;
280
281 for( const BITMAP_INFO& info : m_bitmapInfoCache[aBitmapId] )
282 {
283 if( info.theme != m_theme )
284 continue;
285
286 if( aMinHeight > 0 && info.height < aMinHeight )
287 continue;
288
289 wxBitmap bmp( getImage( info.id, info.height )
290 .ConvertToDisabled( KIPLATFORM::UI::IsDarkTheme() ? 70 : 255 ) );
291 bmps.push_back( bmp );
292 }
293
294 return wxBitmapBundle::FromBitmaps( bmps );
295}
296
297
298wxBitmapBundle BITMAP_STORE::GetDisabledBitmapBundleDef( BITMAPS aBitmapId, int aDefHeight )
299{
300 wxVector<wxBitmap> bmps;
301 std::set<int> sizes;
302 int largestHeight = 0;
303 wxImage largestImage;
304
305 for( const BITMAP_INFO& info : m_bitmapInfoCache[aBitmapId] )
306 {
307 if( info.theme != m_theme )
308 continue;
309
310 wxImage img = getImage( info.id, info.height ).ConvertToDisabled( KIPLATFORM::UI::IsDarkTheme() ? 70 : 255 );
311
312 int effectiveHeight = info.height < 0 ? std::numeric_limits<int>::max() : info.height;
313
314 if( effectiveHeight > largestHeight )
315 {
316 largestHeight = effectiveHeight;
317 largestImage = img;
318 }
319
320 if( info.height >= aDefHeight )
321 {
322 sizes.emplace( info.height );
323 bmps.push_back( wxBitmap( img ) );
324 }
325 }
326
327 if( !sizes.contains( aDefHeight ) && largestImage.IsOk() )
328 bmps.push_back( wxBitmap( resampleImage( largestImage, aDefHeight, aDefHeight ) ) );
329
330 if( bmps.empty() )
331 {
332 wxFAIL_MSG( wxString::Format( "Missing bitmap for ID %d", static_cast<int>( aBitmapId ) ) );
333 wxMemoryInputStream is( s_imageNotFound, sizeof( s_imageNotFound ) );
334 largestImage = resampleImage( wxImage( is, wxBITMAP_TYPE_PNG ), aDefHeight, aDefHeight );
335 bmps.push_back( wxBitmap( largestImage ) );
336 }
337
338#ifdef __WXOSX__
339 // OSX doesn't align text in trees properly when 2x bitmaps are not provided, apparently
340 int size2x = aDefHeight * 2;
341
342 if( !sizes.contains( size2x ) && largestImage.IsOk() )
343 bmps.push_back( wxBitmap( resampleImage( largestImage, size2x, size2x ) ) );
344#endif
345
346 return wxBitmapBundle::FromBitmaps( bmps );
347}
348
349
350wxBitmap BITMAP_STORE::GetBitmapScaled( BITMAPS aBitmapId, int aScaleFactor, int aHeight )
351{
352 wxImage image = getImage( aBitmapId, aHeight );
353
354 // Bilinear seems to genuinely look better for these line-drawing icons
355 // than bicubic, despite claims in the wx documentation that bicubic is
356 // "highest quality". I don't recommend changing this. Bicubic looks
357 // blurry and makes me want an eye exam.
358 image.Rescale( aScaleFactor * image.GetWidth() / 4, aScaleFactor * image.GetHeight() / 4,
359 wxIMAGE_QUALITY_BILINEAR );
360
361 return wxBitmap( image );
362}
363
364
365wxImage BITMAP_STORE::getImage( BITMAPS aBitmapId, int aHeight )
366{
367 const unsigned char* data = nullptr;
368 long count;
369
370 if( aBitmapId == BITMAPS::dummy_item )
371 {
372 data = s_dummyItem;
373 count = sizeof( s_dummyItem );
374 }
375 else
376 {
377 const wxString& name = bitmapName( aBitmapId, aHeight );
378 count = m_archive->GetFilePointer( name, &data );
379
380 if( count < 0 )
381 {
382 wxLogTrace( traceBitmaps,
383 "Bitmap for %d, %d, %d has an info tag with file %s,"
384 "but that file could not be found in the archive!",
385 static_cast<int>( aBitmapId ), aHeight, static_cast<int>( m_theme ), name );
386 data = s_imageNotFound;
387 count = sizeof( s_imageNotFound );
388 }
389 }
390
391 wxMemoryInputStream is( data, count );
392 wxImage image( is, wxBITMAP_TYPE_PNG );
393
394 return image;
395}
396
397
399{
400 BITMAP_INFO::THEME oldTheme = m_theme;
401
402 if( COMMON_SETTINGS* settings = Pgm().GetCommonSettings() )
403 {
404 switch( settings->m_Appearance.icon_theme )
405 {
409 }
410 }
411 else
412 {
414 }
415
416 if( oldTheme != m_theme )
417 m_bitmapNameCache.clear();
418}
419
420
421const wxString& BITMAP_STORE::bitmapName( BITMAPS aBitmapId, int aHeight )
422{
423 std::pair<BITMAPS, int> key = std::make_pair( aBitmapId, aHeight );
424
425 if( !m_bitmapNameCache.count( key ) )
426 m_bitmapNameCache[key] = computeBitmapName( aBitmapId, aHeight );
427
428 return m_bitmapNameCache.at( key );
429}
430
431
432wxString BITMAP_STORE::computeBitmapName( BITMAPS aBitmapId, int aHeight )
433{
434 if( !m_bitmapInfoCache.count( aBitmapId ) || m_bitmapInfoCache.at( aBitmapId ).empty() )
435 {
436 wxLogTrace( traceBitmaps, "No bitmap info available for %d", aBitmapId );
437 return wxEmptyString;
438 }
439
440 wxString fn;
441
442 for( const BITMAP_INFO& info : m_bitmapInfoCache.at( aBitmapId ) )
443 {
444 if( info.theme != m_theme )
445 continue;
446
447 if( aHeight < 0 || info.height == aHeight )
448 {
449 fn = info.filename;
450 break;
451 }
452 }
453
454 if( fn.IsEmpty() )
455 {
456 wxLogTrace( traceBitmaps, "No bitmap found matching ID %d, height %d, theme %s", static_cast<int>( aBitmapId ),
457 aHeight, m_theme );
458 return m_bitmapInfoCache.at( aBitmapId ).begin()->filename;
459 }
460
461 return fn;
462}
463
464
const char * name
void BuildBitmapInfo(std::unordered_map< BITMAPS, std::vector< BITMAP_INFO > > &aBitmapInfoCache)
static const unsigned char s_dummyItem[]
Icon used for EDA_ITEMs that don't have a custom icon configured.
static const wxString traceBitmaps
static const wxString IMAGE_ARCHIVE
static wxImage resampleImage(const wxImage &aImg, int aWidth, int aHeight)
static const unsigned char s_imageNotFound[]
A question-mark icon shown when we can't find a given bitmap in the archive.
BITMAPS
A list of all bitmap identifiers.
wxBitmapBundle GetBitmapBundleDef(BITMAPS aBitmapId, int aDefHeight)
Constructs and returns a bitmap bundle for the given icon ID, with the default bitmap size being aDef...
wxString computeBitmapName(BITMAPS aBitmapId, int aHeight=-1)
BITMAP_INFO::THEME m_theme
wxBitmapBundle GetBitmapBundle(BITMAPS aBitmapId, int aMinHeight=-1)
Constructs and returns a bitmap bundle containing all available sizes of the given ID.
wxBitmapBundle GetDisabledBitmapBundleDef(BITMAPS aBitmapId, int aDefHeight)
Constructs and returns a bitmap bundle for the given icon ID, with the bitmaps converted to disabled ...
void buildBitmapInfoCache()
std::unordered_map< BITMAPS, std::vector< BITMAP_INFO > > m_bitmapInfoCache
void ThemeChanged()
Notifies the store that the icon theme has been changed by the user, so caches must be invalidated.
wxBitmapBundle GetDisabledBitmapBundle(BITMAPS aBitmapId, int aMinHeight=-1)
Constructs and returns a bitmap bundle for the given icon ID, with the bitmaps converted to disabled ...
std::unique_ptr< ASSET_ARCHIVE > m_archive
std::unordered_map< std::pair< BITMAPS, int >, wxString > m_bitmapNameCache
static wxBitmapBundle MakeBitmapBundleDef(const wxVector< wxBitmap > &aBitmaps, int aDefHeight)
Constructs a bitmap bundle from the given bitmaps.
const wxString & bitmapName(BITMAPS aBitmapId, int aHeight=-1)
wxBitmap GetBitmap(BITMAPS aBitmapId, int aHeight=-1)
Retrieves a bitmap from the given bitmap id.
wxBitmap GetBitmapScaled(BITMAPS aBitmapId, int aScaleFactor, int aHeight=-1)
Retrieves a bitmap from the given bitmap id, scaled to a given factor.
wxImage getImage(BITMAPS aBitmapId, int aHeight=-1)
A base light class to derive to implement other light classes.
Definition light.h:37
static wxString GetStockDataPath(bool aRespectRunFromBuildDir=true)
Gets the stock (install) data path, which is the base path for things like scripting,...
Definition paths.cpp:233
static constexpr void hash_combine(std::size_t &seed)
This is a dummy function to take the final case of hash_combine below.
Definition hash.h:28
bool IsDarkTheme()
Determine if the desktop interface is currently using a dark theme or a light theme.
Definition wxgtk/ui.cpp:51
PGM_BASE & Pgm()
The global program "get" accessor.
see class PGM_BASE
std::string path