C# 클래스 CSharpImageLibrary.ImageFormats

Provides format functionality
파일 보기 프로젝트 열기: KFreon/CSharpImageLibrary 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
SaveUnsupported List

공개 메소드들

메소드 설명
DetermineImageType ( Stream imgData ) : SupportedExtensions

Determines image type via headers. Keeps stream position.

FindFormatInString ( string stringWithFormatInIt ) : ImageEngineFormat

Searches for a format within a string. Good for automatic file naming.

GetBlockSize ( ImageEngineFormat format ) : int

Gets block size of DDS format. Number of channels if not compressed. 1 if not a DDS format.

GetCompressedSize ( int numMipmaps, ImageEngineFormat format, int width, int height ) : int

Calculates the compressed size of an image with given parameters.

GetExtensionOfFormat ( ImageEngineFormat format ) : string

Gets file extension of supported surface formats. Doesn't include preceding dot.

GetSupportedExtensions ( bool addDot = false ) : List

Get list of supported extensions in lower case.

GetSupportedExtensionsDescriptions ( ) : List

Get descriptions of supported images. Generally the description as would be seen in a SaveFileDialog.

GetSupportedExtensionsForDialogBox ( ) : List

Get list of filter strings for dialog boxes of the Supported Images.

GetSupportedExtensionsForDialogBoxAsString ( ) : string

Gets list of filter strings for dialog boxes already formatted as string.

GetUncompressedSize ( int topWidth, int topHeight, int numChannels, bool inclMips ) : int

Gets uncompressed size of image with mipmaps given dimensions and number of channels. Assume 8 bits per channel.

IsAlphaPresent ( System.Windows.Media.PixelFormat format ) : bool

Determines if alpha channel COULD be present in given format.

IsBlockCompressed ( ImageEngineFormat format ) : bool

Determines if format is a block compressed format.

IsExtensionSupported ( string filePath, List supported = null ) : bool

Determines if file has a supported extension.

IsFormatMippable ( ImageEngineFormat format ) : bool

Determines if given format supports mipmapping.

MaxNumberOfChannels ( ImageEngineFormat format ) : int

Gets maximum number of channels a format can contain. NOTE: This likely isn't actually the max number. i.e. None exceed four, but some are only one or two channels.

ParseExtension ( string extension ) : SupportedExtensions

Gets file extension from string of extension.

메소드 상세

DetermineImageType() 공개 정적인 메소드

Determines image type via headers. Keeps stream position.
public static DetermineImageType ( Stream imgData ) : SupportedExtensions
imgData Stream Image data, incl header.
리턴 SupportedExtensions

FindFormatInString() 공개 정적인 메소드

Searches for a format within a string. Good for automatic file naming.
public static FindFormatInString ( string stringWithFormatInIt ) : ImageEngineFormat
stringWithFormatInIt string String containing format somewhere in it.
리턴 ImageEngineFormat

GetBlockSize() 공개 정적인 메소드

Gets block size of DDS format. Number of channels if not compressed. 1 if not a DDS format.
public static GetBlockSize ( ImageEngineFormat format ) : int
format ImageEngineFormat DDS format to test.
리턴 int

GetCompressedSize() 공개 정적인 메소드

Calculates the compressed size of an image with given parameters.
public static GetCompressedSize ( int numMipmaps, ImageEngineFormat format, int width, int height ) : int
numMipmaps int Number of mipmaps in image. JPG etc only have 1.
format ImageEngineFormat Format of image.
width int Width of image (top mip if mip-able)
height int Height of image (top mip if mip-able)
리턴 int

GetExtensionOfFormat() 공개 정적인 메소드

Gets file extension of supported surface formats. Doesn't include preceding dot.
public static GetExtensionOfFormat ( ImageEngineFormat format ) : string
format ImageEngineFormat Format to get file extension for.
리턴 string

GetSupportedExtensions() 공개 정적인 메소드

Get list of supported extensions in lower case.
public static GetSupportedExtensions ( bool addDot = false ) : List
addDot bool Adds preceeding dot to be same as Path.GetExtension.
리턴 List

GetSupportedExtensionsDescriptions() 공개 정적인 메소드

Get descriptions of supported images. Generally the description as would be seen in a SaveFileDialog.
public static GetSupportedExtensionsDescriptions ( ) : List
리턴 List

GetSupportedExtensionsForDialogBox() 공개 정적인 메소드

Get list of filter strings for dialog boxes of the Supported Images.
public static GetSupportedExtensionsForDialogBox ( ) : List
리턴 List

GetSupportedExtensionsForDialogBoxAsString() 공개 정적인 메소드

Gets list of filter strings for dialog boxes already formatted as string.
public static GetSupportedExtensionsForDialogBoxAsString ( ) : string
리턴 string

GetUncompressedSize() 공개 정적인 메소드

Gets uncompressed size of image with mipmaps given dimensions and number of channels. Assume 8 bits per channel.
public static GetUncompressedSize ( int topWidth, int topHeight, int numChannels, bool inclMips ) : int
topWidth int Width of top mipmap.
topHeight int Height of top mipmap.
numChannels int Number of channels in image.
inclMips bool Include size of mipmaps.
리턴 int

IsAlphaPresent() 공개 정적인 메소드

Determines if alpha channel COULD be present in given format.
public static IsAlphaPresent ( System.Windows.Media.PixelFormat format ) : bool
format System.Windows.Media.PixelFormat Format to check alpha in.
리턴 bool

IsBlockCompressed() 공개 정적인 메소드

Determines if format is a block compressed format.
public static IsBlockCompressed ( ImageEngineFormat format ) : bool
format ImageEngineFormat DDS Surface Format.
리턴 bool

IsExtensionSupported() 공개 정적인 메소드

Determines if file has a supported extension.
public static IsExtensionSupported ( string filePath, List supported = null ) : bool
filePath string Path of file to to check.
supported List Optionally list of supported extensions. Good if looping and can initialise supported and pass into this every loop.
리턴 bool

IsFormatMippable() 공개 정적인 메소드

Determines if given format supports mipmapping.
public static IsFormatMippable ( ImageEngineFormat format ) : bool
format ImageEngineFormat Image format to check.
리턴 bool

MaxNumberOfChannels() 공개 정적인 메소드

Gets maximum number of channels a format can contain. NOTE: This likely isn't actually the max number. i.e. None exceed four, but some are only one or two channels.
public static MaxNumberOfChannels ( ImageEngineFormat format ) : int
format ImageEngineFormat Format to channel count.
리턴 int

ParseExtension() 공개 정적인 메소드

Gets file extension from string of extension.
public static ParseExtension ( string extension ) : SupportedExtensions
extension string String containing file extension.
리턴 SupportedExtensions

프로퍼티 상세

SaveUnsupported 공개적으로 정적으로 프로퍼티

Contains formats not yet capable of saving.
public static List SaveUnsupported
리턴 List