Rhino C++ API  8.7
Public Member Functions | Public Attributes | Static Public Attributes | Protected Member Functions | List of all members
ON_WindowsBitmap Class Reference

#include <opennurbs_bitmap.h>

Inheritance diagram for ON_WindowsBitmap:
ON_Bitmap ON_ModelComponent ON_Object ON_WindowsBitmapEx

Public Member Functions

 ON_WindowsBitmap ()=default
 ON_WindowsBitmap (const ON_WindowsBitmap &)
 ~ON_WindowsBitmap ()
const unsigned char * Bits (int) const override
unsigned char * Bits (int) override
int BitsPerPixel () const override
 bits per pixel More...
bool Create (const ON_WindowsBITMAPINFO *bmi, const unsigned char *bits, bool bCopy)
bool Create (const struct ON_WindowsBITMAPINFO *src)
bool Create (int width, int height, int bits_per_pixel)
int Height () const override
bool IsContiguous () const
bool IsEmpty () const
bool IsValid (class ON_TextLog *text_log=nullptr) const override
ON_WindowsBitmapoperator= (const ON_WindowsBitmap &)
int PaletteColorCount () const
 <0 means it's a top-down bitmap with origin at upper left More...
ON_Color Pixel (int, const unsigned char *) const
ON_Color Pixel (int, int) const
 int PaletteIndex( ON_Color ) const; ///< for 8bpp bitmaps More...
bool Read (ON_BinaryArchive &) override
 reads compressed image More...
bool ReadCompressed (ON_BinaryArchive &)
bool ReadUncompressed (ON_BinaryArchive &)
unsigned int SizeOf () const override
size_t SizeofImage () const override
 number of bytes in image More...
int SizeofPalette () const
 number of bytes in palette More...
size_t SizeofScan () const override
 number of bytes per scan line More...
int Width () const override
bool Write (ON_BinaryArchive &) const override
 writes compressed image More...
bool WriteCompressed (ON_BinaryArchive &) const
bool WriteUncompressed (ON_BinaryArchive &) const
- Public Member Functions inherited from ON_Bitmap
 ON_Bitmap (const ON_Bitmap &)
 ~ON_Bitmap ()=default
void Dump (ON_TextLog &) const override
const ON_FileReferenceFileReference () const
ON_Bitmapoperator= (const ON_Bitmap &)=default
void SetFileFullPath (const wchar_t *file_full_path, bool bSetContentHash)
void SetFileReference (const ON_FileReference &file_reference)
- Public Member Functions inherited from ON_ModelComponent
 ON_ModelComponent () ON_NOEXCEPT
 ON_ModelComponent (const ON_ModelComponent &source)
 ON_ModelComponent (ON_ModelComponent::Type component_type) ON_NOEXCEPT
 ON_ModelComponent (ON_ModelComponent::Type component_type, const ON_ModelComponent &source) ON_NOEXCEPT
 Locked status of source attributes is not copied to permit copy and modify operations. More...
 ~ON_ModelComponent ()=default
