MCPcopy Create free account
hub / github.com/BlueAndi/Pixelix / create

Method create

lib/BaseGfx/src/BaseGfxBitmap.hpp:526–544  ·  view source on GitHub ↗

* Create internal pixel buffer. * If a pixel buffer already exists, it will fail. * * @param[in] width Pixel bitmap width in pixels * @param[in] height Pixel bitmap height in pixels * * @return If successful, it will return true otherwise false. */

Source from the content-addressed store, hash-verified

524 * @return If successful, it will return true otherwise false.
525 */
526 bool create(uint16_t width, uint16_t height)
527 {
528 bool isSuccessful = false;
529
530 if (nullptr == m_pixels)
531 {
532 m_pixels = allocatePixels(width, height);
533
534 if (nullptr != m_pixels)
535 {
536 m_width = width;
537 m_height = height;
538
539 isSuccessful = true;
540 }
541 }
542
543 return isSuccessful;
544 }
545
546 /**
547 * Release the internal pixel buffer.

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected