Rhino C++ API
8.14
|
#include <RhinoSdkUiDibMac.h>
Classes | |
class | CFastPixelAccess |
class | Pixel |
Public Member Functions | |
CRhinoDib () | |
Construction. More... | |
CRhinoDib () | |
Construction. More... | |
CRhinoDib (CGImageRef) | |
CRhinoDib (const CRhinoDib &) | |
copy constructor, create bitmap that matches another More... | |
CRhinoDib (const CRhinoDib &) | |
copy constructor, create bitmap that matches another More... | |
CRhinoDib (HBITMAP) | |
create Dib from hbitmap More... | |
CRhinoDib (HBITMAP) | |
create Dib from hbitmap More... | |
CRhinoDib (int width, int height, int color_depth, bool select_into_mem_dc=false, CPalette *=NULL) | |
create bitmap with specified width, height and color depth More... | |
CRhinoDib (long width, long height, int color_depth, bool select_into_mem_dc=false, HPALETTE=nullptr) | |
create bitmap with specified width, height and color depth More... | |
CRhinoDib (LPBITMAPINFO, bool free_lpbmi=true) | |
set Dib to specified BITMAPINFO pointer More... | |
virtual | ~CRhinoDib () |
Destruction. More... | |
virtual | ~CRhinoDib () |
Destruction. More... | |
bool | BitBlt (const ON_4iRect &destRect, const CRhinoDib &srcDib, const ON_2iPoint &srcPoint) |
BOOL32 | BitBlt (int x, int y, int nWidth, int nHeight, const CRhinoDib *srcDC, int srcLeft, int srcTop, int mode) |
MAC_DEPRECATED HBITMAP | Bitmap () const |
returns this, which is not very useful More... | |
HBITMAP | Bitmap () const |
const BITMAPINFO * | BitmapInfo () const |
bool | BlendDibsUsingAlphaChannel (long xDest, long yDest, long cx, long cy, CRhinoDib &src, long xSrc, long ySrc) |
bool | BltToDib (BITMAPINFO &destination, long x_dest, long y_dest, long cx, long cy, long x_src, long y_src) |
bool | BltToDib (CRhinoDib &destination, long x_dest, long y_dest, long cx, long cy, long x_src, long y_src) |
Copy dib bits from Dib to destination. More... | |
CRhinoCacheHandle * | Cache () const |
CRhinoCacheHandle * | Cache () const |
void | Clear (COLORREF) |
Clears (fills) the entire dib with the passed in color... More... | |
void | Clear (COLORREF) |
Clears (fills) the entire dib with the passed in color... More... | |
int | ColorDepth () const |
int | ColorDepth () const |
ComponentOrders | ComponentOrder (void) const |
ComponentOrders | ComponentOrder (void) const |
bool | ConvertToGrayScale (bool bSetAlpha=false) |
bool | ConvertToGrayScale (bool bSetAlpha=false) |
void | ConvertToNormalMap (bool bLossyCompressionSource, bool &bPositiveZComponent) |
void | ConvertToNormalMap (bool bLossyCompressionSource, bool &bPositiveZComponent) |
LPBITMAPINFO | CopyDib () const |
Return copy of existing dib, you are responsible for destroying this object. More... | |
bool | CopyDib (const BITMAPINFO &bmi) |
Copy bmi to m_bitmapinfo. More... | |
HBITMAP | CopyHBitmap () |
HBITMAP | CopyHBitmap () const |
BOOL32 | CopyToClipboard (HWND hwnd) const |
Clipboard operations. More... | |
bool | CopyToClipboard (HWND hwnd=nullptr) const |
Clipboard operations. More... | |
bool | CreateDib (int width, int height, int color_depth, bool select_into_mem_dc=false, CPalette *=NULL) |
DIB or HBITMAP creation functions. More... | |
LPBITMAPINFO | CreateDib (long width, long height, int color_depth, bool select_into_mem_dc=false, HPALETTE=nullptr) |
DIB or HBITMAP creation functions. More... | |
HBITMAP | CreateHBitmap (HPALETTE hpal=nullptr) |
Create HBITMAP and set m_hBitmap. More... | |
bool | CreatePalette (LPBITMAPINFO) |
BOOL32 | DCSelectBitmap (bool) |
don't know what this might do More... | |
void | DestroyDib () |
Destroy dib && hbitmap and zero out pointers. More... | |
void | DestroyDib () |
Destroy dib && hbitmap and zero out pointers. More... | |
double | DPI () const |
double | DPI () const |
BOOL32 | Draw (CDC *pDC, CRect rect, int xSrc=0, int ySrc=0) |
BOOL32 | Draw (CDC *pDC, int x=0, int y=0, int cx=0, int cy=0, int xSrc=0, int ySrc=0) |
Blit functions functions. More... | |
bool | DrawFilledCircle (const ON_2iPoint ¢er, int radius, ON_Color) |
bool | DrawFilledPolygon (const ON_SimpleArray< ON_2iPoint > &points, ON_Color cr) |
Points are in DIB space - ie, the same coordinate system as GetPixel. Use FlipPoint/Flipped points to switch. More... | |
bool | DrawFilledTriangle (const ON_2iPoint &p1, const ON_2iPoint &p2, const ON_2iPoint &p3, ON_Color) |
bool | DrawLine (const ON_2iPoint &p1, const ON_2iPoint &p2, ON_Color color, int thickness=0, bool circle_caps=false) |
BOOL32 | DrawMasked (CDC *pDC, COLORREF crMask, CRect rect, int xSrc=0, int ySrc=0) |
BOOL32 | DrawMasked (CDC *pDC, COLORREF crMask, int x=0, int y=0, int cx=0, int cy=0, int xSrc=0, int ySrc=0) |
bool | DrawPolyline (const ON_SimpleArray< ON_2iPoint > &points, ON_Color color, int thickness=0, bool circle_caps=false, bool close=false) |
CFastPixelAccess * | FastPixelAccess (void) |
CFastPixelAccess * | FastPixelAccess (void) |
const CFastPixelAccess * | FastPixelAccess (void) const |
const CFastPixelAccess * | FastPixelAccess (void) const |
bool | FillSolid (COLORREF) |
BOOL32 | FillSolid (ON_Color color) |
BOOL32 | FillSolidRect (CRect &rect, ON_Color color) |
BOOL32 | FillSolidRect (int x, int y, int nWidth, int nHeight, ON_Color color) |
LPBYTE | FindDIBBits () const |
LPBYTE | FindDIBBits (ComponentOrders) const |
ON_2iPoint | FlippedPoint (const ON_2iPoint &) const |
ON_SimpleArray< ON_2iPoint > | FlippedPoints (const ON_SimpleArray< ON_2iPoint > &) const |
void | FlipPoint (ON_2iPoint &) const |
Use these functions to transform points and arrays of points between DIB space (bottom up) and CDC space (top down) More... | |
void | FlipPoints (ON_SimpleArray< ON_2iPoint > &) const |
void | FlipVertical () |
void | FlipVertical (void) |
bool | FloodFill (long x, long y, COLORREF cr, int traget_alpha=-1) |
Goofy edit functions. More... | |
void | GaussianBlurWithRadius (double radius) |
UINT | GetDepth () const |
UINT | GetDepth () const |
bool | GetPixel (const LPBYTE dib_bits, int color_depth, long x, long y, COLORREF &cr, int &alpha) const |
Gets the RGB color of a pixel at an x,y location. More... | |
bool | GetPixel (const LPBYTE dib_bits, int color_depth, long x, long y, float &r, float &g, float &b) const |
Gets the fractional RGB color components (between 0.0 and 1.0) of a pixel at an x,y location. More... | |
bool | GetPixel (const LPBYTE dib_bits, int color_depth, long x, long y, float &r, float &g, float &b, float &alpha) const |
bool | GetPixel (const LPBYTE dib_bits, int color_depth, long x, long y, int &r, int &g, int &b) const |
Gets the RGB color components (between 0 and 255) of a pixel at an x,y location. More... | |
bool | GetPixel (const LPBYTE dib_bits, int color_depth, long x, long y, int &r, int &g, int &b, int &alpha) const |
BOOL32 | GetPixel (long x, long y, COLORREF &cr) const |
bool | GetPixel (long x, long y, COLORREF &cr) const |
Gets the RGB color of a pixel at an x,y location. More... | |
BOOL32 | GetPixel (long x, long y, COLORREF &cr, int &alpha) const |
bool | GetPixel (long x, long y, COLORREF &cr, int &alpha) const |
BOOL32 | GetPixel (long x, long y, float &r, float &g, float &b) const |
bool | GetPixel (long x, long y, float &r, float &g, float &b) const |
Gets the fractional RGB color components (between 0.0 and 1.0) of a pixel at an x,y location. More... | |
BOOL32 | GetPixel (long x, long y, float &r, float &g, float &b, float &alpha) const |
bool | GetPixel (long x, long y, float &r, float &g, float &b, float &alpha) const |
BOOL32 | GetPixel (long x, long y, int &r, int &g, int &b) const |
bool | GetPixel (long x, long y, int &r, int &g, int &b) const |
Gets the RGB color components (between 0 and 255) of a pixel at an x,y location. More... | |
BOOL32 | GetPixel (long x, long y, int &r, int &g, int &b, int &alpha) const |
bool | GetPixel (long x, long y, int &r, int &g, int &b, int &alpha) const |
bool | GetPixel (unsigned char *base, int x, unsigned char *r, unsigned char *g, unsigned char *b) |
bool | GetPixel (unsigned char *base, long x, unsigned char *r, unsigned char *g, unsigned char *b) const |
UINT | GetStorageSize () const |
DWORD | GetStorageSize () const |
UINT | GetStorageWidth () const |
DWORD | GetStorageWidth () const |
UINT | GLDataType () const |
e.g. GL_UNSIGNED_BYTE More... | |
UINT | GLPixelFormat () const |
OpenGL attributes for this image. More... | |
bool | GradientFill (COLORREF topLeft, COLORREF topRight, COLORREF bottomLeft, COLORREF bottomRight) |
int | Height () const |
long | Height () const |
bool | IncreaseColorDepth (int nNewColorDepth) |
bool | IncreaseColorDepth (int nNewColorDepth) |
bool | IsAllocated () const |
Call this to ensure there is memory allocated. Replace calls to check FindDIBBits() for nullptr with this. More... | |
bool | IsAllocated () const |
bool | IsNormalMap (bool bLossyCompressionSource, bool &bPositiveZComponent) const |
bool | IsNormalMap (bool bLossyCompressionSource, bool &bPositiveZComponent) const |
bool | IsNormalMap (void) const |
bool | IsNormalMap (void) const |
const wchar_t * | LastSaveName () const |
const wchar_t * | LastSaveName () const |
void | MakeOpaque () |
convert all partially transparent pixels to fully opaque More... | |
void | MakeOpaque (void) |
long | NumColors () const |
int | NumColors () const |
operator CDC * () | |
operator CDC * () const | |
operator HBITMAP () | |
operator HBITMAP () const | |
CRhinoDib & | operator= (const CRhinoDib &src) |
CRhinoDib & | operator= (const CRhinoDib &src) |
CRhinoDib & | operator= (HBITMAP hBitmap) |
CPalette * | Palette () const |
HPALETTE | Palette () const |
long | PaletteSize () const |
long | PaletteSize () const |
bool | PasteFromClipboard (HWND hwnd, bool bMustBeSameSize=true, bool bMustHaveSameColorDepth=true) const |
UINT | PelsPerMeter () const |
UINT | PelsPerMeter () const |
bool | Print (HWND hWnd=0, bool bFitToPage=true) |
ON_DEPRECATED bool | Print (HWND hWnd=nullptr, bool bFitToPage=true) |
class CRhDibPrivate & | Private (void) |
const class CRhDibPrivate & | Private (void) const |
bool | ProcessPixels (bool(*f)(const Pixel &, void *pvData), void *pvData=nullptr) const |
bool | ProcessPixels (bool(*f)(const Pixel &, void *pvData), void *pvData=nullptr) const |
bool | ProcessPixels (bool(*f)(Pixel &, void *pvData), void *pvData=nullptr) |
bool | ProcessPixels (bool(*f)(Pixel &, void *pvData), void *pvData=nullptr) |
void | ProcessPixels (void(*f)(const Pixel &, void *pvData), void *pvData=nullptr) const |
void | ProcessPixels (void(*f)(const Pixel &, void *pvData), void *pvData=nullptr) const |
void | ProcessPixels (void(*f)(Pixel &, const void *pvData), const void *pvData=nullptr) |
void | ProcessPixels (void(*f)(Pixel &, const void *pvData), const void *pvData=nullptr) |
void | ProcessPixels (void(*f)(Pixel &, void *pvData), void *pvData=nullptr) |
void | ProcessPixels (void(*f)(Pixel &, void *pvData), void *pvData=nullptr) |
void | ProcessPixels_SingleThreaded (void(*f)(const Pixel &, void *pvData), void *pvData=nullptr) const |
void | ProcessPixels_SingleThreaded (void(*f)(const Pixel &, void *pvData), void *pvData=nullptr) const |
void | ProcessPixels_SingleThreaded (void(*f)(Pixel &, const void *pvData), const void *pvData=nullptr) |
void | ProcessPixels_SingleThreaded (void(*f)(Pixel &, const void *pvData), const void *pvData=nullptr) |
void | ProcessPixels_SingleThreaded (void(*f)(Pixel &, void *pvData), void *pvData=nullptr) |
void | ProcessPixels_SingleThreaded (void(*f)(Pixel &, void *pvData), void *pvData=nullptr) |
CRhinoCommand::result | ReadFile (HWND hWnd=nullptr, bool bUseDialogs=true) |
CRhinoCommand::result | ReadFile (unsigned int doc_serial_number, HWND hWnd=nullptr, bool bUseDialogs=true) |
bool | ReadFromFile (const wchar_t *lpsFileName) |
bool | ReadFromFile (const wchar_t *lpsFileName) |
bool | ReadFromFile (HWND hWnd=0, bool bUseDialogs=true) |
bool | ReadFromFile (HWND hWnd=nullptr, bool bUseDialogs=true) |
bool | ReadFromFile (unsigned int doc_serial_number, const wchar_t *lpsFileName) |
bool | ReadFromFile (unsigned int doc_serial_number, const wchar_t *lpsFileName) |
bool | ReadFromFile (unsigned int doc_serial_number, HWND hWnd=nullptr, bool bUseDialogs=true) |
bool | ReadFromMemory (const void *buffer, int sizeof_buffer) |
bool | ReadFromMemory (const void *buffer, size_t sizeof_buffer) |
bool | ReadFromSvgData (const ON_wString &svg, int width, int height, bool convert_to_darkmode=false) |
bool | Resize (const ON_2iSize &newSize) |
Legacy resize method; uses Bilinear resampling. More... | |
bool | Resize (const ON_2iSize &newSize, ResampleAlgorithm alg) |
New resize method; uses chosen resampling algorithm. More... | |
void | Resize (int newWidth, int newHeight) |
bool | Resized (const CRhinoDib &input, const ON_2iSize &newSize) |
Legacy resized method; uses Bilinear resampling. More... | |
bool | Resized (const CRhinoDib &input, const ON_2iSize &newSize, ResampleAlgorithm alg) |
New resized method; uses chosen resampling algorithm. More... | |
bool | ReuseDib (int width, int height, int depth, bool select_into_mem_dc) |
bool | ReuseDib (long width, long height, int color_depth, bool select_into_mem_dc) |
unsigned int | RuntimeSerialNumber () const |
unsigned int | RuntimeSerialNumber () const |
long | ScanWidth () const |
DWORD | ScanWidth () const |
void | SetBitmap (CGImageRef) |
bool | SetBitmap (HBITMAP hBitmap) |
void | SetBitmap (HBITMAP) |
BOOL32 | SetDib (LPBITMAPINFO lpbmi, bool free_lpbmi=true) |
bool | SetDib (LPBITMAPINFO lpbmi, bool free_lpbmi=true) |
void | SetDPI (double) |
void | SetDPI (double) |
void | SetLastSaveName (const wchar_t *) |
void | SetLastSaveName (const wchar_t *) |
void | SetPelsPerMeter (UINT) |
void | SetPelsPerMeter (UINT) |
BOOL32 | SetPixel (long x, long y, COLORREF cr, int alpha=-1) |
bool | SetPixel (long x, long y, COLORREF cr, int alpha=-1) |
Sets the color of a pixel at an x,y location given an RGB color. More... | |
BOOL32 | SetPixel (long x, long y, float r, float g, float b, float alpha=-1.0) |
Functions call FindDIBBits and validate x and y. More... | |
bool | SetPixel (long x, long y, float r, float g, float b, float alpha=-1.0) |
Sets the color of a pixel at an x,y location given a fractional RGB color components (between 0.0 and 1.0) More... | |
BOOL32 | SetPixel (long x, long y, int r, int g, int b, int alpha=-1) |
bool | SetPixel (long x, long y, int r, int g, int b, int alpha=-1) |
Sets the color of a pixel at an x,y location given an RGB color components (between 0 and 255) More... | |
bool | SetPixel (LPBYTE dib_bits, int color_depth, long x, long y, COLORREF cr, int alpha=-1) |
Sets the color of a pixel at an x,y location given an RGB color. More... | |
bool | SetPixel (LPBYTE dib_bits, int color_depth, long x, long y, float r, float g, float b, float alpha=-1.0) |
Sets the color of a pixel at an x,y location given a fractional RGB color components (between 0.0 and 1.0) More... | |
bool | SetPixel (LPBYTE dib_bits, int color_depth, long x, long y, int r, int g, int b, int alpha=-1) |
Sets the color of a pixel at an x,y location given an RGB color components (between 0 and 255) More... | |
CRhinoDib * | ShiftDown () |
CRhinoDib * | ShiftLeft () |
CRhinoDib * | ShiftRight () |
CRhinoDib * | ShiftUp () |
long | Size () const |
Bitmap information. More... | |
DWORD | Size () const |
Bitmap information. More... | |
long | SizeBits () const |
DWORD | SizeBits () const |
long | SizeHeader () const |
long | SizeHeader () const |
BOOL32 | StretchBlt (int x, int y, int nWidth, int nHeight, const CRhinoDib *srcDC, int xSrc, int ySrc, int nSrcWidth, int nSrcHeight, int mode) |
void | SwapRedAndBlueSamples () |
exchange the red and blue color bytes in the NSBitmapImageRep More... | |
ON_WindowsBitmap | ToON_WindowsBitmap (void) const |
ON_WindowsBitmap * | ToOnWindowsBitmap () const |
int | Width () const |
long | Width () const |
long | WidthInBytes () const |
DWORD | WidthInBytes () const |
long | WindowYtoDibY (long y) const |
Convert Y value from window display Y to bitmap Y. More... | |
CRhinoCommand::result | WriteFile (HWND hWnd=nullptr, bool bUseDialogs=true, Quality q=Quality::kHigh) const |
bool | WriteToFile (const wchar_t *lpsFileName, Quality q=Quality::kHigh) const |
bool | WriteToFile (const wchar_t *lpsFileName, Quality q=Quality::kHigh) const |
bool | WriteToFile (HWND hWnd=0, bool bUseDialogs=true, Quality q=Quality::kHigh) const |
bool | WriteToFile (HWND hWnd=nullptr, bool bUseDialogs=true, Quality q=Quality::kHigh) const |
Static Public Member Functions | |
static bitmap_file_type | FileTypeFromFileName (const wchar_t *lpsFileName) |
static bitmap_file_type | FileTypeFromFileName (const wchar_t *lpsFileName) |
static bool | FileTypeSupportsAlphaChannel (bitmap_file_type fileType) |
static bool | FileTypeSupportsAlphaChannel (bitmap_file_type fileType) |
static bool | FileTypeSupportsAlphaChannel (const wchar_t *fileName) |
static bool | FileTypeSupportsAlphaChannel (const wchar_t *fileName) |
static ComponentOrders | GLFormatToComponentOrder (GLenum) |
static ComponentOrders | GLFormatToComponentOrder (unsigned int) |
static bool | ReadFromFileImageSize (const wchar_t *file_name, unsigned int *image_width_pixels, unsigned int *image_height_pixels, unsigned int *image_width_dpi, unsigned int *image_height_dpi, unsigned int *image_depth_bits) |
static bool | ReadFromFileImageSize (const wchar_t *lpsFileName, unsigned int *image_width_pixels, unsigned int *image_height_pixels, unsigned int *image_width_dpi, unsigned int *image_height_dpi) |
static bool | ReadFromFileImageSize (const wchar_t *lpsFileName, unsigned int *image_width_pixels, unsigned int *image_height_pixels, unsigned int *image_width_dpi, unsigned int *image_height_dpi) |
Protected Member Functions | |
void | construct () |
void | MakeNSImage () |
virtual void | NonConstOperation () |
Static Protected Member Functions | |
static int | GetBitmapType (const wchar_t *lpsFileName) |
static int | GetBitmapType (const wchar_t *lpsFileName) |
Protected Attributes | |
unsigned int | m_color_depth |
CDC | m_dc |
class CRhDibPrivate * | m_dib_section = nullptr |
double | m_dpi |
int | m_height |
bool | m_is_gray_scale |
int | m_width |
ON_wString | m_wLastSaveName |
Friends | |
unsigned int | CreateGlAlphaTexture (const CRhinoDib &, bool, unsigned int) |
class | CRhCmnDisplayBitmap |
class | CRhEngine_GL11 |
class | CRhEngine_PEP_GL33 |
friend void Combine(const CRhinoDib&, CRhinoDib&, const float*, float*); More... | |
class | CRhinoDisplayEngine_GDI |
class | CRhinoDisplayEngine_OGL |
class | CRhinoDisplayPipeline |
class | CRhOpenGLRenderer |
class | CRhOpenGLTexture2D |
class | CRhOpenGLTextureCube |
class | CRhRdkPostEffectImage |
This is a list of the badly behaved. More... | |
class | CRhRegionSelectHelper |
class | CRhResourceManagerMetal |
class | CXXXXRender |
GLuint | GetGlTextureForDib (class CRhinoDisplayEngine_OGL &, const CRhinoDib &) |
bool | RhinoUpdateCachedTextureFromDib (unsigned int, const CRhinoDib &) |
class | TestDavidEBitmapFlip |
Class to manage DIB's. This class will create a DIB, a HBITMAP and associated memory DC. The HBITMAP and CRhinoDib::FindBits() point to the same memory. You can modify the bits directly or use GDI with the associated memory DC to modify the bitmap. The HBITMAP does not get selected by the memory devidce context due to the fact that the DIB can only be selected in one device context at a time. To select or remove the Bitmap() from its memory DC call DCSelectBitmap( bool). If you call DCSelectBitmap( true) you may cast a CRhinoDib as a CDC* or HDC and use it directly.
|
strong |
|
strong |
|
strong |
|
strong |
|
strong |
CRhinoDib::CRhinoDib | ( | ) |
Construction.
CRhinoDib::CRhinoDib | ( | long | width, |
long | height, | ||
int | color_depth, | ||
bool | select_into_mem_dc = false , |
||
HPALETTE | = nullptr |
||
) |
create bitmap with specified width, height and color depth
CRhinoDib::CRhinoDib | ( | const CRhinoDib & | ) |
copy constructor, create bitmap that matches another
CRhinoDib::CRhinoDib | ( | LPBITMAPINFO | , |
bool | free_lpbmi = true |
||
) |
set Dib to specified BITMAPINFO pointer
CRhinoDib::CRhinoDib | ( | HBITMAP | ) |
create Dib from hbitmap
|
virtual |
Destruction.
CRhinoDib::CRhinoDib | ( | ) |
Construction.
CRhinoDib::CRhinoDib | ( | int | width, |
int | height, | ||
int | color_depth, | ||
bool | select_into_mem_dc = false , |
||
CPalette * | = NULL |
||
) |
create bitmap with specified width, height and color depth
CRhinoDib::CRhinoDib | ( | const CRhinoDib & | ) |
copy constructor, create bitmap that matches another
CRhinoDib::CRhinoDib | ( | HBITMAP | ) |
create Dib from hbitmap
CRhinoDib::CRhinoDib | ( | CGImageRef | ) |
|
virtual |
Destruction.
bool CRhinoDib::BitBlt | ( | const ON_4iRect & | destRect, |
const CRhinoDib & | srcDib, | ||
const ON_2iPoint & | srcPoint | ||
) |
BOOL32 CRhinoDib::BitBlt | ( | int | x, |
int | y, | ||
int | nWidth, | ||
int | nHeight, | ||
const CRhinoDib * | srcDC, | ||
int | srcLeft, | ||
int | srcTop, | ||
int | mode | ||
) |
MAC_DEPRECATED HBITMAP CRhinoDib::Bitmap | ( | ) | const |
returns this, which is not very useful
HBITMAP CRhinoDib::Bitmap | ( | ) | const |
const BITMAPINFO* CRhinoDib::BitmapInfo | ( | ) | const |
Description: Get Windows bitmap info. Remarks: NOTE WELL: The bitmap bits are generally NOT located after BITMAPINFO and bmiColors[] array. Returns: A pointer to the bitmap info. Look but do not change. See Also: CRhinoDib::CRhinoDib::FindDIBBits
bool CRhinoDib::BlendDibsUsingAlphaChannel | ( | long | xDest, |
long | yDest, | ||
long | cx, | ||
long | cy, | ||
CRhinoDib & | src, | ||
long | xSrc, | ||
long | ySrc | ||
) |
bool CRhinoDib::BltToDib | ( | BITMAPINFO & | destination, |
long | x_dest, | ||
long | y_dest, | ||
long | cx, | ||
long | cy, | ||
long | x_src, | ||
long | y_src | ||
) |
bool CRhinoDib::BltToDib | ( | CRhinoDib & | destination, |
long | x_dest, | ||
long | y_dest, | ||
long | cx, | ||
long | cy, | ||
long | x_src, | ||
long | y_src | ||
) |
Copy dib bits from Dib to destination.
CRhinoCacheHandle* CRhinoDib::Cache | ( | ) | const |
CRhinoCacheHandle* CRhinoDib::Cache | ( | ) | const |
void CRhinoDib::Clear | ( | COLORREF | ) |
Clears (fills) the entire dib with the passed in color...
void CRhinoDib::Clear | ( | COLORREF | ) |
Clears (fills) the entire dib with the passed in color...
int CRhinoDib::ColorDepth | ( | ) | const |
int CRhinoDib::ColorDepth | ( | ) | const |
ComponentOrders CRhinoDib::ComponentOrder | ( | void | ) | const |
ComponentOrders CRhinoDib::ComponentOrder | ( | void | ) | const |
|
protected |
bool CRhinoDib::ConvertToGrayScale | ( | bool | bSetAlpha = false | ) |
Converts the dib into a grayscale image...and promotes it to a 24 bit dib if need be... If bSetAlpha is true, and the bitmap is a 32-bit image, the alpha byte is set to the same as the other three components otherwise, the alpha byte is preserved from the original image.
bool CRhinoDib::ConvertToGrayScale | ( | bool | bSetAlpha = false | ) |
Converts the dib into a grayscale image...and promotes it to a 24 bit dib if need be... If bSetAlpha is true, and the bitmap is a 32-bit image, the alpha byte is set to the same as the other three components otherwise, the alpha byte is preserved from the original image.
void CRhinoDib::ConvertToNormalMap | ( | bool | bLossyCompressionSource, |
bool & | bPositiveZComponent | ||
) |
void CRhinoDib::ConvertToNormalMap | ( | bool | bLossyCompressionSource, |
bool & | bPositiveZComponent | ||
) |
LPBITMAPINFO CRhinoDib::CopyDib | ( | ) | const |
Return copy of existing dib, you are responsible for destroying this object.
bool CRhinoDib::CopyDib | ( | const BITMAPINFO & | bmi | ) |
Copy bmi to m_bitmapinfo.
HBITMAP CRhinoDib::CopyHBitmap | ( | ) |
Return copy of the current Dib(). If Bitmap() is NULL then one is created from Dib() and returned. m_hBitmap is not set if Bitmap was NULL. You are responsible for destroying this object.
HBITMAP CRhinoDib::CopyHBitmap | ( | ) | const |
Return copy of the current Dib(). If Bitmap() is NULL then one is created from Dib() and returned. m_hBitmap is not set if Bitmap was NULL. You are responsible for destroying this object.
BOOL32 CRhinoDib::CopyToClipboard | ( | HWND | hwnd | ) | const |
Clipboard operations.
bool CRhinoDib::CopyToClipboard | ( | HWND | hwnd = nullptr | ) | const |
Clipboard operations.
bool CRhinoDib::CreateDib | ( | int | width, |
int | height, | ||
int | color_depth, | ||
bool | select_into_mem_dc = false , |
||
CPalette * | = NULL |
||
) |
DIB or HBITMAP creation functions.
LPBITMAPINFO CRhinoDib::CreateDib | ( | long | width, |
long | height, | ||
int | color_depth, | ||
bool | select_into_mem_dc = false , |
||
HPALETTE | = nullptr |
||
) |
DIB or HBITMAP creation functions.
HBITMAP CRhinoDib::CreateHBitmap | ( | HPALETTE | hpal = nullptr | ) |
Create HBITMAP and set m_hBitmap.
bool CRhinoDib::CreatePalette | ( | LPBITMAPINFO | ) |
BOOL32 CRhinoDib::DCSelectBitmap | ( | bool | ) |
don't know what this might do
void CRhinoDib::DestroyDib | ( | ) |
Destroy dib && hbitmap and zero out pointers.
void CRhinoDib::DestroyDib | ( | ) |
Destroy dib && hbitmap and zero out pointers.
double CRhinoDib::DPI | ( | ) | const |
double CRhinoDib::DPI | ( | ) | const |
BOOL32 CRhinoDib::Draw | ( | CDC * | pDC, |
CRect | rect, | ||
int | xSrc = 0 , |
||
int | ySrc = 0 |
||
) |
BOOL32 CRhinoDib::Draw | ( | CDC * | pDC, |
int | x = 0 , |
||
int | y = 0 , |
||
int | cx = 0 , |
||
int | cy = 0 , |
||
int | xSrc = 0 , |
||
int | ySrc = 0 |
||
) |
Blit functions functions.
bool CRhinoDib::DrawFilledCircle | ( | const ON_2iPoint & | center, |
int | radius, | ||
ON_Color | |||
) |
bool CRhinoDib::DrawFilledPolygon | ( | const ON_SimpleArray< ON_2iPoint > & | points, |
ON_Color | cr | ||
) |
Points are in DIB space - ie, the same coordinate system as GetPixel. Use FlipPoint/Flipped points to switch.
bool CRhinoDib::DrawFilledTriangle | ( | const ON_2iPoint & | p1, |
const ON_2iPoint & | p2, | ||
const ON_2iPoint & | p3, | ||
ON_Color | |||
) |
bool CRhinoDib::DrawLine | ( | const ON_2iPoint & | p1, |
const ON_2iPoint & | p2, | ||
ON_Color | color, | ||
int | thickness = 0 , |
||
bool | circle_caps = false |
||
) |
BOOL32 CRhinoDib::DrawMasked | ( | CDC * | pDC, |
COLORREF | crMask, | ||
CRect | rect, | ||
int | xSrc = 0 , |
||
int | ySrc = 0 |
||
) |
BOOL32 CRhinoDib::DrawMasked | ( | CDC * | pDC, |
COLORREF | crMask, | ||
int | x = 0 , |
||
int | y = 0 , |
||
int | cx = 0 , |
||
int | cy = 0 , |
||
int | xSrc = 0 , |
||
int | ySrc = 0 |
||
) |
bool CRhinoDib::DrawPolyline | ( | const ON_SimpleArray< ON_2iPoint > & | points, |
ON_Color | color, | ||
int | thickness = 0 , |
||
bool | circle_caps = false , |
||
bool | close = false |
||
) |
CFastPixelAccess* CRhinoDib::FastPixelAccess | ( | void | ) |
CFastPixelAccess* CRhinoDib::FastPixelAccess | ( | void | ) |
const CFastPixelAccess* CRhinoDib::FastPixelAccess | ( | void | ) | const |
const CFastPixelAccess* CRhinoDib::FastPixelAccess | ( | void | ) | const |
|
static |
Description: Call this method to get supported file type from file name. Parameters: lpsFileName - [in] File name, extension will be extracted from the end of this string and compared to supported bitmap file types. Returns: Returns a valid bitmap_file_type on success or unsupported_file_type if the file type is not supported.
|
static |
Description: Call this method to get supported file type from file name. Parameters: lpsFileName - [in] File name, extension will be extracted from the end of this string and compared to supported bitmap file types. Returns: Returns a valid bitmap_file_type on success or unsupported_file_type if the file type is not supported.
|
static |
Description: Call this method to see if a specified file type supports 32 bit bitmaps with alpha channel. Parameters: fileType - [in] Bitmap file type to check Returns: Returns a true if the bitmap can be saved as a 32 bit DIB with alpha channel.
|
static |
Description: Call this method to see if a specified file type supports 32 bit bitmaps with alpha channel. Parameters: fileType - [in] Bitmap file type to check Returns: Returns a true if the bitmap can be saved as a 32 bit DIB with alpha channel.
|
static |
Description: Call this method to see if a specified file (gets the type from the file extension) supports 32 bit bitmaps with alpha channel. Parameters: fileName - [in] Name of the file to extract the extension from. Returns: Returns a true if the bitmap can be saved as a 32 bit DIB with alpha channel.
|
static |
Description: Call this method to see if a specified file (gets the type from the file extension) supports 32 bit bitmaps with alpha channel. Parameters: fileName - [in] Name of the file to extract the extension from. Returns: Returns a true if the bitmap can be saved as a 32 bit DIB with alpha channel.
bool CRhinoDib::FillSolid | ( | COLORREF | ) |
Fills the entire dib with the specified color...Note: if it's a 32 bit dib, then the high-order byte of the passed in color is considered to be an alpha value, and thus will also be included in the fill operation (normal GDI operations will strip this out).
From RhinoSdkDib.h Fills the entire dib with the specified color...Note: if it's a 32 bit dib, then the high-order byte of the passed in color is considered to be an alpha value, and thus will also be included in the fill operation (normal GDI operations will strip this out).
LPBYTE CRhinoDib::FindDIBBits | ( | ) | const |
Description: Get Windows bitmap bits. Returns: A pointer to the bits. Look but do not change. See Also: CRhinoDib::BitmapInfo
LPBYTE CRhinoDib::FindDIBBits | ( | ComponentOrders | ) | const |
ON_2iPoint CRhinoDib::FlippedPoint | ( | const ON_2iPoint & | ) | const |
ON_SimpleArray<ON_2iPoint> CRhinoDib::FlippedPoints | ( | const ON_SimpleArray< ON_2iPoint > & | ) | const |
void CRhinoDib::FlipPoint | ( | ON_2iPoint & | ) | const |
Use these functions to transform points and arrays of points between DIB space (bottom up) and CDC space (top down)
void CRhinoDib::FlipPoints | ( | ON_SimpleArray< ON_2iPoint > & | ) | const |
void CRhinoDib::FlipVertical | ( | ) |
void CRhinoDib::FlipVertical | ( | void | ) |
bool CRhinoDib::FloodFill | ( | long | x, |
long | y, | ||
COLORREF | cr, | ||
int | traget_alpha = -1 |
||
) |
Goofy edit functions.
void CRhinoDib::GaussianBlurWithRadius | ( | double | radius | ) |
|
staticprotected |
|
staticprotected |
UINT CRhinoDib::GetDepth | ( | ) | const |
UINT CRhinoDib::GetDepth | ( | ) | const |
bool CRhinoDib::GetPixel | ( | const LPBYTE | dib_bits, |
int | color_depth, | ||
long | x, | ||
long | y, | ||
COLORREF & | cr, | ||
int & | alpha | ||
) | const |
Gets the RGB color of a pixel at an x,y location.
bool CRhinoDib::GetPixel | ( | const LPBYTE | dib_bits, |
int | color_depth, | ||
long | x, | ||
long | y, | ||
float & | r, | ||
float & | g, | ||
float & | b | ||
) | const |
Gets the fractional RGB color components (between 0.0 and 1.0) of a pixel at an x,y location.
bool CRhinoDib::GetPixel | ( | const LPBYTE | dib_bits, |
int | color_depth, | ||
long | x, | ||
long | y, | ||
float & | r, | ||
float & | g, | ||
float & | b, | ||
float & | alpha | ||
) | const |
bool CRhinoDib::GetPixel | ( | const LPBYTE | dib_bits, |
int | color_depth, | ||
long | x, | ||
long | y, | ||
int & | r, | ||
int & | g, | ||
int & | b | ||
) | const |
Gets the RGB color components (between 0 and 255) of a pixel at an x,y location.
bool CRhinoDib::GetPixel | ( | const LPBYTE | dib_bits, |
int | color_depth, | ||
long | x, | ||
long | y, | ||
int & | r, | ||
int & | g, | ||
int & | b, | ||
int & | alpha | ||
) | const |
BOOL32 CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
COLORREF & | cr | ||
) | const |
bool CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
COLORREF & | cr | ||
) | const |
Gets the RGB color of a pixel at an x,y location.
BOOL32 CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
COLORREF & | cr, | ||
int & | alpha | ||
) | const |
bool CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
COLORREF & | cr, | ||
int & | alpha | ||
) | const |
BOOL32 CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
float & | r, | ||
float & | g, | ||
float & | b | ||
) | const |
bool CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
float & | r, | ||
float & | g, | ||
float & | b | ||
) | const |
Gets the fractional RGB color components (between 0.0 and 1.0) of a pixel at an x,y location.
BOOL32 CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
float & | r, | ||
float & | g, | ||
float & | b, | ||
float & | alpha | ||
) | const |
bool CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
float & | r, | ||
float & | g, | ||
float & | b, | ||
float & | alpha | ||
) | const |
BOOL32 CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
int & | r, | ||
int & | g, | ||
int & | b | ||
) | const |
bool CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
int & | r, | ||
int & | g, | ||
int & | b | ||
) | const |
Gets the RGB color components (between 0 and 255) of a pixel at an x,y location.
BOOL32 CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
int & | r, | ||
int & | g, | ||
int & | b, | ||
int & | alpha | ||
) | const |
bool CRhinoDib::GetPixel | ( | long | x, |
long | y, | ||
int & | r, | ||
int & | g, | ||
int & | b, | ||
int & | alpha | ||
) | const |
bool CRhinoDib::GetPixel | ( | unsigned char * | base, |
int | x, | ||
unsigned char * | r, | ||
unsigned char * | g, | ||
unsigned char * | b | ||
) |
bool CRhinoDib::GetPixel | ( | unsigned char * | base, |
long | x, | ||
unsigned char * | r, | ||
unsigned char * | g, | ||
unsigned char * | b | ||
) | const |
|
inline |
DWORD CRhinoDib::GetStorageSize | ( | ) | const |
UINT CRhinoDib::GetStorageWidth | ( | ) | const |
DWORD CRhinoDib::GetStorageWidth | ( | ) | const |
UINT CRhinoDib::GLDataType | ( | ) | const |
e.g. GL_UNSIGNED_BYTE
|
static |
|
static |
UINT CRhinoDib::GLPixelFormat | ( | ) | const |
OpenGL attributes for this image.
e.g. GL_RGBA
bool CRhinoDib::GradientFill | ( | COLORREF | topLeft, |
COLORREF | topRight, | ||
COLORREF | bottomLeft, | ||
COLORREF | bottomRight | ||
) |
int CRhinoDib::Height | ( | ) | const |
long CRhinoDib::Height | ( | ) | const |
bool CRhinoDib::IncreaseColorDepth | ( | int | nNewColorDepth | ) |
If color depth is less than the requested color depth create a new bitmap of the desired color depth and copy old bits to it
bool CRhinoDib::IncreaseColorDepth | ( | int | nNewColorDepth | ) |
If color depth is less than the requested color depth create a new bitmap of the desired color depth and copy old bits to it Change of behavior in V6 - if the new color depth is 32, the alpha pixels will be filled with 255.
bool CRhinoDib::IsAllocated | ( | ) | const |
Call this to ensure there is memory allocated. Replace calls to check FindDIBBits() for nullptr with this.
bool CRhinoDib::IsAllocated | ( | ) | const |
bool CRhinoDib::IsNormalMap | ( | bool | bLossyCompressionSource, |
bool & | bPositiveZComponent | ||
) | const |
Description: Call this method to see if the DIB appears to be a normal map. Parameters: bLossyCompressionSource - [in] True if the source of the bitmap is an image with lossy compression (e.g. jpg). False otherwise. The check will be less strict if the image can contain errors due to lossy compression. bPositiveZComponent - [out] True if the image is a normal map with the z-component mapped to the range 0 .. +1. False if the image is a normal map with the z-component mapped to the range -1 .. +1. Returns: Returns true if the bitmap appears to be a normal map. False otherwise.
bool CRhinoDib::IsNormalMap | ( | bool | bLossyCompressionSource, |
bool & | bPositiveZComponent | ||
) | const |
Description: Call this method to see if the DIB appears to be a normal map. Parameters: bLossyCompressionSource - [in] True if the source of the bitmap is an image with lossy compression (e.g. jpg). False otherwise. The check will be less strict if the image can contain errors due to lossy compression. bPositiveZComponent - [out] True if the image is a normal map with the z-component mapped to the range 0 .. +1. False if the image is a normal map with the z-component mapped to the range -1 .. +1. Returns: Returns true if the bitmap appears to be a normal map. False otherwise.
bool CRhinoDib::IsNormalMap | ( | void | ) | const |
Description: Call this method to see if the DIB appears to be a normal map. Returns: Returns true if the bitmap appears to be a normal map. False otherwise.
bool CRhinoDib::IsNormalMap | ( | void | ) | const |
Description: Call this method to see if the DIB appears to be a normal map. Returns: Returns true if the bitmap appears to be a normal map. False otherwise.
const wchar_t* CRhinoDib::LastSaveName | ( | ) | const |
const wchar_t* CRhinoDib::LastSaveName | ( | ) | const |
|
protected |
void CRhinoDib::MakeOpaque | ( | ) |
convert all partially transparent pixels to fully opaque
void CRhinoDib::MakeOpaque | ( | void | ) |
|
protectedvirtual |
long CRhinoDib::NumColors | ( | ) | const |
int CRhinoDib::NumColors | ( | ) | const |
CRhinoDib::operator CDC * | ( | ) |
CRhinoDib::operator CDC * | ( | ) | const |
CRhinoDib::operator HBITMAP | ( | ) |
CRhinoDib::operator HBITMAP | ( | ) | const |
Copy source bitmap, if m_hBitmap is non NULL then create destroy current and create new hBitmap
Copy source bitmap, if m_hBitmap is non NULL then create destroy current and create new hBitmap
CRhinoDib& CRhinoDib::operator= | ( | HBITMAP | hBitmap | ) |
CPalette* CRhinoDib::Palette | ( | ) | const |
HPALETTE CRhinoDib::Palette | ( | ) | const |
long CRhinoDib::PaletteSize | ( | ) | const |
long CRhinoDib::PaletteSize | ( | ) | const |
bool CRhinoDib::PasteFromClipboard | ( | HWND | hwnd, |
bool | bMustBeSameSize = true , |
||
bool | bMustHaveSameColorDepth = true |
||
) | const |
UINT CRhinoDib::PelsPerMeter | ( | ) | const |
UINT CRhinoDib::PelsPerMeter | ( | ) | const |
bool CRhinoDib::Print | ( | HWND | hWnd = 0 , |
bool | bFitToPage = true |
||
) |
Description: Display print dialog Parameters: hWnd - [in] Parent window for print dialog. If NULL will use Rhino frame window. Returns: true - DIB sent to printer false - Print dialog canceled or error writing to printer.
ON_DEPRECATED bool CRhinoDib::Print | ( | HWND | hWnd = nullptr , |
bool | bFitToPage = true |
||
) |
Description: Display print dialog Parameters: hWnd - [in] Parent window for print dialog. If NULL will use Rhino frame window. Returns: true - DIB sent to printer false - Print dialog canceled or error writing to printer.
class CRhDibPrivate& CRhinoDib::Private | ( | void | ) |
const class CRhDibPrivate& CRhinoDib::Private | ( | void | ) | const |
bool CRhinoDib::ProcessPixels | ( | bool(*)(const Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) | const |
bool CRhinoDib::ProcessPixels | ( | bool(*)(const Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) | const |
bool CRhinoDib::ProcessPixels | ( | bool(*)(Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) |
Pixel iterators with an interrupt. Return false in the callback function to interrupt the loops. Current implementation is not multithreaded, but this may change.
bool CRhinoDib::ProcessPixels | ( | bool(*)(Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) |
Pixel iterators with an interrupt. Return false in the callback function to interrupt the loops.
Current implementation is not multithreaded, but this may change.
void CRhinoDib::ProcessPixels | ( | void(*)(const Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) | const |
void CRhinoDib::ProcessPixels | ( | void(*)(const Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) | const |
void CRhinoDib::ProcessPixels | ( | void(*)(Pixel &, const void *pvData) | f, |
const void * | pvData = nullptr |
||
) |
void CRhinoDib::ProcessPixels | ( | void(*)(Pixel &, const void *pvData) | f, |
const void * | pvData = nullptr |
||
) |
void CRhinoDib::ProcessPixels | ( | void(*)(Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) |
Fast pixel iterators. Quick access to the image data for each pixel, multi-threaded. Use the pixel setter provided to quickly set pixel values.
void CRhinoDib::ProcessPixels | ( | void(*)(Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) |
Fast pixel iterators. Quick access to the image data for each pixel, multi-threaded. Use the pixel setter provided to quickly set pixel values.
void CRhinoDib::ProcessPixels_SingleThreaded | ( | void(*)(const Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) | const |
void CRhinoDib::ProcessPixels_SingleThreaded | ( | void(*)(const Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) | const |
void CRhinoDib::ProcessPixels_SingleThreaded | ( | void(*)(Pixel &, const void *pvData) | f, |
const void * | pvData = nullptr |
||
) |
void CRhinoDib::ProcessPixels_SingleThreaded | ( | void(*)(Pixel &, const void *pvData) | f, |
const void * | pvData = nullptr |
||
) |
void CRhinoDib::ProcessPixels_SingleThreaded | ( | void(*)(Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) |
void CRhinoDib::ProcessPixels_SingleThreaded | ( | void(*)(Pixel &, void *pvData) | f, |
void * | pvData = nullptr |
||
) |
CRhinoCommand::result CRhinoDib::ReadFile | ( | HWND | hWnd = nullptr , |
bool | bUseDialogs = true |
||
) |
Description: Display Rhino bitmap open dialog prompting for name then read bitmap from disk. Parameters: hWnd - [in] Parent window for file dialog. If NULL will use Rhino frame window. bUseDialogs - [in] If true then display file dialog otherwise prompt for name on command line. Returns: CRhinoCommand::result::cancel - The file dialog or script was canceled. CRhinoCommand::result::failure - Error reading the file. CRhinoCommand::result::success - The file was read successfully
CRhinoCommand::result CRhinoDib::ReadFile | ( | unsigned int | doc_serial_number, |
HWND | hWnd = nullptr , |
||
bool | bUseDialogs = true |
||
) |
Description: Display Rhino bitmap open dialog prompting for name then read bitmap from disk. Parameters: doc_serial_number - [in] CRhinoDoc runtime serial number for searches. hWnd - [in] Parent window for file dialog. If NULL will use Rhino frame window. bUseDialogs - [in] If true then display file dialog otherwise prompt for name on command line. Returns: CRhinoCommand::result::cancel - The file dialog or script was canceled. CRhinoCommand::result::failure - Error reading the file. CRhinoCommand::result::success - The file was read successfully
bool CRhinoDib::ReadFromFile | ( | const wchar_t * | lpsFileName | ) |
Description: Read bitmap from disk. Parameters: lpsFileName - [in] Name of file to read. Uses CRhinoFileUtilities::FindFile(...) to validate file name. Returns: true - File was read from disk. false - Error reading file or invalid file type.
bool CRhinoDib::ReadFromFile | ( | const wchar_t * | lpsFileName | ) |
Description: Read bitmap from disk. Parameters: lpsFileName - [in] Name of file to read. Uses CRhinoFileUtilities::FindFile(...) to validate file name. Returns: true - File was read from disk. false - Error reading file or invalid file type.
bool CRhinoDib::ReadFromFile | ( | HWND | hWnd = 0 , |
bool | bUseDialogs = true |
||
) |
Description: Display Rhino bitmap open dialog prompting for name then read bitmap from disk. Parameters: hWnd - [in] Parent window for file dialog. If NULL will use Rhino frame window. bUseDialogs - [in] If true then display file dialog otherwise prompt for name on command line. Returns: true - File name specified and written to disk. false - File dialog canceled or error writing file.
bool CRhinoDib::ReadFromFile | ( | HWND | hWnd = nullptr , |
bool | bUseDialogs = true |
||
) |
Description: Display Rhino bitmap open dialog prompting for name then read bitmap from disk. Parameters: hWnd - [in] Parent window for file dialog. If NULL will use Rhino frame window. bUseDialogs - [in] If true then display file dialog otherwise prompt for name on command line. Returns: true - File name specified and written to disk. false - File dialog canceled or error reading file.
bool CRhinoDib::ReadFromFile | ( | unsigned int | doc_serial_number, |
const wchar_t * | lpsFileName | ||
) |
Description: Read bitmap from disk. Parameters: lpsFileName - [in] Name of file to read. Uses CRhinoFileUtilities::FindFile(...) to validate file name. doc_serial_number - [in] Runtime serial number of the CRhinoDoc to be used for image searches Returns: true - File was read from disk. false - Error reading file or invalid file type.
bool CRhinoDib::ReadFromFile | ( | unsigned int | doc_serial_number, |
const wchar_t * | lpsFileName | ||
) |
Description: Read bitmap from disk. Parameters: doc_serial_number - [in] Runtime serial number of the CRhinoDoc to be used for image searches. lpsFileName - [in] Name of file to read. Uses CRhinoFileUtilities::FindFile(...) to validate the file name. Returns: true - File was read from disk. false - Error reading file or invalid file type.
bool CRhinoDib::ReadFromFile | ( | unsigned int | doc_serial_number, |
HWND | hWnd = nullptr , |
||
bool | bUseDialogs = true |
||
) |
Description: Display Rhino bitmap open dialog prompting for name then read bitmap from disk. Parameters: doc_serial_number - [in] CRhinoDoc::RuntimeSerialNumber to use for searches. hWnd - [in] Parent window for file dialog. If NULL will use Rhino frame window. bUseDialogs - [in] If true then display file dialog otherwise prompt for name on command line. Returns: true - File name specified and written to disk. false - File dialog canceled or error reading file.
|
static |
Description: Reads image size, dots per inch and bit depth from a file. Parameters: file_name - [in] Name of file to read. Uses CRhinoFileUtilities::FindFile(...) to validate file name.
image_width_pixels - [out] image_height_pixels - [out] The dimensions of the image are returned in the pixels parameters.
image_width_dpi - [out] image_height_dpi - [out] The dots per inch values saved in the image file are returned in the dpi parameters.
image_depth_bits - [out] The bit depth of the image is returned here (e.g., 24 for RGB, 32 for RGBA).
You can pass null for any [out] parameters that are not required. Returns: true - File was read from disk. false - Error reading file or invalid file type.
|
static |
Description: Read bitmap image size from disk. Parameters: lpsFileName - [in] Name of file to read. Uses CRhinoFileUtilities::FindFile(...) to validate file name.
image_width_pixels - [out] image_height_pixels - [out] The sizes of the image are returned in the pixels parameters.
image_width_dpi - [out] image_height_dpi - [out] The dots per inch values saved in the image file are returned in the dpi parameters. Returns: true - File was read from disk. false - Error reading file or invalid file type.
|
static |
Description: Read image size and dots per inch from disk. Parameters: lpsFileName - [in] Name of file to read. Uses CRhinoFileUtilities::FindFile(...) to validate file name.
image_width_pixels - [out] image_height_pixels - [out] The dimensions of the image are returned in the pixels parameters.
image_width_dpi - [out] image_height_dpi - [out] The dots per inch values saved in the image file are returned in the dpi parameters.
You can pass null for any [out] parameters that are not required. Returns: true - File was read from disk. false - Error reading file or invalid file type.
bool CRhinoDib::ReadFromMemory | ( | const void * | buffer, |
int | sizeof_buffer | ||
) |
Description: Read bitmap from a memory buffer. Parameters: buffer - [in] sizeof_buffer - [in] number of bytes in the buffer Returns: true - Image was read from buffer false - Error reading buffer
bool CRhinoDib::ReadFromMemory | ( | const void * | buffer, |
size_t | sizeof_buffer | ||
) |
Description: Read bitmap from a memory buffer. Parameters: buffer - [in] sizeof_buffer - [in] number of bytes in the buffer Returns: true - Image was read from buffer false - Error reading buffer
bool CRhinoDib::ReadFromSvgData | ( | const ON_wString & | svg, |
int | width, | ||
int | height, | ||
bool | convert_to_darkmode = false |
||
) |
Description: Converts an SVG definition to a bitmap.
Parameters: svg - [in] The textual definition of the SVG image. width - [in] The required width of the bitmap. height - [in] The required height of the bitmap. convert_to_darkmode - [in] If true, the image will be processed to make it suitable for display in dark mode.
Returns: True if successful, else false.
bool CRhinoDib::Resize | ( | const ON_2iSize & | newSize | ) |
Legacy resize method; uses Bilinear resampling.
bool CRhinoDib::Resize | ( | const ON_2iSize & | newSize, |
ResampleAlgorithm | alg | ||
) |
New resize method; uses chosen resampling algorithm.
void CRhinoDib::Resize | ( | int | newWidth, |
int | newHeight | ||
) |
Legacy resized method; uses Bilinear resampling.
bool CRhinoDib::Resized | ( | const CRhinoDib & | input, |
const ON_2iSize & | newSize, | ||
ResampleAlgorithm | alg | ||
) |
New resized method; uses chosen resampling algorithm.
bool CRhinoDib::ReuseDib | ( | int | width, |
int | height, | ||
int | depth, | ||
bool | select_into_mem_dc | ||
) |
bool CRhinoDib::ReuseDib | ( | long | width, |
long | height, | ||
int | color_depth, | ||
bool | select_into_mem_dc | ||
) |
unsigned int CRhinoDib::RuntimeSerialNumber | ( | ) | const |
unsigned int CRhinoDib::RuntimeSerialNumber | ( | ) | const |
long CRhinoDib::ScanWidth | ( | ) | const |
DWORD CRhinoDib::ScanWidth | ( | ) | const |
void CRhinoDib::SetBitmap | ( | CGImageRef | ) |
bool CRhinoDib::SetBitmap | ( | HBITMAP | hBitmap | ) |
Create dib from hBitmap, if dib created successfully m_hBitmap is set to a new HBITMAP created from Dib()
void CRhinoDib::SetBitmap | ( | HBITMAP | ) |
BOOL32 CRhinoDib::SetDib | ( | LPBITMAPINFO | lpbmi, |
bool | free_lpbmi = true |
||
) |
Destroy existing m_bitmapinfo and m_hBitmap, set them to specified dib. If Bitmap() was non NULL then a new HBITMAP is created from the new dib
bool CRhinoDib::SetDib | ( | LPBITMAPINFO | lpbmi, |
bool | free_lpbmi = true |
||
) |
Destroy existing m_bitmapinfo and m_hBitmap, set them to specified dib. If Bitmap() was non NULL then a new HBITMAP is created from the new dib
void CRhinoDib::SetDPI | ( | double | ) |
void CRhinoDib::SetDPI | ( | double | ) |
void CRhinoDib::SetLastSaveName | ( | const wchar_t * | ) |
void CRhinoDib::SetLastSaveName | ( | const wchar_t * | ) |
void CRhinoDib::SetPelsPerMeter | ( | UINT | ) |
void CRhinoDib::SetPelsPerMeter | ( | UINT | ) |
BOOL32 CRhinoDib::SetPixel | ( | long | x, |
long | y, | ||
COLORREF | cr, | ||
int | alpha = -1 |
||
) |
bool CRhinoDib::SetPixel | ( | long | x, |
long | y, | ||
COLORREF | cr, | ||
int | alpha = -1 |
||
) |
Sets the color of a pixel at an x,y location given an RGB color.
BOOL32 CRhinoDib::SetPixel | ( | long | x, |
long | y, | ||
float | r, | ||
float | g, | ||
float | b, | ||
float | alpha = -1.0 |
||
) |
Functions call FindDIBBits and validate x and y.
bool CRhinoDib::SetPixel | ( | long | x, |
long | y, | ||
float | r, | ||
float | g, | ||
float | b, | ||
float | alpha = -1.0 |
||
) |
Sets the color of a pixel at an x,y location given a fractional RGB color components (between 0.0 and 1.0)
These "safe" functions call CRhinoDib::FindDIBBits and validate x and y
BOOL32 CRhinoDib::SetPixel | ( | long | x, |
long | y, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | alpha = -1 |
||
) |
bool CRhinoDib::SetPixel | ( | long | x, |
long | y, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | alpha = -1 |
||
) |
Sets the color of a pixel at an x,y location given an RGB color components (between 0 and 255)
bool CRhinoDib::SetPixel | ( | LPBYTE | dib_bits, |
int | color_depth, | ||
long | x, | ||
long | y, | ||
COLORREF | cr, | ||
int | alpha = -1 |
||
) |
Sets the color of a pixel at an x,y location given an RGB color.
bool CRhinoDib::SetPixel | ( | LPBYTE | dib_bits, |
int | color_depth, | ||
long | x, | ||
long | y, | ||
float | r, | ||
float | g, | ||
float | b, | ||
float | alpha = -1.0 |
||
) |
Sets the color of a pixel at an x,y location given a fractional RGB color components (between 0.0 and 1.0)
These "unsafe" functions assume the DIB bits are valid and assume x and y are within range
bool CRhinoDib::SetPixel | ( | LPBYTE | dib_bits, |
int | color_depth, | ||
long | x, | ||
long | y, | ||
int | r, | ||
int | g, | ||
int | b, | ||
int | alpha = -1 |
||
) |
Sets the color of a pixel at an x,y location given an RGB color components (between 0 and 255)
CRhinoDib* CRhinoDib::ShiftDown | ( | ) |
shift a dib down by one pixel - wraps other side around only works on a 24 and 32 bit dibs right now. note that since a DIB is flipped in y from what you'd expect, the guts of this does what you'd usually think to do to shift it up by one pixel
CRhinoDib* CRhinoDib::ShiftLeft | ( | ) |
shift a dib left by one pixel - wraps other side around only works on a 24 and 32 bit dibs right now.
CRhinoDib* CRhinoDib::ShiftRight | ( | ) |
shift a dib right by one pixel - wraps other side around only works on a 24 and 32 bit dibs right now.f
CRhinoDib* CRhinoDib::ShiftUp | ( | ) |
shift a dib up by one pixel - wraps other side around only works on a 24 and 32 bit dibs right now. note that since a DIB is flipped in y from what you'd expect, the guts of this does what you'd usually think to do to shift it down by one pixel
long CRhinoDib::Size | ( | ) | const |
Bitmap information.
DWORD CRhinoDib::Size | ( | ) | const |
Bitmap information.
long CRhinoDib::SizeBits | ( | ) | const |
DWORD CRhinoDib::SizeBits | ( | ) | const |
long CRhinoDib::SizeHeader | ( | ) | const |
long CRhinoDib::SizeHeader | ( | ) | const |
BOOL32 CRhinoDib::StretchBlt | ( | int | x, |
int | y, | ||
int | nWidth, | ||
int | nHeight, | ||
const CRhinoDib * | srcDC, | ||
int | xSrc, | ||
int | ySrc, | ||
int | nSrcWidth, | ||
int | nSrcHeight, | ||
int | mode | ||
) |
void CRhinoDib::SwapRedAndBlueSamples | ( | ) |
exchange the red and blue color bytes in the NSBitmapImageRep
ON_WindowsBitmap CRhinoDib::ToON_WindowsBitmap | ( | void | ) | const |
ON_WindowsBitmap* CRhinoDib::ToOnWindowsBitmap | ( | ) | const |
Description: Call this method to convert this bitmap to a ON_WindowsBitmap pointer, you should NEVER call ON_WindowsBitmap(BitmapInfo()) as it assumes the BITMAPINFO is a contiguous block of memory for the bitmap and its color table. CRhinoDib will rarely represent a contiguous block of memory and will cause the ON_WindowsBitamp constructor to crash when attempting to copy the bitmap bits. Returns: A pointer to a new ON_WindowsBitmap, the caller is responsible for deleting the returned pointer.
int CRhinoDib::Width | ( | ) | const |
long CRhinoDib::Width | ( | ) | const |
long CRhinoDib::WidthInBytes | ( | ) | const |
DWORD CRhinoDib::WidthInBytes | ( | ) | const |
long CRhinoDib::WindowYtoDibY | ( | long | y | ) | const |
Convert Y value from window display Y to bitmap Y.
CRhinoCommand::result CRhinoDib::WriteFile | ( | HWND | hWnd = nullptr , |
bool | bUseDialogs = true , |
||
Quality | q = Quality::kHigh |
||
) | const |
Description: Prompt user for the name of the bitmap file to save then write the bitmap file. Parameters: hWnd - [in] Parent window of the file dialog. bUseDialogs - [in] If true then the file dialog is displayed otherwise; the user is prompted on the command line for a file name. q [in] Returns: CRhinoCommand::result::cancel - The file dialog or script was canceled. CRhinoCommand::result::failure - Error writing the bitmap file. CRhinoCommand::result::success - The file was written successfully.
bool CRhinoDib::WriteToFile | ( | const wchar_t * | lpsFileName, |
Quality | q = Quality::kHigh |
||
) | const |
Description: Write bitmap to disk. Parameters: lpsFileName - [in] Name of file to write. Returns: true - Specified File name written to disk. false - Error writing file or invalid file type.
bool CRhinoDib::WriteToFile | ( | const wchar_t * | lpsFileName, |
Quality | q = Quality::kHigh |
||
) | const |
Description: Write bitmap to disk. Parameters: lpsFileName - [in] Name of file to write. Returns: true - Specified File name written to disk. false - Error writing file or invalid file type.
bool CRhinoDib::WriteToFile | ( | HWND | hWnd = 0 , |
bool | bUseDialogs = true , |
||
Quality | q = Quality::kHigh |
||
) | const |
bool CRhinoDib::WriteToFile | ( | HWND | hWnd = nullptr , |
bool | bUseDialogs = true , |
||
Quality | q = Quality::kHigh |
||
) | const |
Description: Prompt user for the name of the bitmap file to save then write the bitmap file. Parameters: hWnd - [in] Parent window of the file dialog. bUseDialogs - [in] If true then the file dialog is displayed otherwise; the user is prompted on the command line for a file name. q [in] Returns: Returns true if a file name was supplied and the file was written successfully.
|
friend |
|
friend |
|
friend |
|
friend |
friend void Combine(const CRhinoDib&, CRhinoDib&, const float*, float*);
|
friend |
|
friend |
|
friend |
|
friend |
friend class CRhinoZBuffer; friend class CRhinoRenderOverlays;
|
friend |
|
friend |
|
friend |
This is a list of the badly behaved.
|
friend |
|
friend |
|
friend |
|
friend |
friend CRhinoDib* RhinoCreateAnaglyph(const CRhinoDib&, const CRhinoDib&,const int); friend void ConvertDepthToImage(CRhinoDib&, bool);
|
friend |
Description: Updates the given cached texture's contents with the contents of the passed in Dib. Note: If the resolution of the Dib is not the same as the cached texture's, then a new cached texture will be created in its place, re-using the same cached handle. For performance purposes, it is recommended that you try to manage using matching resolutions when updating cached textures.
Parameters: hTexture - handle to a valid cached texture (obtained by calling GetCachedTexture()) Dib - Image contents used to update the cached texture's contents.
Returns: True - if/when the updating of the cached texture succeeds. False - if/when something failed during the update process.
|
friend |
|
protected |
|
protected |
This Mac-only CDC points at ourself. We deliberately use an instantiated CDC object rather than using the Windows m_pDC so the two very different CDC implementations (Mac and Windows) do not collide and the Mac CDC cannot be deleted independently of this DIB.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
mutableprotected |