bool ChangeName (const wchar_t *new_name, class ON_ComponentManifest *manifest)
bool ClearComponentType ()
bool ClearId ()
bool ClearIndex ()
unsigned int ClearModelComponentAttributes (unsigned int attributes_filter)
bool ClearModelComponentStatus ()
bool ClearModelSerialNumber ()
bool ClearName ()
bool ClearParentId ()
int CompareName (const ON_UUID &other_parent_id, const wchar_t *other_name) const
int CompareName (const wchar_t *other_name) const
int CompareNameExact (const ON_UUID &other_parent_id, const wchar_t *other_name) const
int CompareNameExact (const wchar_t *other_name) const
ON_ModelComponent::Type ComponentType () const
bool ComponentTypeIsLocked () const
bool ComponentTypeIsSet () const
ON__UINT64 ContentVersionNumber () const
unsigned int CopyFrom (const ON_ModelComponent &src, unsigned int attributes_filter)
ON__UINT32 DataCRC (ON__UINT32 current_remainder) const override
const ON_wString DeletedName () const
const ON_NameHashDeletedNameHash () const
bool DeletedNameIsSet () const
bool DeleteName ()
void Dump (ON_TextLog &) const override
bool EraseIdentification (bool bIgnoreLocks)
const wchar_tGetName (ON_wString &component_name) const
const ON_UUIDId () const
bool IdIsLocked () const
bool IdIsNil () const
bool IdIsNotNil () const
bool IdIsSet () const
const ON_UUIDIfIdIsNilSetId ()
int Index () const
int Index (int unset_index_value) const
bool IndexIsLocked () const
bool IndexIsSet () const
unsigned int InstanceDefinitionModelSerialNumber () const
bool IsDeleted () const
bool IsHidden () const
bool IsLocked () const
bool IsReferenceComponent () const
bool IsSystemComponent () const
bool IsValid (class ON_TextLog *text_log=nullptr) const override
void LockAllSettingsExceptName ()
void LockComponentType ()
void LockId ()
void LockIndex ()
void LockModelComponentStatus ()
void LockModelSerialNumber ()
void LockName ()
void LockParentId ()
ON_ComponentStatus ModelComponentStatus () const
bool ModelComponentStatusIsLocked () const
bool ModelComponentStatusIsSet () const
ON_UUID ModelObjectId () const override
unsigned int ModelSerialNumber () const
bool ModelSerialNumberIsLocked () const
bool ModelSerialNumberIsSet () const
const ON_wString Name () const
const wchar_tNameAsPointer () const
const ON_NameHashNameHash () const
bool NameIsEmpty () const
bool NameIsLocked () const
bool NameIsNotEmpty () const
bool NameIsSet () const
const ON_NameHash NewNameHash (const wchar_t *new_name) const
ON_ModelComponentoperator= (const ON_ModelComponent &source)
const ON_UUIDParentId () const
bool ParentIdIsLocked () const
bool ParentIdIsNil () const
bool ParentIdIsNotNil () const
bool ParentIdIsSet () const
bool ReadModelComponentAttributes (class ON_BinaryArchive &archive)
unsigned int ReferenceModelSerialNumber () const
ON__UINT64 RuntimeSerialNumber () const
const ON_UUIDSetAndLockId ()
bool SetAsSystemComponent ()
bool SetAsUnsetSystemComponent ()
bool SetComponentType (ON_ModelComponent::Type component_component_type)
bool SetDeletedModelComponentState (bool bDeleted, class ON_ComponentManifest *manifest)
void SetHiddenModelComponentState (bool bHidden)
const ON_UUIDSetId ()
bool SetId (const ON_UUID &component_id)
bool SetIdentification (const class ON_ComponentManifestItem &manifest_item, const wchar_t *manifest_name, bool bSetId, bool bParentId, bool bSetName, bool bSetIndex)
bool SetIndex (int component_index)
bool SetLocalizedSystemComponentName (const wchar_t *system_component_localized_name)
void SetLockedModelComponentState (bool bLocked)
bool SetModelComponentStatus (ON_ComponentStatus component_status)
bool SetModelSerialNumber (unsigned int model_serial_number)
bool SetModelSerialNumber (unsigned int model_serial_number, unsigned int reference_model_serial_number, unsigned int instance_definition_model_serial_number)
bool SetName (const wchar_t *component_name)
bool SetParentId (const ON_UUID &parent_id)
unsigned int SizeOf () const override
bool UndeleteName ()
bool WriteModelComponentAttributes (class ON_BinaryArchive &archive, unsigned int attributes_filter) const
- Public Member Functions inherited from ON_Object
 ON_Object (const ON_Object &)
virtual ~ON_Object ()
virtual ON_AggregateComponentStatus AggregateComponentStatus () const
bool AttachUserData (class ON_UserData *pUserData)
unsigned int ClearAllComponentStates () const
virtual unsigned int ClearComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_clear) const
virtual unsigned int ClearComponentStates (ON_ComponentStatus states_to_clear) const
void CopyUserData (const ON_Object &source_object)
unsigned int CopyUserData (const ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution)
virtual bool DeleteComponents (const ON_COMPONENT_INDEX *ci_list, size_t ci_count)
virtual void DestroyRuntimeCache (bool bDelete=true)
bool DetachUserData (class ON_UserData *pUserData)
void EmergencyDestroy ()
class ON_UserDataFirstUserData () const
virtual unsigned int GetComponentsWithSetStates (ON_ComponentStatus states_filter, bool bAllEqualStates, ON_SimpleArray< ON_COMPONENT_INDEX > &components) const
class ON_UserDataGetUserData (const ON_UUID &userdata_uuid) const
bool GetUserString (const wchar_t *key, ON_wString &string_value) const
int GetUserStringKeys (ON_ClassArray< ON_wString > &user_string_keys) const
int GetUserStrings (ON_ClassArray< ON_UserString > &user_strings) const
bool IsCorrupt (bool bRepair, bool bSilentError, class ON_TextLog *text_log) const
bool IsKindOf (const ON_ClassId *pClassId) const
virtual void MarkAggregateComponentStatusAsNotCurrent () const
virtual void MemoryRelocate ()
void MoveUserData (ON_Object &source_object)
unsigned int MoveUserData (ON_Object &source_object, ON_UUID source_userdata_item_id, ON_Object::UserDataConflictResolution userdata_conflict_resolution, bool bDeleteAllSourceItems)
virtual ON::object_type ObjectType () const
ON_Objectoperator= (const ON_Object &)
void PurgeUserData ()
virtual unsigned int SetComponentStates (ON_COMPONENT_INDEX component_index, ON_ComponentStatus states_to_set) const
virtual unsigned int SetComponentStatus (ON_COMPONENT_INDEX component_index, ON_ComponentStatus status_to_copy) const
bool SetUserString (const wchar_t *key, const wchar_t *string_value)
int SetUserStrings (int count, const ON_UserString *user_strings, bool bReplace)
bool ThisIsNullptr (bool bSilentError) const
void TransformUserData (const class ON_Xform &xform)
virtual bool UpdateReferencedComponents (const class ON_ComponentManifest &source_manifest, const class ON_ComponentManifest &destination_manifest, const class ON_ManifestMap &manifest_map)
int UserStringCount () const

Public Attributes

unsigned char * m_bits = nullptr
struct ON_WindowsBITMAPINFOm_bmi = nullptr

Static Public Attributes

static const ON_WindowsBitmap Unset
- Static Public Attributes inherited from ON_Bitmap
static const ON_Bitmap Unset
- Static Public Attributes inherited from ON_ModelComponent
static const ON_wString NamePathSeparator
static const ON_wString ReferencePrefixDelimiter
static const ON_wString ReferencePrefixSeparator
static const ON_ModelComponent Unset
*static const ON_wString WorksessionReferencePrefix *const wchar_t

Protected Member Functions

void Internal_Copy (const ON_WindowsBitmap &src)
void Internal_Destroy ()
- Protected Member Functions inherited from ON_ModelComponent
void IncrementContentVersionNumber () const

Additional Inherited Members

- Public Types inherited from ON_ModelComponent
enum  Attributes : unsigned int {
  NoAttributes = 0U, ComponentSerialNumberAttribute = 0x0001U, TypeAttribute = 0x0002U, ModelSerialNumberAttribute = 0x0004U,
  IdAttribute = 0x0008U, IndexAttribute = 0x0010U, NameAttribute = 0x0020U, ParentIdAttribute = 0x0040U,
  DeletedNameAttribute = 0x0080U, ComponentStatusAttribute = 0x0100U, BinaryArchiveAttributes = 0x78U, AllAttributes = 0x1FFU,
  SystemComponentAttribute = 0x8000U
enum  Type : unsigned char {
  Type::Unset = 0, Type::Image = 1, Type::TextureMapping = 2, Type::Material = 3,
  Type::RenderMaterial = Material, Type::LinePattern = 4, Type::Layer = 5, Type::Group = 6,
  Type::TextStyle = 7, Type::DimStyle = 8, Type::RenderLight = 9, Type::HatchPattern = 10,
  Type::InstanceDefinition = 11, Type::ModelGeometry = 12, Type::HistoryRecord = 13, Type::RenderContent = 14,
  Type::EmbeddedFile = 15, Type::ObsoleteValue = 16, Type::SectionStyle = 17, Type::NumOf,
  Type::Mixed = 0xFE
 The ON_ModelComponent::Type enum has a value for each explicit component type and two special values, Unset and Mixed. Use an ON_ModelComponentTypeIterator instance to iterate over the ON_ModelComponent::Type values. /summary> More...
- Public Types inherited from ON_Object
enum  UserDataConflictResolution : unsigned char {
  UserDataConflictResolution::destination_object = 0, UserDataConflictResolution::source_object = 1, UserDataConflictResolution::source_copycount_gt = 2, UserDataConflictResolution::source_copycount_ge = 3,
  UserDataConflictResolution::destination_copycount_gt = 4, UserDataConflictResolution::destination_copycount_ge = 5, UserDataConflictResolution::delete_item = 6
- Static Public Member Functions inherited from ON_Bitmap
static const ON_BitmapFromModelComponentRef (const class ON_ModelComponentReference &model_component_reference, const ON_Bitmap *none_return_value)
- Static Public Member Functions inherited from ON_ModelComponent
static int CompareId (const ON_ModelComponent &a, const ON_ModelComponent &b)
static int CompareIdAndName (const ON_ModelComponent &a, const ON_ModelComponent &b)
static int CompareName (const ON_ModelComponent &a, const ON_ModelComponent &b)
static int CompareNameAndId (const ON_ModelComponent &a, const ON_ModelComponent &b)
static int CompareNameExact (const ON_ModelComponent &a, const ON_ModelComponent &b)
static ON_ModelComponent::Type ComponentTypeFromUnsigned (unsigned int component_type_as_unsigned)
static bool ComponentTypeIsValid (ON_ModelComponent::Type component_type)
static bool ComponentTypeIsValidAndNotMixed (ON_ModelComponent::Type component_type)
static const ON_wString ComponentTypeToString (ON_ModelComponent::Type)
static bool IndexRequired (ON_ModelComponent::Type component_type)
static unsigned int Internal_SystemComponentHelper ()
 For internal use. Never call this function. More...
static const wchar_tIsNamePathSeparator (const wchar_t *s)
*static const wchar_tIsReferencePrefixDelimiter (const wchar_t *s)
static const wchar_tIsReferencePrefixSeparator (const wchar_t *s)
static bool IsValidComponentName (const class ON_ComponentManifest &model_manfest, const ON_ModelComponent &model_component, bool bPermitReferencePrefix, ON_wString &valid_name)
static bool IsValidComponentName (const ON_wString &candidate_component_name)
static bool IsValidComponentName (const wchar_t *candidate_component_name)
static bool IsValidComponentName (size_t length, const wchar_t *candidate_component_name)
static bool IsValidComponentNameFirstCodePoint (int length, const wchar_t *candidate_component_name)
static bool IsValidComponentNameFirstCodePoint (ON__UINT32 unicode_code_point)
static const ON_wString NameLeaf (const wchar_t *name)
static const ON_wString NameParent (const wchar_t *name, bool bIncludeReference)
static const ON_wString NameReferencePrefix (const wchar_t *name)
static ON__UINT64 NextRuntimeSerialNumber ()
static const ON_wString RemoveAllReferencePrefixDelimiters (const wchar_t *name)
static const ON_wString RemoveReferencePrefix (const wchar_t *name)
static const ON_wString RemoveTrailingNamePathSeparator (const wchar_t *name)
static const ON_wString RemoveTrailingReferencePrefixDelimiter (const wchar_t *name)
static const ON_wString RemoveTrailingReferencePrefixSeparator (const wchar_t *name)
static void SplitName (const wchar_t *name, ON_wString &reference_prefix, ON_wString &name_parent, ON_wString &name_leaf)
static bool UniqueNameIgnoresCase (ON_ModelComponent::Type component_type)
static bool UniqueNameIncludesParent (ON_ModelComponent::Type component_type)
static bool UniqueNameRequired (ON_ModelComponent::Type component_type)

Constructor & Destructor Documentation

◆ ON_WindowsBitmap() [1/2]

ON_WindowsBitmap::ON_WindowsBitmap ( )

Uncompressed 8 bpp, 24 bpp, or 32 bpp Windows device independent bitmaps (DIB)

◆ ~ON_WindowsBitmap()

ON_WindowsBitmap::~ON_WindowsBitmap ( )

◆ ON_WindowsBitmap() [2/2]

ON_WindowsBitmap::ON_WindowsBitmap ( const ON_WindowsBitmap )

Member Function Documentation

◆ Bits() [1/2]

const unsigned char* ON_WindowsBitmap::Bits ( int  ) const

Reimplemented from ON_Bitmap.

◆ Bits() [2/2]

unsigned char* ON_WindowsBitmap::Bits ( int  )

Reimplemented from ON_Bitmap.

◆ BitsPerPixel()

int ON_WindowsBitmap::BitsPerPixel ( ) const

bits per pixel

Reimplemented from ON_Bitmap.

◆ Create() [1/3]

bool ON_WindowsBitmap::Create ( const ON_WindowsBITMAPINFO bmi,
const unsigned char *  bits,
bool  bCopy 

bool SetColor( ///< sets entire map to specified color ON_Color );

◆ Create() [2/3]

bool ON_WindowsBitmap::Create ( const struct ON_WindowsBITMAPINFO src)

Description: Create an ON_WindowsBitmap from a contiguous bitmap ON_WindowsBITMAPINFO. Parameters: src - [in] A contiguous Windows device independent bitmap. This means that the "bits" in the bitmap begin at the memory location &m_bits->bmiColors[0]. See Also: Remarks: ~ON_WindowsBitmap will not delete src.

◆ Create() [3/3]

bool ON_WindowsBitmap::Create ( int  width,
int  height,
int  bits_per_pixel 

Parameters: width - [in] height - [in] bits_per_pixel - [in] 1, 2, 4, 8, 16, 24, or 32

◆ Height()

int ON_WindowsBitmap::Height ( ) const

>0 means it's a bottom-up bitmap with origin at lower right

Reimplemented from ON_Bitmap.

◆ Internal_Copy()

void ON_WindowsBitmap::Internal_Copy ( const ON_WindowsBitmap src)

◆ Internal_Destroy()

void ON_WindowsBitmap::Internal_Destroy ( )

◆ IsContiguous()

bool ON_WindowsBitmap::IsContiguous ( ) const

Returns: True if m_bmi and m_bits are in a single contiguous block of memory. False if m_bmi and m_bits are in two blocks of memory.

◆ IsEmpty()

bool ON_WindowsBitmap::IsEmpty ( ) const

◆ IsValid()

bool ON_WindowsBitmap::IsValid ( class ON_TextLog text_log = nullptr) const

Description: Tests an object to see if its data members are correctly initialized. Parameters: text_log - [in] if the object is not valid and text_log is not nullptr, then a brief englis description of the reason the object is not valid is appened to the log. The information appended to text_log is suitable for low-level debugging purposes by programmers and is not intended to be useful as a high level user interface tool. Returns: @untitled table true object is valid false object is invalid, uninitialized, etc.

Reimplemented from ON_Object.

◆ operator=()

ON_WindowsBitmap& ON_WindowsBitmap::operator= ( const ON_WindowsBitmap )

◆ PaletteColorCount()

int ON_WindowsBitmap::PaletteColorCount ( ) const

<0 means it's a top-down bitmap with origin at upper left

number of colors in palette

◆ Pixel() [1/2]

ON_Color ON_WindowsBitmap::Pixel ( int  ,
const unsigned char *   
) const

◆ Pixel() [2/2]

ON_Color ON_WindowsBitmap::Pixel ( int  ,
) const

int PaletteIndex( ON_Color ) const; ///< for 8bpp bitmaps

◆ Read()

bool ON_WindowsBitmap::Read ( ON_BinaryArchive )

reads compressed image

Reimplemented from ON_Bitmap.

Reimplemented in ON_WindowsBitmapEx.

◆ ReadCompressed()

bool ON_WindowsBitmap::ReadCompressed ( ON_BinaryArchive )

◆ ReadUncompressed()

bool ON_WindowsBitmap::ReadUncompressed ( ON_BinaryArchive )

◆ SizeOf()

unsigned int ON_WindowsBitmap::SizeOf ( ) const

Returns: An estimate of the amount of memory the class uses in bytes.

Reimplemented from ON_Bitmap.

◆ SizeofImage()

size_t ON_WindowsBitmap::SizeofImage ( ) const

number of bytes in image

Reimplemented from ON_Bitmap.

◆ SizeofPalette()

int ON_WindowsBitmap::SizeofPalette ( ) const

number of bytes in palette

◆ SizeofScan()

size_t ON_WindowsBitmap::SizeofScan ( ) const

number of bytes per scan line

Reimplemented from ON_Bitmap.

◆ Width()

int ON_WindowsBitmap::Width ( ) const

Reimplemented from ON_Bitmap.

◆ Write()

bool ON_WindowsBitmap::Write ( ON_BinaryArchive ) const

writes compressed image

Reimplemented from ON_Bitmap.

Reimplemented in ON_WindowsBitmapEx.

◆ WriteCompressed()

bool ON_WindowsBitmap::WriteCompressed ( ON_BinaryArchive ) const

◆ WriteUncompressed()

bool ON_WindowsBitmap::WriteUncompressed ( ON_BinaryArchive ) const

Member Data Documentation

◆ m_bits

unsigned char* ON_WindowsBitmap::m_bits = nullptr

◆ m_bmi

struct ON_WindowsBITMAPINFO* ON_WindowsBitmap::m_bmi = nullptr

◆ Unset

const ON_WindowsBitmap ON_WindowsBitmap::Unset