Class BitmapExtension
Bitmap 관련 정적 클래스입니다.
Inheritance
object
BitmapExtension
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: SaigeVision.Net.V2.Extensions
Assembly: SaigeVision.Net.V2.dll
Syntax
public static class BitmapExtension
Methods
View SourceBitmapToPointerWithoutPadding(Bitmap)
Bitmap 이미지에서 padding정보를 제거한 후 IntPtr값으로 받아옵니다
Declaration
public static IntPtr BitmapToPointerWithoutPadding(Bitmap bmp)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | bmp | Bitmap 이미지 |
Returns
| Type | Description |
|---|---|
| IntPtr | padding 제거한 Intptr 정보 |
ByteArrayToBitmapWithPadding(byte[], int, int, int)
byte 배열을 통하여 Bitmap을 생성
Declaration
public static Bitmap ByteArrayToBitmapWithPadding(byte[] byteArray, int width, int height, int channel)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | byteArray | Bitmap byte 배열 |
| int | width | 이미지 가로 사이즈 |
| int | height | 이미지 세로 사이즈 |
| int | channel | 이미지 채널 |
Returns
| Type | Description |
|---|---|
| Bitmap | 결과 Bitmap |
DisposeIntPtr(IntPtr)
Declaration
public static void DisposeIntPtr(IntPtr ptr)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | ptr |
GetChannel(Bitmap)
PixelFormat 값을 입력하면 그에 맞는 channel 정보를 가져오는 기능
Declaration
public static int GetChannel(Bitmap bmp)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | bmp | 채널수를 알려고 하는 bitmap |
Returns
| Type | Description |
|---|---|
| int | channel 정보 |
GetImageTypeFlag(PixelFormat)
Declaration
public static ImageTypeFlags GetImageTypeFlag(PixelFormat pixelFormat)
Parameters
| Type | Name | Description |
|---|---|---|
| PixelFormat | pixelFormat |
Returns
| Type | Description |
|---|---|
| ImageTypeFlags |
GetPixelFormat(ImageTypeFlags)
Declaration
public static PixelFormat GetPixelFormat(ImageTypeFlags imageData)
Parameters
| Type | Name | Description |
|---|---|---|
| ImageTypeFlags | imageData |
Returns
| Type | Description |
|---|---|
| PixelFormat |
GetPixelFormat(int)
이미지 channel 값을 넣으면 적절한 PixelFormat으로 변경해주는 기능
Declaration
public static PixelFormat GetPixelFormat(int channel)
Parameters
| Type | Name | Description |
|---|---|---|
| int | channel | Channel 정보 (1,3,4 중 하나 입력) |
Returns
| Type | Description |
|---|---|
| PixelFormat | 채널에 맞는 적절한 PixelFormat |
PointerToByteArray(IntPtr, int)
IntPtr에서 byte 배열로 값을 가져오는 함수
Declaration
public static byte[] PointerToByteArray(IntPtr intPtr, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | intPtr | 값을 가져올 IntPtr |
| int | length | 값을 가져올 길이 설정 |
Returns
| Type | Description |
|---|---|
| byte[] | 결과로 받는 byte 배열 |
PointerToFloatArray(IntPtr, int)
IntPtr에서 float 배열로 값을 가져오는 함수
Declaration
public static float[] PointerToFloatArray(IntPtr intPtr, int length)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | intPtr | 값을 가져올 IntPtr |
| int | length | 값을 가져올 길이 설정 |
Returns
| Type | Description |
|---|---|
| float[] | 결과로 받는 float 배열 |
SetPalleteGrayscale(Bitmap)
Bitmap에서 palette 정보를 grayscale로 변경해 주는 기능
Declaration
public static void SetPalleteGrayscale(Bitmap bmp)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | bmp | pallete 정보를 변경하려는 bitmap 정보 |
SetPalleteHeatmap(Bitmap)
Bitmap에서 palette 정보를 heatmap으로 변경해 주는 기능
Declaration
public static void SetPalleteHeatmap(Bitmap bmp)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | bmp | pallete 정보를 변경하려는 bitmap 정보 |
SwapRGB(byte[], int)
Declaration
public static byte[] SwapRGB(byte[] pixels, int channel)
Parameters
| Type | Name | Description |
|---|---|---|
| byte[] | pixels | |
| int | channel |
Returns
| Type | Description |
|---|---|
| byte[] |
SwapRGB(IntPtr, int, int, int, int)
RGB 중 R,B의 순서를 변경하는 기능
Declaration
public static IntPtr SwapRGB(IntPtr ptr, int width, int height, int channel, int type)
Parameters
| Type | Name | Description |
|---|---|---|
| IntPtr | ptr | Bitmap의 IntPtr 정보 |
| int | width | Width |
| int | height | Height |
| int | channel | Channel |
| int | type | 8bit or 16bit |
Returns
| Type | Description |
|---|---|
| IntPtr | R,B 순서가 변경된 IntPtr 정보 |
ToBitmap(Size, int, int, byte[])
Declaration
public static Bitmap ToBitmap(Size size, int stride, int channel, byte[] serializedData)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | size | |
| int | stride | |
| int | channel | |
| byte[] | serializedData |
Returns
| Type | Description |
|---|---|
| Bitmap |
ToBitmap(Size, int, int, IntPtr)
Declaration
public static Bitmap ToBitmap(Size size, int stride, int channel, IntPtr data)
Parameters
| Type | Name | Description |
|---|---|---|
| Size | size | |
| int | stride | |
| int | channel | |
| IntPtr | data |
Returns
| Type | Description |
|---|---|
| Bitmap |
ToBitmap(string)
Declaration
public static Bitmap ToBitmap(string imagePath)
Parameters
| Type | Name | Description |
|---|---|---|
| string | imagePath |
Returns
| Type | Description |
|---|---|
| Bitmap |
ToRGB(Bitmap)
Clone을 통한 24bit Rgb 이미지로 변환
Declaration
public static Bitmap ToRGB(Bitmap bmp)
Parameters
| Type | Name | Description |
|---|---|---|
| Bitmap | bmp |
Returns
| Type | Description |
|---|---|
| Bitmap |