KiCad PCB EDA Suite
Loading...
Searching...
No Matches
bitmap_base.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 (C) 2017 jean-pierre.charras
5 * Copyright The KiCad Developers, see AUTHORS.txt for contributors.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program. If not, see <https://www.gnu.org/licenses/>.
19 */
20
21#include "bitmap_base.h"
22
23#include <algorithm> // for std::swap
24#include <cstring> // for memcpy
25#include <gr_basic.h>
26#include <math/util.h> // for KiROUND
27#include <memory> // for make_unique, unique_ptr
28#include <plotters/plotter.h>
29#include <richio.h>
30#include <wx/bitmap.h> // for wxBitmap
31#include <wx/mstream.h>
32#include <wx/stream.h> // for wxInputStream, wxOutputStream
33#include <wx/string.h> // for wxString
34#include <wx/wfstream.h> // for wxFileInputStream
35
36
37
39{
40 m_scale = 1.0; // 1.0 = original bitmap size
41 m_imageType = wxBITMAP_TYPE_INVALID;
42 m_bitmap = nullptr;
43 m_bitmapDirty = false;
44 m_image = nullptr;
45 m_originalImage = nullptr;
46 m_ppi = 300; // the bitmap definition. the default is 300PPI
47 m_pixelSizeIu = 254000.0 / m_ppi; // a pixel size value OK for bitmaps using 300 PPI
48 // for Eeschema which uses currently 254000PPI
49 m_isMirroredX = false;
50 m_isMirroredY = false;
52}
53
54
56{
57 m_scale = aSchBitmap.m_scale;
58 m_ppi = aSchBitmap.m_ppi;
59 m_pixelSizeIu = aSchBitmap.m_pixelSizeIu;
60 m_isMirroredX = aSchBitmap.m_isMirroredX;
61 m_isMirroredY = aSchBitmap.m_isMirroredY;
62 m_rotation = aSchBitmap.m_rotation;
63 m_imageType = aSchBitmap.m_imageType;
64
65 m_image = nullptr;
66 m_bitmap = nullptr;
67 m_bitmapDirty = false;
68 m_originalImage = nullptr;
69
70 if( aSchBitmap.m_image )
71 {
72 m_image = new wxImage( *aSchBitmap.m_image );
73 m_bitmap = new wxBitmap( *m_image );
74 m_originalImage = new wxImage( *aSchBitmap.m_originalImage );
75 m_imageType = aSchBitmap.m_imageType;
76 m_imageData = aSchBitmap.m_imageData;
77 m_imageId = aSchBitmap.m_imageId;
78 }
79}
80
81
82void BITMAP_BASE::rebuildBitmap( bool aResetID )
83{
84 if( m_bitmap )
85 delete m_bitmap;
86
87 m_bitmap = new wxBitmap( *m_image );
88 m_bitmapDirty = false;
89
90 if( aResetID )
91 m_imageId = KIID();
92
93}
94
95
97{
98 if( m_bitmapDirty && m_image )
99 {
100 if( m_bitmap )
101 delete m_bitmap;
102
103 m_bitmap = new wxBitmap( *m_image );
104 m_bitmapDirty = false;
105 }
106}
107
108
110{
111 // Todo: eventually we need to support dpi / scaling in both dimensions
112 //
113 // PNG stores resolution as pixels-per-meter in the pHYs chunk. wxWidgets converts this
114 // to pixels-per-cm as a floating-point string (e.g., 3780 PPM -> "37.8" px/cm).
115 // GetOptionInt() would truncate "37.8" to 37 before the * 2.54 multiply, causing ~2%
116 // error for common resolutions. ToCDouble is locale-independent unlike wxAtof.
117 wxString resStr = m_originalImage->GetOption( wxIMAGE_OPTION_RESOLUTIONX );
118 double dpiX = 0.0;
119 resStr.ToCDouble( &dpiX );
120
121 if( dpiX > 1.0 )
122 {
123 if( m_originalImage->GetOptionInt( wxIMAGE_OPTION_RESOLUTIONUNIT ) == wxIMAGE_RESOLUTION_CM )
124 m_ppi = KiROUND( dpiX * 2.54 );
125 else
126 m_ppi = KiROUND( dpiX );
127 }
128}
129
130
132{
133 if( !m_originalImage )
134 return m_ppi;
135
136 // Mirror the pre-fix path, which read pixels/cm via GetOptionInt() and so truncated
137 // "37.8" to 37 before the * 2.54 multiply.
138 int dpiX = m_originalImage->GetOptionInt( wxIMAGE_OPTION_RESOLUTIONX );
139
140 if( dpiX > 1 )
141 {
142 if( m_originalImage->GetOptionInt( wxIMAGE_OPTION_RESOLUTIONUNIT ) == wxIMAGE_RESOLUTION_CM )
143 return KiROUND( dpiX * 2.54 );
144 else
145 return dpiX;
146 }
147
148 return m_ppi;
149}
150
151
153{
154 *m_image = *aItem.m_image;
156 m_imageId = aItem.m_imageId;
157 m_scale = aItem.m_scale;
158 m_ppi = aItem.m_ppi;
162 m_rotation = aItem.m_rotation;
163 m_imageType = aItem.m_imageType;
164 m_imageData = aItem.m_imageData;
165
166 rebuildBitmap( false );
167}
168
169
170bool BITMAP_BASE::ReadImageFile( wxInputStream& aInStream )
171{
172 // Store the original image data in m_imageData
173 size_t dataSize = aInStream.GetLength();
174 m_imageData.SetBufSize( dataSize );
175 aInStream.Read( m_imageData.GetData(), dataSize );
176 m_imageData.SetDataLen( dataSize );
177
178 std::unique_ptr<wxImage> new_image = std::make_unique<wxImage>();
179
180 // Load the image from the stream into new_image
181 wxMemoryInputStream mem_stream( m_imageData.GetData(), dataSize );
182 if( !new_image->LoadFile( mem_stream ) )
183 return false;
184
185 return SetImage( *new_image );
186}
187
188
189bool BITMAP_BASE::ReadImageFile( wxMemoryBuffer& aBuf )
190{
191 // Store the original image data in m_imageData
192 m_imageData = aBuf;
193
194 std::unique_ptr<wxImage> new_image = std::make_unique<wxImage>();
195
196 // Load the image from the buffer into new_image
197 wxMemoryInputStream mem_stream( m_imageData.GetData(), m_imageData.GetBufSize() );
198
199 if( !new_image->LoadFile( mem_stream ) )
200 return false;
201
202 return SetImage( *new_image );
203}
204
205
206bool BITMAP_BASE::ReadImageFile(const wxString& aFullFilename)
207{
208 wxFileInputStream file_stream(aFullFilename);
209
210 // Check if the file could be opened successfully
211 if (!file_stream.IsOk())
212 return false;
213
214 return ReadImageFile(file_stream);
215}
216
217
218bool BITMAP_BASE::SetImage( const wxImage& aImage )
219{
220 if( !aImage.IsOk() || aImage.GetWidth() == 0 || aImage.GetHeight() == 0 )
221 return false;
222
223 delete m_image;
224 m_image = new wxImage( aImage );
225
226 // Create a new wxImage object from m_image
227 delete m_originalImage;
228 m_originalImage = new wxImage( *m_image );
229
231 updatePPI();
232
233 return true;
234}
235
236
237bool BITMAP_BASE::SaveImageData( wxOutputStream& aOutStream ) const
238{
239 if( m_imageData.IsEmpty() )
240 {
241 // If m_imageData is empty, use wxImage::Save() method to write m_image contents to
242 // the stream.
243 wxBitmapType type = m_imageType == wxBITMAP_TYPE_JPEG ? wxBITMAP_TYPE_JPEG
244 : wxBITMAP_TYPE_PNG;
245
246 if( !m_image->SaveFile( aOutStream, type ) )
247 {
248 return false;
249 }
250 }
251 else
252 {
253 // Write the contents of m_imageData to the stream.
254 aOutStream.Write( m_imageData.GetData(), m_imageData.GetDataLen() );
255 }
256
257 return true;
258}
259
260
261bool BITMAP_BASE::LoadLegacyData( LINE_READER& aLine, wxString& aErrorMsg )
262{
263 wxMemoryOutputStream stream;
264 char* line;
265
266 while( true )
267 {
268 if( !aLine.ReadLine() )
269 {
270 aErrorMsg = wxT( "Unexpected end of data" );
271 return false;
272 }
273
274 line = aLine.Line();
275
276 if( strncasecmp( line, "EndData", 4 ) == 0 )
277 {
278 // all the PNG date is read.
279 // We expect here m_image and m_bitmap are void
280 m_image = new wxImage();
281 wxMemoryInputStream istream( stream );
282 m_image->LoadFile( istream, wxBITMAP_TYPE_ANY );
283 m_bitmap = new wxBitmap( *m_image );
284 m_originalImage = new wxImage( *m_image );
286 break;
287 }
288
289 // Read PNG data, stored in hexadecimal,
290 // each byte = 2 hexadecimal digits and a space between 2 bytes
291 // and put it in memory stream buffer
292 int len = strlen( line );
293
294 for( ; len > 0; len -= 3, line += 3 )
295 {
296 int value = 0;
297
298 if( sscanf( line, "%X", &value ) == 1 )
299 stream.PutC( (char) value );
300 else
301 break;
302 }
303 }
304
305 return true;
306}
307
308
310{
311 BOX2I bbox;
312 VECTOR2I size = GetSize();
313
314 bbox.Inflate( size.x / 2, size.y / 2 );
315
316 return bbox;
317}
318
319
320void BITMAP_BASE::DrawBitmap( wxDC* aDC, const VECTOR2I& aPos,
321 const KIGFX::COLOR4D& aBackgroundColor ) const
322{
324
325 if( m_bitmap == nullptr )
326 return;
327
328 VECTOR2I pos = aPos;
329 VECTOR2I size = GetSize();
330
331 // This fixes a bug in OSX that should be fixed in the 3.0.3 version or later.
332 if( ( size.x == 0 ) || ( size.y == 0 ) )
333 return;
334
335 // To draw the bitmap, pos is the upper left corner position
336 pos.x -= size.x / 2;
337 pos.y -= size.y / 2;
338
339 double scale;
340 int logicalOriginX, logicalOriginY;
341 aDC->GetUserScale( &scale, &scale );
342 aDC->GetLogicalOrigin( &logicalOriginX, &logicalOriginY );
343
344 // We already have issues to draw a bitmap on the wxDC, depending on wxWidgets version.
345 // Now we have an issue on wxWidgets 3.1.6 to fix the clip area
346 // and the bitmap position when using TransformMatrix
347 // So for version == 3.1.6 do not use it
348 // Be careful before changing the code.
349 bool useTransform = aDC->CanUseTransformMatrix();
350
351 wxAffineMatrix2D init_matrix = aDC->GetTransformMatrix();
352
353 // Note: clipping bitmap area was made to fix a minor issue in old versions of
354 // KiCad/wxWidgets (5.1 / wx 3.0)
355 // However SetClippingRegion creates a lot of issues (different ways to fix the
356 // position and size of the area, depending on wxWidgets version)because it changes with
357 // each versions of wxWidgets, so it is now disabled
358 // However the code is still here, just in case
359 // #define USE_CLIP_AREA
360
361 wxPoint clipAreaPos;
362
363 if( useTransform )
364 {
365 wxAffineMatrix2D matrix = aDC->GetTransformMatrix();
366 matrix.Translate( pos.x, pos.y );
367 matrix.Scale( GetScalingFactor(), GetScalingFactor() );
368 aDC->SetTransformMatrix( matrix );
369
370 // Needed on wx <= 3.1.5, and this is strange...
371 // Nevertheless, this code has problem (the bitmap is not seen)
372 // with wx version > 3.1.5
373 clipAreaPos.x = pos.x;
374 clipAreaPos.y = pos.y;
375
376 pos.x = pos.y = 0;
377 }
378 else
379 {
380 aDC->SetUserScale( scale * GetScalingFactor(), scale * GetScalingFactor() );
381 aDC->SetLogicalOrigin( logicalOriginX / GetScalingFactor(),
382 logicalOriginY / GetScalingFactor() );
383
384 pos.x = KiROUND( pos.x / GetScalingFactor() );
385 pos.y = KiROUND( pos.y / GetScalingFactor() );
386 size.x = KiROUND( size.x / GetScalingFactor() );
387 size.y = KiROUND( size.y / GetScalingFactor() );
388 clipAreaPos.x = pos.x;
389 clipAreaPos.y = pos.y;
390 }
391
392#ifdef USE_CLIP_AREA
393 aDC->DestroyClippingRegion();
394 aDC->SetClippingRegion( clipAreaPos, wxSize( size.x, size.y ) );
395#endif
396
397 if( aBackgroundColor != COLOR4D::UNSPECIFIED && m_bitmap->HasAlpha() )
398 {
399 // Most printers don't support transparent images properly,
400 // so blend the image with background color.
401
402 int w = m_bitmap->GetWidth();
403 int h = m_bitmap->GetHeight();
404
405 wxImage image( w, h );
406 wxColour bgColor = aBackgroundColor.ToColour();
407
408 image.SetRGB( wxRect( 0, 0, w, h ), bgColor.Red(), bgColor.Green(), bgColor.Blue() );
409 image.Paste( m_bitmap->ConvertToImage(), 0, 0, wxIMAGE_ALPHA_BLEND_COMPOSE );
410
412 image = image.ConvertToGreyscale();
413
414 aDC->DrawBitmap( wxBitmap( image ), pos.x, pos.y, true );
415 }
416 else if( GetGRForceBlackPenState() )
417 {
418 wxBitmap result( m_bitmap->ConvertToImage().ConvertToGreyscale() );
419 aDC->DrawBitmap( result, pos.x, pos.y, true );
420 }
421 else
422 {
423 aDC->DrawBitmap( *m_bitmap, pos.x, pos.y, true );
424 }
425
426 if( useTransform )
427 aDC->SetTransformMatrix( init_matrix );
428 else
429 {
430 aDC->SetUserScale( scale, scale );
431 aDC->SetLogicalOrigin( logicalOriginX, logicalOriginY );
432 }
433
434#ifdef USE_CLIP_AREA
435 aDC->DestroyClippingRegion();
436#endif
437}
438
439
441{
442 VECTOR2I size;
443
444 if( m_image )
445 {
446 size.x = KiROUND( m_image->GetWidth() * GetScalingFactor() );
447 size.y = KiROUND( m_image->GetHeight() * GetScalingFactor() );
448 }
449
450 return size;
451}
452
453
454void BITMAP_BASE::mirrorImageInPlace( wxImage& aImage, FLIP_DIRECTION aFlipDirection )
455{
456 const int w = aImage.GetWidth();
457 const int h = aImage.GetHeight();
458
459 if( w == 0 || h == 0 )
460 return;
461
462 unsigned char* rgb = aImage.GetData();
463 unsigned char* alpha = aImage.HasAlpha() ? aImage.GetAlpha() : nullptr;
464 const int bpp = 3;
465
466 if( aFlipDirection == FLIP_DIRECTION::LEFT_RIGHT )
467 {
468 // Swap columns left-to-right within each row
469 for( int y = 0; y < h; ++y )
470 {
471 unsigned char* rowRgb = rgb + y * w * bpp;
472
473 for( int lo = 0, hi = w - 1; lo < hi; ++lo, --hi )
474 {
475 std::swap( rowRgb[lo * bpp + 0], rowRgb[hi * bpp + 0] );
476 std::swap( rowRgb[lo * bpp + 1], rowRgb[hi * bpp + 1] );
477 std::swap( rowRgb[lo * bpp + 2], rowRgb[hi * bpp + 2] );
478 }
479
480 if( alpha )
481 {
482 unsigned char* rowAlpha = alpha + y * w;
483
484 for( int lo = 0, hi = w - 1; lo < hi; ++lo, --hi )
485 std::swap( rowAlpha[lo], rowAlpha[hi] );
486 }
487 }
488 }
489 else
490 {
491 // Swap entire rows top-to-bottom
492 const size_t rowBytes = w * bpp;
493 std::vector<unsigned char> tmpRgb( rowBytes );
494
495 for( int lo = 0, hi = h - 1; lo < hi; ++lo, --hi )
496 {
497 unsigned char* rowLo = rgb + lo * rowBytes;
498 unsigned char* rowHi = rgb + hi * rowBytes;
499 memcpy( tmpRgb.data(), rowLo, rowBytes );
500 memcpy( rowLo, rowHi, rowBytes );
501 memcpy( rowHi, tmpRgb.data(), rowBytes );
502 }
503
504 if( alpha )
505 {
506 std::vector<unsigned char> tmpAlpha( w );
507
508 for( int lo = 0, hi = h - 1; lo < hi; ++lo, --hi )
509 {
510 unsigned char* aLo = alpha + lo * w;
511 unsigned char* aHi = alpha + hi * w;
512 memcpy( tmpAlpha.data(), aLo, w );
513 memcpy( aLo, aHi, w );
514 memcpy( aHi, tmpAlpha.data(), w );
515 }
516 }
517 }
518}
519
520
522{
523 if( m_image )
524 {
525 mirrorImageInPlace( *m_image, aFlipDirection );
526
527 if( aFlipDirection == FLIP_DIRECTION::TOP_BOTTOM )
529 else
531
532 m_bitmapDirty = true;
533 m_imageData.Clear();
534 }
535}
536
537
538void BITMAP_BASE::Rotate( bool aRotateCCW )
539{
540 if( m_image )
541 {
542 // wxImage::Rotate90() clears resolution metadata, so preserve it.
543 // Use string form to avoid truncating fractional pixels/cm values.
544 wxString resX = m_image->GetOption( wxIMAGE_OPTION_RESOLUTIONX );
545 wxString resY = m_image->GetOption( wxIMAGE_OPTION_RESOLUTIONY );
546 int unit = m_image->GetOptionInt( wxIMAGE_OPTION_RESOLUTIONUNIT );
547
548 // wxImage::Rotate90 parameter is "clockwise", so invert for CCW rotation
549 *m_image = m_image->Rotate90( !aRotateCCW );
550
551 m_image->SetOption( wxIMAGE_OPTION_RESOLUTIONUNIT, unit );
552 m_image->SetOption( wxIMAGE_OPTION_RESOLUTIONX, resX );
553 m_image->SetOption( wxIMAGE_OPTION_RESOLUTIONY, resY );
554
555 m_rotation += ( aRotateCCW ? ANGLE_90 : -ANGLE_90 );
556 m_bitmapDirty = true;
557 m_imageData.Clear();
558 }
559}
560
561
563{
564 if( m_image )
565 {
566 *m_image = m_image->ConvertToGreyscale();
567 *m_originalImage = m_originalImage->ConvertToGreyscale();
568 m_bitmapDirty = true;
569 m_imageData.Clear();
570 m_imageId = KIID();
571 }
572}
573
574
575void BITMAP_BASE::PlotImage( PLOTTER* aPlotter, const VECTOR2I& aPos,
576 const COLOR4D& aDefaultColor,
577 int aDefaultPensize ) const
578{
579 if( m_image == nullptr )
580 return;
581
582 // These 2 lines are useful only for plotters that cannot plot a bitmap
583 // and plot a rectangle instead of.
584 aPlotter->SetColor( aDefaultColor );
585 aPlotter->SetCurrentLineWidth( aDefaultPensize );
586 aPlotter->PlotImage( *m_image, aPos, GetScalingFactor() );
587}
588
589
591{
592 if( m_image )
593 {
594 wxMemoryOutputStream stream;
595 wxBitmapType type = m_imageType == wxBITMAP_TYPE_JPEG ? wxBITMAP_TYPE_JPEG
596 : wxBITMAP_TYPE_PNG;
597
598 if( !m_image->SaveFile( stream, type ) )
599 return;
600
601 m_imageData.GetWriteBuf( stream.GetLength() );
602 stream.CopyTo( m_imageData.GetData(), stream.GetLength() );
603 m_imageData.SetDataLen( stream.GetLength() );
604 }
605}
BOX2< VECTOR2I > BOX2I
Definition box2.h:918
constexpr BOX2I KiROUND(const BOX2D &aBoxD)
Definition box2.h:986
void ensureBitmapUpToDate() const
Ensure the cached wxBitmap is up-to-date with the current wxImage.
wxMemoryBuffer m_imageData
Cached encoded image data (PNG/JPEG).
void Rotate(bool aRotateCCW)
Rotate image CW or CCW.
bool LoadLegacyData(LINE_READER &aLine, wxString &aErrorMsg)
Load an image data saved by #SaveData.
void updateImageDataBuffer()
Resets the image data buffer using the current image data.
double GetScalingFactor() const
This scaling factor depends on m_pixelSizeIu and m_scale.
Definition bitmap_base.h:90
void PlotImage(PLOTTER *aPlotter, const VECTOR2I &aPos, const KIGFX::COLOR4D &aDefaultColor, int aDefaultPensize) const
Plot bitmap on plotter.
void Mirror(FLIP_DIRECTION aFlipDirection)
Mirror image vertically (i.e.
const BOX2I GetBoundingBox() const
Return the orthogonal, bounding box of this object for display purposes.
bool m_isMirroredY
bool m_isMirroredX
void ImportData(BITMAP_BASE &aItem)
Copy aItem image to this object and update m_bitmap.
bool m_bitmapDirty
True when m_bitmap needs rebuilding from m_image.
bool SaveImageData(wxOutputStream &aOutStream) const
Write the bitmap data to aOutStream.
wxImage * m_originalImage
Raw image data, not transformed by rotate/mirror.
void rebuildBitmap(bool aResetID=true)
Rebuild the internal bitmap used to draw/plot image.
static void mirrorImageInPlace(wxImage &aImage, FLIP_DIRECTION aFlipDirection)
Mirror the wxImage pixel data in-place without allocating a new image.
wxBitmapType m_imageType
The image type (png, jpeg, etc.).
wxBitmap * m_bitmap
The bitmap used to draw/plot image.
void ConvertToGreyscale()
bool SetImage(const wxImage &aImage)
Set the image from an existing wxImage.
bool ReadImageFile(const wxString &aFullFilename)
Reads and stores in memory an image file.
wxImage * m_image
The raw, uncompressed image data.
double m_scale
The scaling factor of the bitmap with m_pixelSizeIu, controls the actual draw size.
double m_pixelSizeIu
The scaling factor of the bitmap to convert the bitmap size (in pixels) to internal KiCad units.
int m_ppi
The bitmap definition. The default is 300PPI.
void DrawBitmap(wxDC *aDC, const VECTOR2I &aPos, const KIGFX::COLOR4D &aBackgroundColor=KIGFX::COLOR4D::UNSPECIFIED) const
int GetLegacyPPI() const
Recompute the PPI the way it was computed before the pixels/cm truncation fix.
BITMAP_BASE(const VECTOR2I &pos=VECTOR2I(0, 0))
VECTOR2I GetSize() const
EDA_ANGLE m_rotation
constexpr BOX2< Vec > & Inflate(coord_type dx, coord_type dy)
Inflates the rectangle horizontally by dx and vertically by dy.
Definition box2.h:554
static const COLOR4D UNSPECIFIED
For legacy support; used as a value to indicate color hasn't been set yet.
Definition color4d.h:398
A color representation with 4 components: red, green, blue, alpha.
Definition color4d.h:101
wxColour ToColour() const
Definition color4d.cpp:221
Definition kiid.h:44
An abstract class from which implementation specific LINE_READERs may be derived to read single lines...
Definition richio.h:62
virtual char * ReadLine()=0
Read a line of text into the buffer and increments the line number counter.
char * Line() const
Return a pointer to the last line that was read in.
Definition richio.h:98
Base plotter engine class.
Definition plotter.h:133
virtual void PlotImage(const wxImage &aImage, const VECTOR2I &aPos, double aScaleFactor)
Only PostScript plotters can plot bitmaps.
Definition plotter.cpp:256
virtual void SetCurrentLineWidth(int width, void *aData=nullptr)=0
Set the line width for the next drawing.
virtual void SetColor(const COLOR4D &color)=0
static constexpr EDA_ANGLE ANGLE_0
Definition eda_angle.h:411
static constexpr EDA_ANGLE ANGLE_90
Definition eda_angle.h:413
bool GetGRForceBlackPenState(void)
Definition gr_basic.cpp:165
FLIP_DIRECTION
Definition mirror.h:23
@ LEFT_RIGHT
Flip left to right (around the Y axis)
Definition mirror.h:24
@ TOP_BOTTOM
Flip top to bottom (around the X axis)
Definition mirror.h:25
const int scale
wxString result
Test unit parsing edge cases and error handling.
VECTOR2< int32_t > VECTOR2I
Definition vector2d.h:683