From d50f0924032199f7e47f2cda94f06d6ab3798233 Mon Sep 17 00:00:00 2001 From: Samuel Chapleau Date: Mon, 15 May 2023 08:58:39 -0700 Subject: [PATCH] [Peek] Remove WIC project and only keep used ComImport (#25968) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Peek (#22498) * Add peek dll project * add spacebar preview and launch on hotkey press * add todo * add process handle to handle continuous press of hotkey * add tool to stop all powertoys processes * Add a blank Peek page and update nav menu * Add some initial content to Peek page including a toggle * refactor settings parsing * rename spacebar peek to peek viewer * rename script to stop powertoys processes * remove tool * Adding FileUtils for retrieving selected file in File Explorer * Remove unnecessary SndPeekSettings * Add shortcut setting * Set the shortcut to ctrl+space * Launching viewer with selected FE file * Add PeekUI WinUI3 project with interop events * Moving FileTypeUtils into PeekFileUtils project * execute winui3 app on hotkey * Fix paths with spaces * remove winui3 project * Resolve comment * add wpf app with toggle visibility on hotkey * fix visibility on startup * remove window properties and add todos * Fixed hidden extension and system file handling * wip * Add working WPF app with FileExplorer querying * remove c++ projects * Move native awaiter * Working Image control with image files * Resize and move window based on explorer monitor * Image render, window positioning and sizing clean up * add window management logic and selection logic * add extension methods to add circular iterating capability to linkedlistnode * Add OnArrowKeyPresshandler * Added titlebar with file name and scaling with titlebar height * fix flashing window on startup and process kept alive when powertoys exits * remove wait for debugger loop in ui * Add KeyIsDown method * Fix KeyDown issue with Key handled and check for repeat * Add thumbnail logic * Add all folder items if only one item is selected * File type helper * Using hresult * Add cancellation and rotation handling * Use extension instead of path * fIX CONFLICTS * Fixing some file type checks * Add new icon for Peek * Update page with the new Peek icon * Initialize IsEnabled and hook ActivationShortcut to dllmain * add icon to taskbar and titlebar * Add theme sensitive backgrounds * rename event handlers * add settings image * Move window data into obserable object * Refactor viewmodel, interop and helpers * Clean up * Add loading spinner * Add todos * Fix conflicts * Move native code into its own folder * Add peek to installer * Fix building peek and peekui projects * Replace UWP namespaces to WinAppSDK * Working WASDK placeholder project * Add exit when powertoys runner exit * Working winui3 with image display * Add WIC project with false for now * Fit content to window * Use Size from Windows.Foundation * Change order * Add some todos * Refactored native/interop code and added helpers to imagepreviewer * Rename projects * Move some code * Remove using Co-authored-by: Michael Salmon Co-authored-by: Michael Salmon 🐟 Co-authored-by: Alireza Ebadi Ghajari Co-authored-by: Jessie Su Co-authored-by: sujessie <102062556+sujessie@users.noreply.github.com> * Bump Microsoft.Windows.SDK.BuildTools version * [Peek] Plugin pattern to enable any file type previewing (#22475) * [Peek] Fetching image size through PropertyStore (#22530) * Fetching metadata from PropertySTore * Releasing objects to fix crash * Creating new PropertyHelper Co-authored-by: Daniel Chau * Juliata/filetypes (#22538) * Using the same list of file extensions as Lightbox's AppxManifest, and ensuring we convert file extension to lowercase * Add IsFileTypeSupported to IPreviewer * respond to PR comments * Add scale awareness to window centering (#22541) * [Peek] Fix installer builds, project configs and update assets (#22540) * Update installer * Fix installer errors * Fix peek vcxproj * Add package signing * Add peek to arm64 * Add back ARM64 toMeasureToolUI * Add versions to project * Update assets and icons * Add correct icon * [Peek] Enable PropertyStore for offline files (#22567) * Enabling PropertyStore for offline files Co-authored-by: Daniel Chau * [Peek] Adding unsupported file previewer (#22598) * Unsupported file previewer * Fix file display info * Fix property store calls * Update TODO * [Peek] Add WebView2 integration (#22506) * First commit with WIP logic to support WV2 in Peek module * Minor code cleanup and try/catch block * Added control to wrap WebView2 logic * Cleanup * Added logic to handle HTML previewing Properly update FilePreview according to file type * Code cleanup Updated comments * Updated comment * Removed comment * Code cleanup * Improved opening of web browser preview to avoid "blank" or "seeing previous page" issue Removed unused method Added xaml fallback to guarantee default/starting state * Removed folder * Updated factory logic to match master * address code review * addressed PR review * address PR review * Address PR review * address PR review * Address PR review * [Peek] Add basic file querying and navigation (#22589) * Refactor to facilitate file data initialization * Extract file-related code to new FileManager class * Add temp basic version * Clean + add todo for cancellations * Fix various nav-related issues * Temp - start moving iteration-related code to bg thread * Minor tweaks * Add FEHelper todo * Rename FileManager + various tweaks * Add basic throttling * Improve bg thread synchronization * Clean * Clean * Rename based on feedback * Rename FileQuery * Rename properties * Rename remaining fields * Add todos for nav success/failures Co-authored-by: Esteban Margaron * [Peek] Add customized title bar (#22600) * Add basic button UI * Add function to get default app name and to open file in default app * Correct error output * Add filename to titlebar * Remove titlebar text from Resw * Add basic button UI * Add function to get default app name and to open file in default app * Add filename to titlebar * Correct error output * Remove titlebar text from Resw * Add SetDragRectangles * Correct logic, update function name * Add localization * Cleanup and adaptive width * Add fileIndex/NumberOfFiles for multiple files activation * Refine titlebar styles * Update error message; Return HResult from native methods; Update variable initialisation and string null testing * Titlebar height and adaptive width refinement * Add fallback to launch app picker if fail to open default app * Temp change to hide AppTitle_FileCount * Update launch button to command; Add keyboard accelerator * Update titlebar inactive background color * Update tooltip to add keyboard accelerator * Add comments to resw file * Fix accidental deletion from previous merge Co-authored-by: Jojo Zhou Co-authored-by: Yawen Hou * Fix crash * Fix wrong thread exception * Make CurrentItemIndex setter private * Update titlebar filecount text * Fix titlebar draggable region and interactive region (bump WinAppSdk to latest) * [Peek] Unsupported File Previewer - Formatting string from resources (#22609) * Moving to string resource usage * Moving ReadableStringHelper to common project * Fix comments * [Peek] Fix foregrounding (#22633) * Fixing foregrounding * Get window handle inside BringToForeground extension method Co-authored-by: Daniel Chau Co-authored-by: Samuel Chapleau * [Peek] ImagePreviewer - Handle error states (#22637) * add better preview state handling * add error handling in imagepreviewer and better state handling * fix error handling so exception is not bubbled up * improve performance and hook up unsupported previewer on error * remove commented code * address pr comments * [Peek] add PDF viewing support (#22636) * [Peek] add PDF viewing support * Fixed issue which would redirect some HTML and PDF files to external browser * Fixed refactored interface name * [Peek] Refine titlebar adaptive width (#22642) * Adjust adaptive width of titlebar * Remove visualstate setters for AppTitle_FileCount Co-authored-by: Jojo Zhou * [Peek] New File Explorer tabs break Shell API to get selected files (#22641) * fix FE tab bug * remove unnecessary unsafe keyword * [Peek] add extra logic to properly render PNG files with transparency (#22613) * [Peek] added extra logic to render PNG files with proper transparency * Moved logic to ThumbnailHelper Cleanup * Created a separated previewer for PNG to only load the preview image with thumbnail logic * removed unused code * Updated state loading change * [Peek] Unsupported File Previewer - Setting Window Size (#22645) * Adding setting for unsupported file window * Fix * [Peek] Add tooltip to File (#22640) * Add tooltip to File * Add placeholder text for no tooltip * Address comments * Use StringBuilder Co-authored-by: Jojo Zhou * Add full image quality support (#22654) * [Peek] Window foregrounding simplification and fixes + keep window visible if FE single selection changed (#22657) * Use different apis to bring to foreground removing remote thread wait and work as well as library loading * Keep window open if single selected file in FE is different * Removed unused methods * [Peek] Add cancellation token OnFilePropertyChanged (#22643) * Cancel file loading before opening another file * Add omitted cancellation checks * Catch task cancelled exception; Add more cancellation checkpoints * Add cancellation checkpoint beofre GetBitmapFromHBitmapAsync * Correct typo * Update to pass cancellation token individually to each async methods * Add lost cancellationToken source * Add cancellation token to PngPreviewer Co-authored-by: Yawen Hou * [Peek] Unsupported File Previewer - Preserve Transparency For File Icons (#22650) * Preserving transparency or icons * Remove TODO Co-authored-by: Samuel Chapleau * [Peek] Update some installer build steps + assets update (#22683) * Fix settings & peek.ui.wpf * Add back missing icon * Add missing files and actions to installer * Keep window open if the selected file in explorer is different (only works for single file selection) * Undo last * [Peek] Add copy keyboard accelerator (#22647) * add copy keyboard accelerator * Fix comments Co-authored-by: Samuel Chapleau * [Peek] add WV2 improvements (behavior and UX) (#22685) * [Peek] added logic to get max monitor size for opening WebView2 * Removed ununsed dependency property * Added workaround for cases where the web page would not finish navigating in a quick timing, for example google.com. * Remove window extensions from common and use nullable size argument instead Co-authored-by: Samuel Chapleau * [Peek] Merge main, self-contained .NET and fix WebView2 user data dir issue (#22899) * Merge remote-tracking branch 'origin/main' into peek * Test sc * Set WebView2 user data dir * spellcheck * Fix comment * Move check if higher quality image is already loaded to the exact line where we change the Preview bitmap (#23083) * Fix opening Peek when FE window is set to full name path (#23082) * Move check for png thubmnail loading priority * Remove Peek.UI.WPF project * Remove duplicated method in powertoys setup * [Peek] Fix selecting files from the correct focused opened File Explorer tab & from Desktop (#23489) * Get file based on active tab handle instead of window title * Refactor code to get active tab * Getting all items from the shell API working again, except for desktop * Refactor and cleanup com & native code * Add back removed peek xaml assets in Product.wxs * Remove some dependencies that do not seem necessary in Product.wxs * [Peek] Small images (#23554) * change stretch value * compare with actual window size * consider scaling factor * set max size * clean up * clean up * clean up previewers * scaling factor in bitmap previewer * max image size property * [Peek]Handle errors for HEIC/HEIF and fall back to default previewer if there is no thumbnail (#22684) * Handle errors when getting filesize by falling back to default previewer * Bringing back other file types that are fixed with these code changes --------- Co-authored-by: Samuel Chapleau * [Peek] Add unsupported file icon fallback (#23735) * Refactor icon retrieval, refactor hbitmap to bitmap conversion, add icon fallback * Add svg to assets in installer * [Peek] Refactoring of file system models, removal of PngPreviewer, retrieving of folder size via Scripting com reference and other fixes (#23955) * Refactor icon retrieval, refactor hbitmap to bitmap conversion, add icon fallback * Add svg to assets in installer * - Refactor File class into IFileSystemItem, FileItem & FolderItem - Display size for folders using Scripting namespace - Remove default app buttons for files or folders not supporting it * Add better content type via storage apis * Add check for storagefile in PngPreviewer * Fix png stretching * Remove png previewer * Rename ThumbnailOptions.None to ThumbnailOptions.ResizeToFit * [Peek] Removed monitor percentage evaluation for the UnsupportedFilePreview control (#24002) * Remove settings for percentage of windows and keep default min size. * Fix margin on unsupported control * Use nullable Size for image size & open file on background thread (#24004) * [Peek] SVG support (#24237) * svg previewer * svg size * set scaling factor * set image size * changed image source type * non nullable image size * notify svg previewer changed * uncomment * rename BitmapPreviewer * move svg support * remove svg previewer * [Peek] Implementation of a performant and reliable Neighboring Files Query (#24943) * Use IShellItemArray as the backing array of item * Finalize and cleanup NFQ implementation * Cleanup remainder of the code * Remove unused using * [Peek] Pin the window position (#24927) * [Peek] Telemetry and logging (#25231) * text preview * scrolling * changed size * Handle errors more gracefuly * webview2 preview * common preview project * previewpane: use common project * peek: use common * previewpane: moved md * peek: md * previewpane: clean up * clean up * moved monaco files * moved formatters * rename * moved common monaco helper * dev files support * installer * removed versions * warnings: culture info * warnings: names * clean up * warnings: dispose * warnings: default values * warnings * warnings: charset * warnings: exceptions * suppress warning * installer: added peek * changed peek guid * monaco folders * peek deps * peek files * peek resources * removed additional monaco folder * set host name * Update installer * hardcode monaco path * leave single webview control * moved path to common * project * more meaningful todos * moved temp folder cleanup * todo * extension check * spell: monaco * spellcheck * spellcheck * fix id * fix spelling * key to spelling * id fix * Fix monaco resolution at install time * Fix user install. Add needed files * installer: remove peek localization files. It's a WinUI app * installer:fix signing * removed unused * settings: flyout enable/disable for Peek * simplify string * property changed handle * [Peek][Settings] Peek OOBE page (#25895) * Add placeholder error icon * Only open FilStream in read-only mode; Release propertyStore handle after getting the file properties (cherry picked from commit 3b1481da2c2e8ffa5ae1426d9cd22f7fb7a1240e) * Update calls to PropertyStoreHelper * Add disposable property store * Make GetPropertyStoreFromPath return Disposable property store * correct typo * correct typo * Remove nullable in DisposablePropertyStore * Add property getters * Remove usued method * Correct typo * Correct typo again... * Update description * Add cleaner fallback error * Fix build * Cleanup code * Fix indents * Delete WIC project and keep only necessary WIC comimport * Fix spellcheck --------- Co-authored-by: Michael Salmon Co-authored-by: Michael Salmon 🐟 Co-authored-by: Alireza Ebadi Ghajari Co-authored-by: Jessie Su Co-authored-by: sujessie <102062556+sujessie@users.noreply.github.com> Co-authored-by: Daniel Chau Co-authored-by: Daniel Chau Co-authored-by: jth-ms <73617023+jth-ms@users.noreply.github.com> Co-authored-by: Robson Co-authored-by: estebanm123 <49930791+estebanm123@users.noreply.github.com> Co-authored-by: Esteban Margaron Co-authored-by: Yawen Hou Co-authored-by: Jojo Zhou Co-authored-by: Yawen Hou Co-authored-by: Jojo Zhou <39350350+Joanna-Zhou@users.noreply.github.com> Co-authored-by: Stefan Markovic <57057282+stefansjfw@users.noreply.github.com> Co-authored-by: Seraphima Zykova Co-authored-by: Stefan Markovic Co-authored-by: Jaime Bernardo --- .github/actions/spell-check/expect.txt | 6 +- .pipelines/ESRPSigning_core.json | 1 - PowerToys.sln | 17 +- src/modules/peek/Peek.Common/WIC/CLSID.cs | 11 + .../Interfaces => Peek.Common/WIC}/IID.cs | 6 +- .../peek/Peek.Common/WIC/IWICBitmapDecoder.cs | 20 ++ .../Peek.Common/WIC/IWICBitmapFrameDecode.cs | 17 ++ .../peek/Peek.Common/WIC/IWICBitmapSource.cs | 17 ++ .../Peek.Common/WIC/IWICImagingFactory.cs | 21 ++ .../peek/Peek.Common/WIC/StreamAccessMode.cs | 15 ++ .../peek/Peek.Common/WIC/WICDecodeOptions.cs | 12 + .../peek/Peek.Common/WIC/WICImagingFactory.cs | 22 ++ .../Peek.FilePreviewer.csproj | 7 +- .../ImagePreviewer/Helpers/WICHelper.cs | 4 +- src/modules/peek/WIC/Classes/CLSID.cs | 7 - .../peek/WIC/Classes/WICImagingFactory.cs | 14 - src/modules/peek/WIC/CoTaskMemPtr.cs | 43 --- .../peek/WIC/Constants/ContainerFormat.cs | 16 -- src/modules/peek/WIC/Constants/HResult.cs | 7 - src/modules/peek/WIC/Constants/Vendor.cs | 10 - .../peek/WIC/Constants/WICPixelFormat.cs | 98 ------- .../peek/WIC/Enumerations/ExifColorSpace.cs | 8 - src/modules/peek/WIC/Enumerations/LOCKTYPE.cs | 14 - .../MetadataCreationAndPersistOptions.cs | 19 -- src/modules/peek/WIC/Enumerations/STATFLAG.cs | 12 - src/modules/peek/WIC/Enumerations/STGC.cs | 16 -- src/modules/peek/WIC/Enumerations/STGM.cs | 15 -- src/modules/peek/WIC/Enumerations/STGTY.cs | 13 - .../peek/WIC/Enumerations/STREAM_SEEK.cs | 12 - .../peek/WIC/Enumerations/StreamAccessMode.cs | 11 - .../WICBitmapAlphaChannelOption.cs | 9 - .../WICBitmapCreateCacheOption.cs | 9 - .../WICBitmapDecoderCapabilities.cs | 14 - .../WIC/Enumerations/WICBitmapDitherType.cs | 19 -- .../WICBitmapEncoderCacheOption.cs | 9 - .../WICBitmapInterpolationMode.cs | 14 - .../WIC/Enumerations/WICBitmapLockFlags.cs | 11 - .../WIC/Enumerations/WICBitmapPaletteType.cs | 20 -- .../Enumerations/WICBitmapTransformOptions.cs | 17 -- .../WIC/Enumerations/WICColorContextType.cs | 9 - .../WICComponentEnumerateOptions.cs | 14 - .../WIC/Enumerations/WICComponentSigning.cs | 13 - .../peek/WIC/Enumerations/WICComponentType.cs | 16 -- .../peek/WIC/Enumerations/WICDecodeOptions.cs | 8 - .../WICMetadataCreationOptions.cs | 13 - .../WIC/Extensions/IEnumStringExtensions.cs | 21 -- .../WIC/Extensions/IEnumUnknownExtensions.cs | 21 -- .../peek/WIC/Extensions/IStreamExtensions.cs | 67 ----- .../IWICBitmapCodecInfoExtensions.cs | 38 --- .../Extensions/IWICBitmapDecoderExtensions.cs | 34 --- .../IWICBitmapDecoderInfoExtensions.cs | 43 --- .../Extensions/IWICBitmapEncoderExtensions.cs | 20 -- .../WIC/Extensions/IWICBitmapExtensions.cs | 21 -- .../IWICBitmapFrameDecodeExtensions.cs | 37 --- .../IWICBitmapFrameEncodeExtensions.cs | 46 ---- .../Extensions/IWICBitmapLockExtensions.cs | 15 -- .../Extensions/IWICBitmapScalerExtensions.cs | 13 - .../Extensions/IWICBitmapSourceExtensions.cs | 30 --- .../Extensions/IWICColorContextExtensions.cs | 19 -- .../Extensions/IWICComponentInfoExtensions.cs | 32 --- .../IWICFormatConverterInfoExtensions.cs | 16 -- .../IWICImagingFactoryExtensions.cs | 80 ------ .../IWICMetadataHandlerInfoExtensions.cs | 27 -- .../IWICMetadataQueryReaderExtensions.cs | 35 --- .../WIC/Extensions/IWICPaletteExtensions.cs | 19 -- .../peek/WIC/Extensions/StreamExtensions.cs | 129 --------- src/modules/peek/WIC/FetchIntoBufferMethod.cs | 37 --- .../peek/WIC/Interfaces/IEnumString.cs | 23 -- .../peek/WIC/Interfaces/IEnumUnknown.cs | 22 -- src/modules/peek/WIC/Interfaces/IErrorLog.cs | 15 -- .../peek/WIC/Interfaces/IPropertyBag2.cs | 37 --- .../peek/WIC/Interfaces/ISequentialStream.cs | 22 -- src/modules/peek/WIC/Interfaces/IStream.cs | 61 ----- src/modules/peek/WIC/Interfaces/IWICBitmap.cs | 45 ---- .../peek/WIC/Interfaces/IWICBitmapClipper.cs | 38 --- .../WIC/Interfaces/IWICBitmapCodecInfo.cs | 86 ------ .../peek/WIC/Interfaces/IWICBitmapDecoder.cs | 41 --- .../WIC/Interfaces/IWICBitmapDecoderInfo.cs | 102 ------- .../peek/WIC/Interfaces/IWICBitmapEncoder.cs | 40 --- .../WIC/Interfaces/IWICBitmapEncoderInfo.cs | 92 ------- .../WIC/Interfaces/IWICBitmapFlipRotator.cs | 38 --- .../WIC/Interfaces/IWICBitmapFrameDecode.cs | 43 --- .../WIC/Interfaces/IWICBitmapFrameEncode.cs | 49 ---- .../peek/WIC/Interfaces/IWICBitmapLock.cs | 22 -- .../peek/WIC/Interfaces/IWICBitmapScaler.cs | 40 --- .../peek/WIC/Interfaces/IWICBitmapSource.cs | 30 --- .../peek/WIC/Interfaces/IWICColorContext.cs | 30 --- .../peek/WIC/Interfaces/IWICColorTransform.cs | 40 --- .../WIC/Interfaces/IWICComponentFactory.cs | 140 ---------- .../peek/WIC/Interfaces/IWICComponentInfo.cs | 39 --- .../WIC/Interfaces/IWICEnumMetadataItem.cs | 24 -- .../WIC/Interfaces/IWICFastMetadataEncoder.cs | 14 - .../WIC/Interfaces/IWICFormatConverter.cs | 46 ---- .../WIC/Interfaces/IWICFormatConverterInfo.cs | 50 ---- .../peek/WIC/Interfaces/IWICImagingFactory.cs | 105 -------- .../WIC/Interfaces/IWICMetadataBlockReader.cs | 20 -- .../WIC/Interfaces/IWICMetadataBlockWriter.cs | 40 --- .../WIC/Interfaces/IWICMetadataHandlerInfo.cs | 66 ----- .../WIC/Interfaces/IWICMetadataQueryReader.cs | 24 -- .../WIC/Interfaces/IWICMetadataQueryWriter.cs | 35 --- .../peek/WIC/Interfaces/IWICMetadataReader.cs | 30 --- .../peek/WIC/Interfaces/IWICMetadataWriter.cs | 52 ---- .../peek/WIC/Interfaces/IWICPalette.cs | 42 --- src/modules/peek/WIC/Interfaces/IWICStream.cs | 80 ------ src/modules/peek/WIC/PropVariantHelpers.cs | 252 ------------------ src/modules/peek/WIC/Structures/PROPBAG2.cs | 27 -- .../peek/WIC/Structures/PROPVARIANT.cs | 79 ------ src/modules/peek/WIC/Structures/Resolution.cs | 14 - src/modules/peek/WIC/Structures/STATSTG.cs | 23 -- src/modules/peek/WIC/Structures/Size.cs | 14 - src/modules/peek/WIC/Structures/VARTYPE.cs | 61 ----- .../peek/WIC/Structures/WICBitmapPattern.cs | 24 -- src/modules/peek/WIC/Structures/WICRect.cs | 13 - src/modules/peek/WIC/WIC.csproj | 10 - 114 files changed, 152 insertions(+), 3574 deletions(-) create mode 100644 src/modules/peek/Peek.Common/WIC/CLSID.cs rename src/modules/peek/{WIC/Interfaces => Peek.Common/WIC}/IID.cs (93%) create mode 100644 src/modules/peek/Peek.Common/WIC/IWICBitmapDecoder.cs create mode 100644 src/modules/peek/Peek.Common/WIC/IWICBitmapFrameDecode.cs create mode 100644 src/modules/peek/Peek.Common/WIC/IWICBitmapSource.cs create mode 100644 src/modules/peek/Peek.Common/WIC/IWICImagingFactory.cs create mode 100644 src/modules/peek/Peek.Common/WIC/StreamAccessMode.cs create mode 100644 src/modules/peek/Peek.Common/WIC/WICDecodeOptions.cs create mode 100644 src/modules/peek/Peek.Common/WIC/WICImagingFactory.cs delete mode 100644 src/modules/peek/WIC/Classes/CLSID.cs delete mode 100644 src/modules/peek/WIC/Classes/WICImagingFactory.cs delete mode 100644 src/modules/peek/WIC/CoTaskMemPtr.cs delete mode 100644 src/modules/peek/WIC/Constants/ContainerFormat.cs delete mode 100644 src/modules/peek/WIC/Constants/HResult.cs delete mode 100644 src/modules/peek/WIC/Constants/Vendor.cs delete mode 100644 src/modules/peek/WIC/Constants/WICPixelFormat.cs delete mode 100644 src/modules/peek/WIC/Enumerations/ExifColorSpace.cs delete mode 100644 src/modules/peek/WIC/Enumerations/LOCKTYPE.cs delete mode 100644 src/modules/peek/WIC/Enumerations/MetadataCreationAndPersistOptions.cs delete mode 100644 src/modules/peek/WIC/Enumerations/STATFLAG.cs delete mode 100644 src/modules/peek/WIC/Enumerations/STGC.cs delete mode 100644 src/modules/peek/WIC/Enumerations/STGM.cs delete mode 100644 src/modules/peek/WIC/Enumerations/STGTY.cs delete mode 100644 src/modules/peek/WIC/Enumerations/STREAM_SEEK.cs delete mode 100644 src/modules/peek/WIC/Enumerations/StreamAccessMode.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapAlphaChannelOption.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapCreateCacheOption.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapDecoderCapabilities.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapDitherType.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapEncoderCacheOption.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapInterpolationMode.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapLockFlags.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapPaletteType.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICBitmapTransformOptions.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICColorContextType.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICComponentEnumerateOptions.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICComponentSigning.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICComponentType.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICDecodeOptions.cs delete mode 100644 src/modules/peek/WIC/Enumerations/WICMetadataCreationOptions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IEnumStringExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IEnumUnknownExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IStreamExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapCodecInfoExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapDecoderExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapDecoderInfoExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapEncoderExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapFrameDecodeExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapFrameEncodeExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapLockExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapScalerExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICBitmapSourceExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICColorContextExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICComponentInfoExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICFormatConverterInfoExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICImagingFactoryExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICMetadataHandlerInfoExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICMetadataQueryReaderExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/IWICPaletteExtensions.cs delete mode 100644 src/modules/peek/WIC/Extensions/StreamExtensions.cs delete mode 100644 src/modules/peek/WIC/FetchIntoBufferMethod.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IEnumString.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IEnumUnknown.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IErrorLog.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IPropertyBag2.cs delete mode 100644 src/modules/peek/WIC/Interfaces/ISequentialStream.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IStream.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmap.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapClipper.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapCodecInfo.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapDecoder.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapDecoderInfo.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapEncoder.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapEncoderInfo.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapFlipRotator.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapFrameDecode.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapFrameEncode.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapLock.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapScaler.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICBitmapSource.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICColorContext.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICColorTransform.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICComponentFactory.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICComponentInfo.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICEnumMetadataItem.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICFastMetadataEncoder.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICFormatConverter.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICFormatConverterInfo.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICImagingFactory.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICMetadataBlockReader.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICMetadataBlockWriter.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICMetadataHandlerInfo.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICMetadataQueryReader.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICMetadataQueryWriter.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICMetadataReader.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICMetadataWriter.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICPalette.cs delete mode 100644 src/modules/peek/WIC/Interfaces/IWICStream.cs delete mode 100644 src/modules/peek/WIC/PropVariantHelpers.cs delete mode 100644 src/modules/peek/WIC/Structures/PROPBAG2.cs delete mode 100644 src/modules/peek/WIC/Structures/PROPVARIANT.cs delete mode 100644 src/modules/peek/WIC/Structures/Resolution.cs delete mode 100644 src/modules/peek/WIC/Structures/STATSTG.cs delete mode 100644 src/modules/peek/WIC/Structures/Size.cs delete mode 100644 src/modules/peek/WIC/Structures/VARTYPE.cs delete mode 100644 src/modules/peek/WIC/Structures/WICBitmapPattern.cs delete mode 100644 src/modules/peek/WIC/Structures/WICRect.cs delete mode 100644 src/modules/peek/WIC/WIC.csproj diff --git a/.github/actions/spell-check/expect.txt b/.github/actions/spell-check/expect.txt index 4c03cb2510..b369066821 100644 --- a/.github/actions/spell-check/expect.txt +++ b/.github/actions/spell-check/expect.txt @@ -976,7 +976,7 @@ ipc ipcmanager IPlugin IPower -ipreview +IPREVIEW ipreviewhandlervisualssetfont IProperty IPublic @@ -994,7 +994,7 @@ iss ISurface ITask ith -ithumbnail +ITHUMBNAIL IUI IUnknown IWbem @@ -1478,7 +1478,7 @@ PATINVERT PATPAINT PAUDIO pbc -pbgra +Pbgra PBlob pcb pcch diff --git a/.pipelines/ESRPSigning_core.json b/.pipelines/ESRPSigning_core.json index ec5e874736..048147cef1 100644 --- a/.pipelines/ESRPSigning_core.json +++ b/.pipelines/ESRPSigning_core.json @@ -93,7 +93,6 @@ "modules\\Peek\\Peek.FilePreviewer.dll", "modules\\Peek\\Powertoys.Peek.UI.dll", "modules\\Peek\\Powertoys.Peek.UI.exe", - "modules\\Peek\\WIC.dll", "modules\\Peek\\Powertoys.Peek.dll", "modules\\ImageResizer\\PowerToys.ImageResizer.exe", diff --git a/PowerToys.sln b/PowerToys.sln index d6860478ad..9a0cae23a3 100644 --- a/PowerToys.sln +++ b/PowerToys.sln @@ -475,8 +475,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.Common", "src\modules\ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Peek.FilePreviewer", "src\modules\peek\Peek.FilePreviewer\Peek.FilePreviewer.csproj", "{AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WIC", "src\modules\peek\WIC\WIC.csproj", "{21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}" -EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "MarkdownPreviewHandlerCpp", "src\modules\previewpane\MarkdownPreviewHandlerCpp\MarkdownPreviewHandlerCpp.vcxproj", "{ED9A1AC6-AEB0-4569-A6E9-E1696182B545}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "GcodePreviewHandlerCpp", "src\modules\previewpane\GcodePreviewHandlerCpp\GcodePreviewHandlerCpp.vcxproj", "{5A5DD09D-723A-44D3-8F2B-293584C3D731}" @@ -515,7 +513,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "RegistryPreview", "Registry EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilePreviewCommon", "src\common\FilePreviewCommon\FilePreviewCommon.csproj", "{9EBAA524-0EDA-470B-95D4-39383285CBB2}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.PowerToys.Run.Plugin.PowerToys", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.PowerToys\Microsoft.PowerToys.Run.Plugin.PowerToys.csproj", "{500DED3E-CFB5-4ED5-ACC6-02B3D6DC336D}" +Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.PowerToys.Run.Plugin.PowerToys", "src\modules\launcher\Plugins\Microsoft.PowerToys.Run.Plugin.PowerToys\Microsoft.PowerToys.Run.Plugin.PowerToys.csproj", "{500DED3E-CFB5-4ED5-ACC6-02B3D6DC336D}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -1975,18 +1973,6 @@ Global {AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|x64.Build.0 = Release|x64 {AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|x86.ActiveCfg = Release|x64 {AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC}.Release|x86.Build.0 = Release|x64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|ARM64.ActiveCfg = Debug|ARM64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|ARM64.Build.0 = Debug|ARM64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|x64.ActiveCfg = Debug|x64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|x64.Build.0 = Debug|x64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|x86.ActiveCfg = Debug|x64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Debug|x86.Build.0 = Debug|x64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|ARM64.ActiveCfg = Release|ARM64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|ARM64.Build.0 = Release|ARM64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|x64.ActiveCfg = Release|x64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|x64.Build.0 = Release|x64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|x86.ActiveCfg = Release|x64 - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF}.Release|x86.Build.0 = Release|x64 {ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|ARM64.ActiveCfg = Debug|ARM64 {ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|ARM64.Build.0 = Debug|ARM64 {ED9A1AC6-AEB0-4569-A6E9-E1696182B545}.Debug|x64.ActiveCfg = Debug|x64 @@ -2367,7 +2353,6 @@ Global {9D7A6DE0-7D27-424D-ABAE-41B2161F9A03} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20} {17A99C7C-0BFF-45BB-A9FD-63A0DDC105BB} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20} {AA9F0AF8-7924-4D59-BAA1-E36F1304E0DC} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20} - {21B69DE5-59FD-4C5D-A142-EF1C1C430EAF} = {17B4FA70-001E-4D33-BBBB-0D142DBC2E20} {ED9A1AC6-AEB0-4569-A6E9-E1696182B545} = {2F305555-C296-497E-AC20-5FA1B237996A} {5A5DD09D-723A-44D3-8F2B-293584C3D731} = {2F305555-C296-497E-AC20-5FA1B237996A} {B3E869C4-8210-4EBD-A621-FF4C4AFCBFA9} = {2F305555-C296-497E-AC20-5FA1B237996A} diff --git a/src/modules/peek/Peek.Common/WIC/CLSID.cs b/src/modules/peek/Peek.Common/WIC/CLSID.cs new file mode 100644 index 0000000000..8c16c46b66 --- /dev/null +++ b/src/modules/peek/Peek.Common/WIC/CLSID.cs @@ -0,0 +1,11 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Peek.Common.WIC +{ + internal static class CLSID + { + public const string WICImagingFactory = "cacaf262-9370-4615-a13b-9f5539da4c0a"; + } +} diff --git a/src/modules/peek/WIC/Interfaces/IID.cs b/src/modules/peek/Peek.Common/WIC/IID.cs similarity index 93% rename from src/modules/peek/WIC/Interfaces/IID.cs rename to src/modules/peek/Peek.Common/WIC/IID.cs index 9792e3a3f0..8c0918da87 100644 --- a/src/modules/peek/WIC/Interfaces/IID.cs +++ b/src/modules/peek/Peek.Common/WIC/IID.cs @@ -1,4 +1,8 @@ -namespace WIC +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Peek.Common.WIC { internal static class IID { diff --git a/src/modules/peek/Peek.Common/WIC/IWICBitmapDecoder.cs b/src/modules/peek/Peek.Common/WIC/IWICBitmapDecoder.cs new file mode 100644 index 0000000000..b9c42057ac --- /dev/null +++ b/src/modules/peek/Peek.Common/WIC/IWICBitmapDecoder.cs @@ -0,0 +1,20 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.InteropServices; + +namespace Peek.Common.WIC +{ + [ComImport] + [Guid(IID.IWICBitmapDecoder)] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IWICBitmapDecoder + { + [System.Diagnostics.CodeAnalysis.SuppressMessage("StyleCop.CSharp.NamingRules", "SA1300:Element should begin with upper-case letter", Justification = "Implements COM Interface")] + void _VtblGap1_10(); // skip 10 methods + + IWICBitmapFrameDecode GetFrame([In] int index); + } +} diff --git a/src/modules/peek/Peek.Common/WIC/IWICBitmapFrameDecode.cs b/src/modules/peek/Peek.Common/WIC/IWICBitmapFrameDecode.cs new file mode 100644 index 0000000000..bd11cb8cae --- /dev/null +++ b/src/modules/peek/Peek.Common/WIC/IWICBitmapFrameDecode.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.InteropServices; + +namespace Peek.Common.WIC +{ + [ComImport] + [Guid(IID.IWICBitmapFrameDecode)] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IWICBitmapFrameDecode : IWICBitmapSource + { + new void GetSize([Out] out int puiWidth, [Out] out int puiHeight); + } +} diff --git a/src/modules/peek/Peek.Common/WIC/IWICBitmapSource.cs b/src/modules/peek/Peek.Common/WIC/IWICBitmapSource.cs new file mode 100644 index 0000000000..2fefd5ca79 --- /dev/null +++ b/src/modules/peek/Peek.Common/WIC/IWICBitmapSource.cs @@ -0,0 +1,17 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.InteropServices; + +namespace Peek.Common.WIC +{ + [ComImport] + [Guid(IID.IWICBitmapSource)] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IWICBitmapSource + { + void GetSize([Out] out int puiWidth, [Out] out int puiHeight); + } +} diff --git a/src/modules/peek/Peek.Common/WIC/IWICImagingFactory.cs b/src/modules/peek/Peek.Common/WIC/IWICImagingFactory.cs new file mode 100644 index 0000000000..29d7875166 --- /dev/null +++ b/src/modules/peek/Peek.Common/WIC/IWICImagingFactory.cs @@ -0,0 +1,21 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Runtime.InteropServices; + +namespace Peek.Common.WIC +{ + [ComImport] + [Guid(IID.IWICImagingFactory)] + [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] + public interface IWICImagingFactory + { + IWICBitmapDecoder CreateDecoderFromFilename( + [In, MarshalAs(UnmanagedType.LPWStr)] string wzFilename, + [In] IntPtr pguidVendor, + [In] StreamAccessMode dwDesiredAccess, + [In] WICDecodeOptions metadataOptions); + } +} diff --git a/src/modules/peek/Peek.Common/WIC/StreamAccessMode.cs b/src/modules/peek/Peek.Common/WIC/StreamAccessMode.cs new file mode 100644 index 0000000000..1305cbc95b --- /dev/null +++ b/src/modules/peek/Peek.Common/WIC/StreamAccessMode.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; + +namespace Peek.Common.WIC +{ + [Flags] + public enum StreamAccessMode : int + { + GENERIC_WRITE = 0x40000000, + GENERIC_READ = unchecked((int)0x80000000U), + } +} diff --git a/src/modules/peek/Peek.Common/WIC/WICDecodeOptions.cs b/src/modules/peek/Peek.Common/WIC/WICDecodeOptions.cs new file mode 100644 index 0000000000..47d4ae5200 --- /dev/null +++ b/src/modules/peek/Peek.Common/WIC/WICDecodeOptions.cs @@ -0,0 +1,12 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +namespace Peek.Common.WIC +{ + public enum WICDecodeOptions : int + { + WICDecodeMetadataCacheOnDemand = 0x00000000, + WICDecodeMetadataCacheOnLoad = 0x00000001, + } +} diff --git a/src/modules/peek/Peek.Common/WIC/WICImagingFactory.cs b/src/modules/peek/Peek.Common/WIC/WICImagingFactory.cs new file mode 100644 index 0000000000..866be17f86 --- /dev/null +++ b/src/modules/peek/Peek.Common/WIC/WICImagingFactory.cs @@ -0,0 +1,22 @@ +// Copyright (c) Microsoft Corporation +// The Microsoft Corporation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System.Runtime.InteropServices; + +namespace Peek.Common.WIC +{ + [ComImport] + [Guid(CLSID.WICImagingFactory)] + [ComDefaultInterface(typeof(IWICImagingFactoryClass))] + public class WICImagingFactory + { + } + + [ComImport] + [Guid(IID.IWICImagingFactory)] + [CoClass(typeof(WICImagingFactory))] + public interface IWICImagingFactoryClass : IWICImagingFactory + { + } +} diff --git a/src/modules/peek/Peek.FilePreviewer/Peek.FilePreviewer.csproj b/src/modules/peek/Peek.FilePreviewer/Peek.FilePreviewer.csproj index d2b4ef0ecd..4b351beb7b 100644 --- a/src/modules/peek/Peek.FilePreviewer/Peek.FilePreviewer.csproj +++ b/src/modules/peek/Peek.FilePreviewer/Peek.FilePreviewer.csproj @@ -33,7 +33,12 @@ - + + + + + MSBuild:Compile + diff --git a/src/modules/peek/Peek.FilePreviewer/Previewers/ImagePreviewer/Helpers/WICHelper.cs b/src/modules/peek/Peek.FilePreviewer/Previewers/ImagePreviewer/Helpers/WICHelper.cs index 87b5e29509..d1b9bb42d3 100644 --- a/src/modules/peek/Peek.FilePreviewer/Previewers/ImagePreviewer/Helpers/WICHelper.cs +++ b/src/modules/peek/Peek.FilePreviewer/Previewers/ImagePreviewer/Helpers/WICHelper.cs @@ -4,7 +4,7 @@ using System; using System.Threading.Tasks; -using WIC; +using Peek.Common.WIC; namespace Peek.FilePreviewer.Previewers { @@ -15,7 +15,7 @@ namespace Peek.FilePreviewer.Previewers return Task.Run(() => { // TODO: Find a way to get file metadata without hydrating files. Look into Shell API/Windows Property System, e.g., IPropertyStore - IWICImagingFactory factory = (IWICImagingFactory)new WICImagingFactoryClass(); + IWICImagingFactory factory = (IWICImagingFactory)new WICImagingFactory(); var decoder = factory.CreateDecoderFromFilename(filePath, IntPtr.Zero, StreamAccessMode.GENERIC_READ, WICDecodeOptions.WICDecodeMetadataCacheOnLoad); var frame = decoder?.GetFrame(0); int width = 0; diff --git a/src/modules/peek/WIC/Classes/CLSID.cs b/src/modules/peek/WIC/Classes/CLSID.cs deleted file mode 100644 index 63bc6f575d..0000000000 --- a/src/modules/peek/WIC/Classes/CLSID.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace WIC -{ - internal static class CLSID - { - public const string WICImagingFactory = "cacaf262-9370-4615-a13b-9f5539da4c0a"; - } -} diff --git a/src/modules/peek/WIC/Classes/WICImagingFactory.cs b/src/modules/peek/WIC/Classes/WICImagingFactory.cs deleted file mode 100644 index 7792311c50..0000000000 --- a/src/modules/peek/WIC/Classes/WICImagingFactory.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICImagingFactory)] - [CoClass(typeof(WICImagingFactoryClass))] - public interface WICImagingFactory : IWICImagingFactory { } - - [ComImport] - [Guid(CLSID.WICImagingFactory)] - [ComDefaultInterface(typeof(IWICImagingFactory))] - public class WICImagingFactoryClass { } -} diff --git a/src/modules/peek/WIC/CoTaskMemPtr.cs b/src/modules/peek/WIC/CoTaskMemPtr.cs deleted file mode 100644 index c9029f3331..0000000000 --- a/src/modules/peek/WIC/CoTaskMemPtr.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - internal struct CoTaskMemPtr : IDisposable - { - public static CoTaskMemPtr From(T? nullableStructure) where T : struct - { - IntPtr value; - if (nullableStructure.HasValue) - { - value = Marshal.AllocCoTaskMem(Marshal.SizeOf(typeof(T))); - Marshal.StructureToPtr(nullableStructure, value, false); - } - else - { - value = IntPtr.Zero; - } - return new CoTaskMemPtr(value); - } - - public CoTaskMemPtr(IntPtr value) - { - this.value = value; - } - - private IntPtr value; - - public static implicit operator IntPtr(CoTaskMemPtr safeIntPtr) - { - return safeIntPtr.value; - } - - public void Dispose() - { - if (value != IntPtr.Zero) - { - Marshal.FreeCoTaskMem(value); - } - } - } -} diff --git a/src/modules/peek/WIC/Constants/ContainerFormat.cs b/src/modules/peek/WIC/Constants/ContainerFormat.cs deleted file mode 100644 index e4b5b8da8b..0000000000 --- a/src/modules/peek/WIC/Constants/ContainerFormat.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace WIC -{ - public static class ContainerFormat - { - public static readonly Guid Bmp = new Guid(0x0af1d87e, 0xfcfe, 0x4188, 0xbd, 0xeb, 0xa7, 0x90, 0x64, 0x71, 0xcb, 0xe3); - public static readonly Guid Png = new Guid(0x1b7cfaf4, 0x713f, 0x473c, 0xbb, 0xcd, 0x61, 0x37, 0x42, 0x5f, 0xae, 0xaf); - public static readonly Guid Ico = new Guid(0xa3a860c4, 0x338f, 0x4c17, 0x91, 0x9a, 0xfb, 0xa4, 0xb5, 0x62, 0x8f, 0x21); - public static readonly Guid Jpeg = new Guid(0x19e4a5aa, 0x5662, 0x4fc5, 0xa0, 0xc0, 0x17, 0x58, 0x02, 0x8e, 0x10, 0x57); - public static readonly Guid Tiff = new Guid(0x163bcc30, 0xe2e9, 0x4f0b, 0x96, 0x1d, 0xa3, 0xe9, 0xfd, 0xb7, 0x88, 0xa3); - public static readonly Guid Gif = new Guid(0x1f8a5601, 0x7d4d, 0x4cbd, 0x9c, 0x82, 0x1b, 0xc8, 0xd4, 0xee, 0xb9, 0xa5); - public static readonly Guid Wmp = new Guid(0x57a37caa, 0x367a, 0x4540, 0x91, 0x6b, 0xf1, 0x83, 0xc5, 0x09, 0x3a, 0x4b); - public static readonly Guid Dds = new Guid(0x9967cb95, 0x2e85, 0x4ac8, 0x8c, 0xa2, 0x83, 0xd7, 0xcc, 0xd4, 0x25, 0xc9); - } -} diff --git a/src/modules/peek/WIC/Constants/HResult.cs b/src/modules/peek/WIC/Constants/HResult.cs deleted file mode 100644 index 341c8530d2..0000000000 --- a/src/modules/peek/WIC/Constants/HResult.cs +++ /dev/null @@ -1,7 +0,0 @@ -namespace WIC -{ - public struct HResult - { - public const int WINCODEC_ERR_PROPERTYNOTFOUND = unchecked((int)0x88982F40); - } -} diff --git a/src/modules/peek/WIC/Constants/Vendor.cs b/src/modules/peek/WIC/Constants/Vendor.cs deleted file mode 100644 index 6377f0b735..0000000000 --- a/src/modules/peek/WIC/Constants/Vendor.cs +++ /dev/null @@ -1,10 +0,0 @@ -using System; - -namespace WIC -{ - public static class Vendor - { - public static readonly Guid Microsoft = new Guid(0xf0e749ca, 0xedef, 0x4589, 0xa7, 0x3a, 0xee, 0xe, 0x62, 0x6a, 0x2a, 0x2b); - public static readonly Guid MicrosoftBuiltIn = new Guid(0x257a30fd, 0x6b6, 0x462b, 0xae, 0xa4, 0x63, 0xf7, 0xb, 0x86, 0xe5, 0x33); - } -} diff --git a/src/modules/peek/WIC/Constants/WICPixelFormat.cs b/src/modules/peek/WIC/Constants/WICPixelFormat.cs deleted file mode 100644 index 1e6701ec44..0000000000 --- a/src/modules/peek/WIC/Constants/WICPixelFormat.cs +++ /dev/null @@ -1,98 +0,0 @@ -using System; - -namespace WIC.Constants -{ - public static class WICPixelFormat - { - public static readonly Guid WICPixelFormatDontCare = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x00); - public static readonly Guid WICPixelFormat1bppIndexed = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x01); - public static readonly Guid WICPixelFormat2bppIndexed = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x02); - public static readonly Guid WICPixelFormat4bppIndexed = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x03); - public static readonly Guid WICPixelFormat8bppIndexed = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x04); - public static readonly Guid WICPixelFormatBlackWhite = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x05); - public static readonly Guid WICPixelFormat2bppGray = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x06); - public static readonly Guid WICPixelFormat4bppGray = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x07); - public static readonly Guid WICPixelFormat8bppGray = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x08); - public static readonly Guid WICPixelFormat8bppAlpha = new Guid(0xe6cd0116, 0xeeba, 0x4161, 0xaa, 0x85, 0x27, 0xdd, 0x9f, 0xb3, 0xa8, 0x95); - public static readonly Guid WICPixelFormat16bppBGR555 = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x09); - public static readonly Guid WICPixelFormat16bppBGR565 = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0a); - public static readonly Guid WICPixelFormat16bppBGRA5551 = new Guid(0x05ec7c2b, 0xf1e6, 0x4961, 0xad, 0x46, 0xe1, 0xcc, 0x81, 0x0a, 0x87, 0xd2); - public static readonly Guid WICPixelFormat16bppGray = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0b); - public static readonly Guid WICPixelFormat24bppBGR = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0c); - public static readonly Guid WICPixelFormat24bppRGB = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0d); - public static readonly Guid WICPixelFormat32bppBGR = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0e); - public static readonly Guid WICPixelFormat32bppBGRA = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x0f); - public static readonly Guid WICPixelFormat32bppPBGRA = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x10); - public static readonly Guid WICPixelFormat32bppGrayFloat = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x11); - public static readonly Guid WICPixelFormat32bppRGB = new Guid(0xd98c6b95, 0x3efe, 0x47d6, 0xbb, 0x25, 0xeb, 0x17, 0x48, 0xab, 0x0c, 0xf1); - public static readonly Guid WICPixelFormat32bppRGBA = new Guid(0xf5c7ad2d, 0x6a8d, 0x43dd, 0xa7, 0xa8, 0xa2, 0x99, 0x35, 0x26, 0x1a, 0xe9); - public static readonly Guid WICPixelFormat32bppPRGBA = new Guid(0x3cc4a650, 0xa527, 0x4d37, 0xa9, 0x16, 0x31, 0x42, 0xc7, 0xeb, 0xed, 0xba); - public static readonly Guid WICPixelFormat48bppRGB = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x15); - public static readonly Guid WICPixelFormat48bppBGR = new Guid(0xe605a384, 0xb468, 0x46ce, 0xbb, 0x2e, 0x36, 0xf1, 0x80, 0xe6, 0x43, 0x13); - public static readonly Guid WICPixelFormat64bppRGB = new Guid(0xa1182111, 0x186d, 0x4d42, 0xbc, 0x6a, 0x9c, 0x83, 0x03, 0xa8, 0xdf, 0xf9); - public static readonly Guid WICPixelFormat64bppRGBA = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x16); - public static readonly Guid WICPixelFormat64bppBGRA = new Guid(0x1562ff7c, 0xd352, 0x46f9, 0x97, 0x9e, 0x42, 0x97, 0x6b, 0x79, 0x22, 0x46); - public static readonly Guid WICPixelFormat64bppPRGBA = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x17); - public static readonly Guid WICPixelFormat64bppPBGRA = new Guid(0x8c518e8e, 0xa4ec, 0x468b, 0xae, 0x70, 0xc9, 0xa3, 0x5a, 0x9c, 0x55, 0x30); - public static readonly Guid WICPixelFormat16bppGrayFixedPoint = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x13); - public static readonly Guid WICPixelFormat32bppBGR101010 = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x14); - public static readonly Guid WICPixelFormat48bppRGBFixedPoint = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x12); - public static readonly Guid WICPixelFormat48bppBGRFixedPoint = new Guid(0x49ca140e, 0xcab6, 0x493b, 0x9d, 0xdf, 0x60, 0x18, 0x7c, 0x37, 0x53, 0x2a); - public static readonly Guid WICPixelFormat96bppRGBFixedPoint = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x18); - public static readonly Guid WICPixelFormat96bppRGBFloat = new Guid(0xe3fed78f, 0xe8db, 0x4acf, 0x84, 0xc1, 0xe9, 0x7f, 0x61, 0x36, 0xb3, 0x27); - public static readonly Guid WICPixelFormat128bppRGBAFloat = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x19); - public static readonly Guid WICPixelFormat128bppPRGBAFloat = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1a); - public static readonly Guid WICPixelFormat128bppRGBFloat = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1b); - public static readonly Guid WICPixelFormat32bppCMYK = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1c); - public static readonly Guid WICPixelFormat64bppRGBAFixedPoint = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1d); - public static readonly Guid WICPixelFormat64bppBGRAFixedPoint = new Guid(0x356de33c, 0x54d2, 0x4a23, 0xbb, 0x4, 0x9b, 0x7b, 0xf9, 0xb1, 0xd4, 0x2d); - public static readonly Guid WICPixelFormat64bppRGBFixedPoint = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x40); - public static readonly Guid WICPixelFormat128bppRGBAFixedPoint = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1e); - public static readonly Guid WICPixelFormat128bppRGBFixedPoint = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x41); - public static readonly Guid WICPixelFormat64bppRGBAHalf = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3a); - public static readonly Guid WICPixelFormat64bppPRGBAHalf = new Guid(0x58ad26c2, 0xc623, 0x4d9d, 0xb3, 0x20, 0x38, 0x7e, 0x49, 0xf8, 0xc4, 0x42); - public static readonly Guid WICPixelFormat64bppRGBHalf = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x42); - public static readonly Guid WICPixelFormat48bppRGBHalf = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3b); - public static readonly Guid WICPixelFormat32bppRGBE = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3d); - public static readonly Guid WICPixelFormat16bppGrayHalf = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3e); - public static readonly Guid WICPixelFormat32bppGrayFixedPoint = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x3f); - public static readonly Guid WICPixelFormat32bppRGBA1010102 = new Guid(0x25238D72, 0xFCF9, 0x4522, 0xb5, 0x14, 0x55, 0x78, 0xe5, 0xad, 0x55, 0xe0); - public static readonly Guid WICPixelFormat32bppRGBA1010102XR = new Guid(0x00DE6B9A, 0xC101, 0x434b, 0xb5, 0x02, 0xd0, 0x16, 0x5e, 0xe1, 0x12, 0x2c); - public static readonly Guid WICPixelFormat32bppR10G10B10A2 = new Guid(0x604e1bb5, 0x8a3c, 0x4b65, 0xb1, 0x1c, 0xbc, 0x0b, 0x8d, 0xd7, 0x5b, 0x7f); - public static readonly Guid WICPixelFormat32bppR10G10B10A2HDR10 = new Guid(0x9c215c5d, 0x1acc, 0x4f0e, 0xa4, 0xbc, 0x70, 0xfb, 0x3a, 0xe8, 0xfd, 0x28); - public static readonly Guid WICPixelFormat64bppCMYK = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x1f); - public static readonly Guid WICPixelFormat24bpp3Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x20); - public static readonly Guid WICPixelFormat32bpp4Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x21); - public static readonly Guid WICPixelFormat40bpp5Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x22); - public static readonly Guid WICPixelFormat48bpp6Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x23); - public static readonly Guid WICPixelFormat56bpp7Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x24); - public static readonly Guid WICPixelFormat64bpp8Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x25); - public static readonly Guid WICPixelFormat48bpp3Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x26); - public static readonly Guid WICPixelFormat64bpp4Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x27); - public static readonly Guid WICPixelFormat80bpp5Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x28); - public static readonly Guid WICPixelFormat96bpp6Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x29); - public static readonly Guid WICPixelFormat112bpp7Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2a); - public static readonly Guid WICPixelFormat128bpp8Channels = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2b); - public static readonly Guid WICPixelFormat40bppCMYKAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2c); - public static readonly Guid WICPixelFormat80bppCMYKAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2d); - public static readonly Guid WICPixelFormat32bpp3ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2e); - public static readonly Guid WICPixelFormat40bpp4ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x2f); - public static readonly Guid WICPixelFormat48bpp5ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x30); - public static readonly Guid WICPixelFormat56bpp6ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x31); - public static readonly Guid WICPixelFormat64bpp7ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x32); - public static readonly Guid WICPixelFormat72bpp8ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x33); - public static readonly Guid WICPixelFormat64bpp3ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x34); - public static readonly Guid WICPixelFormat80bpp4ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x35); - public static readonly Guid WICPixelFormat96bpp5ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x36); - public static readonly Guid WICPixelFormat112bpp6ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x37); - public static readonly Guid WICPixelFormat128bpp7ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x38); - public static readonly Guid WICPixelFormat144bpp8ChannelsAlpha = new Guid(0x6fddc324, 0x4e03, 0x4bfe, 0xb1, 0x85, 0x3d, 0x77, 0x76, 0x8d, 0xc9, 0x39); - public static readonly Guid WICPixelFormat8bppY = new Guid(0x91B4DB54, 0x2DF9, 0x42F0, 0xB4, 0x49, 0x29, 0x09, 0xBB, 0x3D, 0xF8, 0x8E); - public static readonly Guid WICPixelFormat8bppCb = new Guid(0x1339F224, 0x6BFE, 0x4C3E, 0x93, 0x02, 0xE4, 0xF3, 0xA6, 0xD0, 0xCA, 0x2A); - public static readonly Guid WICPixelFormat8bppCr = new Guid(0xB8145053, 0x2116, 0x49F0, 0x88, 0x35, 0xED, 0x84, 0x4B, 0x20, 0x5C, 0x51); - public static readonly Guid WICPixelFormat16bppCbCr = new Guid(0xFF95BA6E, 0x11E0, 0x4263, 0xBB, 0x45, 0x01, 0x72, 0x1F, 0x34, 0x60, 0xA4); - public static readonly Guid WICPixelFormat16bppYQuantizedDctCoefficients = new Guid(0xA355F433, 0x48E8, 0x4A42, 0x84, 0xD8, 0xE2, 0xAA, 0x26, 0xCA, 0x80, 0xA4); - public static readonly Guid WICPixelFormat16bppCbQuantizedDctCoefficients = new Guid(0xD2C4FF61, 0x56A5, 0x49C2, 0x8B, 0x5C, 0x4C, 0x19, 0x25, 0x96, 0x48, 0x37); - public static readonly Guid WICPixelFormat16bppCrQuantizedDctCoefficients = new Guid(0x2FE354F0, 0x1680, 0x42D8, 0x92, 0x31, 0xE7, 0x3C, 0x05, 0x65, 0xBF, 0xC1); - } -} diff --git a/src/modules/peek/WIC/Enumerations/ExifColorSpace.cs b/src/modules/peek/WIC/Enumerations/ExifColorSpace.cs deleted file mode 100644 index ebf6047cbb..0000000000 --- a/src/modules/peek/WIC/Enumerations/ExifColorSpace.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace WIC -{ - public enum ExifColorSpace : int - { - SRGB = 1, - AdobeSRGB = 2, - } -} diff --git a/src/modules/peek/WIC/Enumerations/LOCKTYPE.cs b/src/modules/peek/WIC/Enumerations/LOCKTYPE.cs deleted file mode 100644 index 9ce372bb98..0000000000 --- a/src/modules/peek/WIC/Enumerations/LOCKTYPE.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; -using System.ComponentModel; - -namespace WIC -{ - [Flags] - [EditorBrowsable(EditorBrowsableState.Advanced)] - public enum LOCKTYPE : int - { - LOCK_WRITE = 1, - LOCK_EXCLUSIVE = 2, - LOCK_ONLYONCE = 4, - } -} diff --git a/src/modules/peek/WIC/Enumerations/MetadataCreationAndPersistOptions.cs b/src/modules/peek/WIC/Enumerations/MetadataCreationAndPersistOptions.cs deleted file mode 100644 index 01a10508ac..0000000000 --- a/src/modules/peek/WIC/Enumerations/MetadataCreationAndPersistOptions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum MetadataCreationAndPersistOptions : int - { - WICMetadataCreationDefault = 0x00000000, - WICMetadataCreationAllowUnknown = WICMetadataCreationDefault, - WICMetadataCreationFailUnknown = 0x00010000, - - WICPersistOptionDefault = 0x00000000, - WICPersistOptionLittleEndian = 0x00000000, - WICPersistOptionBigEndian = 0x00000001, - WICPersistOptionStrictFormat = 0x00000002, - WICPersistOptionNoCacheStream = 0x00000004, - WICPersistOptionPreferUTF8 = 0x00000008, - } -} diff --git a/src/modules/peek/WIC/Enumerations/STATFLAG.cs b/src/modules/peek/WIC/Enumerations/STATFLAG.cs deleted file mode 100644 index 8f6afee364..0000000000 --- a/src/modules/peek/WIC/Enumerations/STATFLAG.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public enum STATFLAG : int - { - STATFLAG_DEFAULT = 0, - STATFLAG_NONAME = 1, - STATFLAG_NOOPEN = 2, - } -} diff --git a/src/modules/peek/WIC/Enumerations/STGC.cs b/src/modules/peek/WIC/Enumerations/STGC.cs deleted file mode 100644 index 4010f835f5..0000000000 --- a/src/modules/peek/WIC/Enumerations/STGC.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.ComponentModel; - -namespace WIC -{ - [Flags] - [EditorBrowsable(EditorBrowsableState.Advanced)] - public enum STGC : int - { - STGC_DEFAULT = 0, - STGC_OVERWRITE = 1, - STGC_ONLYIFCURRENT = 2, - STGC_DANGEROUSLYCOMMITMERELYTODISKCACHE = 4, - STGC_CONSOLIDATE = 8, - } -} diff --git a/src/modules/peek/WIC/Enumerations/STGM.cs b/src/modules/peek/WIC/Enumerations/STGM.cs deleted file mode 100644 index 03cdb33e0b..0000000000 --- a/src/modules/peek/WIC/Enumerations/STGM.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.ComponentModel; - -namespace WIC -{ - [Flags] - [EditorBrowsable(EditorBrowsableState.Advanced)] - public enum STGM : int - { - STGM_READ = 0x00000000, - STGM_WRITE = 0x00000001, - STGM_READWRITE = 0x00000002, - #warning `STGM`: Enumeration incomplete. Consider adding all values. - } -} diff --git a/src/modules/peek/WIC/Enumerations/STGTY.cs b/src/modules/peek/WIC/Enumerations/STGTY.cs deleted file mode 100644 index 989332553b..0000000000 --- a/src/modules/peek/WIC/Enumerations/STGTY.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public enum STGTY : int - { - STGTY_STORAGE = 1, - STGTY_STREAM = 2, - STGTY_LOCKBYTES = 3, - STGTY_PROPERTY = 4, - } -} diff --git a/src/modules/peek/WIC/Enumerations/STREAM_SEEK.cs b/src/modules/peek/WIC/Enumerations/STREAM_SEEK.cs deleted file mode 100644 index e92c2aab92..0000000000 --- a/src/modules/peek/WIC/Enumerations/STREAM_SEEK.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public enum STREAM_SEEK : int - { - STREAM_SEEK_SET = 0, - STREAM_SEEK_CUR = 1, - STREAM_SEEK_END = 2, - } -} diff --git a/src/modules/peek/WIC/Enumerations/StreamAccessMode.cs b/src/modules/peek/WIC/Enumerations/StreamAccessMode.cs deleted file mode 100644 index e79321d0df..0000000000 --- a/src/modules/peek/WIC/Enumerations/StreamAccessMode.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum StreamAccessMode : int - { - GENERIC_WRITE = 0x40000000, - GENERIC_READ = unchecked((int)0x80000000U), - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapAlphaChannelOption.cs b/src/modules/peek/WIC/Enumerations/WICBitmapAlphaChannelOption.cs deleted file mode 100644 index 4623c5605e..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapAlphaChannelOption.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace WIC -{ - public enum WICBitmapAlphaChannelOption : int - { - WICBitmapUseAlpha = 0x00000000, - WICBitmapUsePremultipliedAlpha = 0x00000001, - WICBitmapIgnoreAlpha = 0x00000002, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapCreateCacheOption.cs b/src/modules/peek/WIC/Enumerations/WICBitmapCreateCacheOption.cs deleted file mode 100644 index 09bf9b71ea..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapCreateCacheOption.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace WIC -{ - public enum WICBitmapCreateCacheOption : int - { - WICBitmapNoCache = 0x00000000, - WICBitmapCacheOnDemand = 0x00000001, - WICBitmapCacheOnLoad = 0x00000002, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapDecoderCapabilities.cs b/src/modules/peek/WIC/Enumerations/WICBitmapDecoderCapabilities.cs deleted file mode 100644 index 19b9c30652..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapDecoderCapabilities.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum WICBitmapDecoderCapabilities : int - { - WICBitmapDecoderCapabilitySameEncoder = 0x00000001, - WICBitmapDecoderCapabilityCanDecodeAllImages = 0x00000002, - WICBitmapDecoderCapabilityCanDecodeSomeImages = 0x00000004, - WICBitmapDecoderCapabilityCanEnumerateMetadata = 0x00000008, - WICBitmapDecoderCapabilityCanDecodeThumbnail = 0x00000010, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapDitherType.cs b/src/modules/peek/WIC/Enumerations/WICBitmapDitherType.cs deleted file mode 100644 index c9441c6686..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapDitherType.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace WIC -{ - public enum WICBitmapDitherType : int - { - WICBitmapDitherTypeNone = 0x00000000, - WICBitmapDitherTypeSolid = 0x00000000, - - WICBitmapDitherTypeOrdered4x4 = 0x00000001, - - WICBitmapDitherTypeOrdered8x8 = 0x00000002, - WICBitmapDitherTypeOrdered16x16 = 0x00000003, - WICBitmapDitherTypeSpiral4x4 = 0x00000004, - WICBitmapDitherTypeSpiral8x8 = 0x00000005, - WICBitmapDitherTypeDualSpiral4x4 = 0x00000006, - WICBitmapDitherTypeDualSpiral8x8 = 0x00000007, - - WICBitmapDitherTypeErrorDiffusion = 0x00000008, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapEncoderCacheOption.cs b/src/modules/peek/WIC/Enumerations/WICBitmapEncoderCacheOption.cs deleted file mode 100644 index 922235cfee..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapEncoderCacheOption.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace WIC -{ - public enum WICBitmapEncoderCacheOption : int - { - WICBitmapEncoderCacheInMemory = 0x00000000, - WICBitmapEncoderCacheTempFile = 0x00000001, - WICBitmapEncoderNoCache = 0x00000002, - } -} \ No newline at end of file diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapInterpolationMode.cs b/src/modules/peek/WIC/Enumerations/WICBitmapInterpolationMode.cs deleted file mode 100644 index 85a17f4f48..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapInterpolationMode.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace WIC -{ - public enum WICBitmapInterpolationMode : int - { - WICBitmapInterpolationModeNearestNeighbor = 0x00000000, - WICBitmapInterpolationModeLinear = 0x00000001, - WICBitmapInterpolationModeCubic = 0x00000002, - WICBitmapInterpolationModeFant = 0x00000003, - /// - /// Supported beginning with Windows 10. - /// - WICBitmapInterpolationModeHighQualityCubic = 0x00000004, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapLockFlags.cs b/src/modules/peek/WIC/Enumerations/WICBitmapLockFlags.cs deleted file mode 100644 index 06ff6ebde1..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapLockFlags.cs +++ /dev/null @@ -1,11 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum WICBitmapLockFlags : int - { - WICBitmapLockRead = 0x00000001, - WICBitmapLockWrite = 0x00000002, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapPaletteType.cs b/src/modules/peek/WIC/Enumerations/WICBitmapPaletteType.cs deleted file mode 100644 index 4a7a81bf72..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapPaletteType.cs +++ /dev/null @@ -1,20 +0,0 @@ -namespace WIC -{ - public enum WICBitmapPaletteType : int - { - WICBitmapPaletteTypeCustom = 0x00000000, - WICBitmapPaletteTypeMedianCut = 0x00000001, - WICBitmapPaletteTypeFixedBW = 0x00000002, - WICBitmapPaletteTypeFixedHalftone8 = 0x00000003, - WICBitmapPaletteTypeFixedHalftone27 = 0x00000004, - WICBitmapPaletteTypeFixedHalftone64 = 0x00000005, - WICBitmapPaletteTypeFixedHalftone125 = 0x00000006, - WICBitmapPaletteTypeFixedHalftone216 = 0x00000007, - WICBitmapPaletteTypeFixedWebPalette = WICBitmapPaletteTypeFixedHalftone216, - WICBitmapPaletteTypeFixedHalftone252 = 0x00000008, - WICBitmapPaletteTypeFixedHalftone256 = 0x00000009, - WICBitmapPaletteTypeFixedGray4 = 0x0000000A, - WICBitmapPaletteTypeFixedGray16 = 0x0000000B, - WICBitmapPaletteTypeFixedGray256 = 0x0000000C, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICBitmapTransformOptions.cs b/src/modules/peek/WIC/Enumerations/WICBitmapTransformOptions.cs deleted file mode 100644 index 474d7480c3..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICBitmapTransformOptions.cs +++ /dev/null @@ -1,17 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum WICBitmapTransformOptions : int - { - WICBitmapTransformRotate0 = 0x00000000, - WICBitmapTransformRotate90 = 0x00000001, - WICBitmapTransformRotate180 = 0x00000002, - WICBitmapTransformRotate270 = 0x00000003, - - WICBitmapTransformFlipHorizontal = 0x00000008, - - WICBitmapTransformFlipVertical = 0x00000010, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICColorContextType.cs b/src/modules/peek/WIC/Enumerations/WICColorContextType.cs deleted file mode 100644 index 836f88d9fa..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICColorContextType.cs +++ /dev/null @@ -1,9 +0,0 @@ -namespace WIC -{ - public enum WICColorContextType : int - { - WICColorContextUninitialized = 0x00000000, - WICColorContextProfile = 0x00000001, - WICColorContextExifColorSpace = 0x00000002, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICComponentEnumerateOptions.cs b/src/modules/peek/WIC/Enumerations/WICComponentEnumerateOptions.cs deleted file mode 100644 index 2159ac2b8d..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICComponentEnumerateOptions.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum WICComponentEnumerateOptions : int - { - WICComponentEnumerateDefault = 0x00000000, - WICComponentEnumerateRefresh = 0x00000001, - WICComponentEnumerateBuiltInOnly = 0x20000000, - WICComponentEnumerateUnsigned = 0x40000000, - WICComponentEnumerateDisabled = unchecked((int)0x80000000U), - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICComponentSigning.cs b/src/modules/peek/WIC/Enumerations/WICComponentSigning.cs deleted file mode 100644 index 68bc08516f..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICComponentSigning.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum WICComponentSigning : int - { - WICComponentSigned = 0x00000001, - WICComponentUnsigned = 0x00000002, - WICComponentSafe = 0x00000004, - WICComponentDisabled = unchecked((int)0x80000000U), - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICComponentType.cs b/src/modules/peek/WIC/Enumerations/WICComponentType.cs deleted file mode 100644 index 0448c85129..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICComponentType.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum WICComponentType : int - { - WICDecoder = 0x00000001, - WICEncoder = 0x00000002, - WICPixelFormatConverter = 0x00000004, - WICMetadataReader = 0x00000008, - WICMetadataWriter = 0x00000010, - WICPixelFormat = 0x00000020, - WICAllComponents = 0x0000003F, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICDecodeOptions.cs b/src/modules/peek/WIC/Enumerations/WICDecodeOptions.cs deleted file mode 100644 index 84ba889161..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICDecodeOptions.cs +++ /dev/null @@ -1,8 +0,0 @@ -namespace WIC -{ - public enum WICDecodeOptions : int - { - WICDecodeMetadataCacheOnDemand = 0x00000000, - WICDecodeMetadataCacheOnLoad = 0x00000001, - } -} diff --git a/src/modules/peek/WIC/Enumerations/WICMetadataCreationOptions.cs b/src/modules/peek/WIC/Enumerations/WICMetadataCreationOptions.cs deleted file mode 100644 index f6c2bc3c2b..0000000000 --- a/src/modules/peek/WIC/Enumerations/WICMetadataCreationOptions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum WICMetadataCreationOptions : int - { - WICMetadataCreationDefault = 0x00000000, - WICMetadataCreationAllowUnknown = WICMetadataCreationDefault, - WICMetadataCreationFailUnknown = 0x00010000, - WICMetadataCreationMask = unchecked((int)0xFFFF0000), - } -} diff --git a/src/modules/peek/WIC/Extensions/IEnumStringExtensions.cs b/src/modules/peek/WIC/Extensions/IEnumStringExtensions.cs deleted file mode 100644 index 35c507c365..0000000000 --- a/src/modules/peek/WIC/Extensions/IEnumStringExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IEnumStringExtensions - { - public static IEnumerable AsEnumerable(this IEnumString enumString) - { - var buffer = new string[1]; - for (;;) - { - int length; - enumString.Next(1, buffer, out length); - if (length != 1) break; - yield return buffer[0]; - } - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IEnumUnknownExtensions.cs b/src/modules/peek/WIC/Extensions/IEnumUnknownExtensions.cs deleted file mode 100644 index a581a343e6..0000000000 --- a/src/modules/peek/WIC/Extensions/IEnumUnknownExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IEnumUnknownExtensions - { - public static IEnumerable AsEnumerable(this IEnumUnknown enumUnknown) - { - var buffer = new object[1]; - for (;;) - { - int length; - enumUnknown.Next(1, buffer, out length); - if (length != 1) break; - yield return buffer[0]; - } - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IStreamExtensions.cs b/src/modules/peek/WIC/Extensions/IStreamExtensions.cs deleted file mode 100644 index fdbec608e9..0000000000 --- a/src/modules/peek/WIC/Extensions/IStreamExtensions.cs +++ /dev/null @@ -1,67 +0,0 @@ -using System; -using System.ComponentModel; -using Marshal = System.Runtime.InteropServices.Marshal; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IStreamExtensions - { - public static void Read(this IStream stream, byte[] pv, int cb) - { - stream.Read(pv, cb, IntPtr.Zero); - } - - public static void Read(this IStream stream, byte[] pv, int cb, out int pcbRead) - { - var pcbReadPtr = Marshal.AllocCoTaskMem(4); - try - { - stream.Read(pv, cb, pcbReadPtr); - pcbRead = Marshal.ReadInt32(pcbReadPtr); - } - finally - { - Marshal.FreeCoTaskMem(pcbReadPtr); - } - } - - public static void Seek(this IStream stream, long dlibMove, STREAM_SEEK dwOrigin) - { - stream.Seek(dlibMove, dwOrigin, IntPtr.Zero); - } - - public static void Seek(this IStream stream, long dlibMove, STREAM_SEEK dwOrigin, out long plibNewPosition) - { - var plibNewPositionPtr = Marshal.AllocCoTaskMem(8); - try - { - stream.Seek(dlibMove, dwOrigin, plibNewPositionPtr); - plibNewPosition = Marshal.ReadInt64(plibNewPositionPtr, 0); - } - finally - { - Marshal.FreeCoTaskMem(plibNewPositionPtr); - } - } - - public static void Write(this IStream stream, byte[] pv, int cb) - { - stream.Write(pv, cb, IntPtr.Zero); - } - - public static void Write(this IStream stream, byte[] pv, int cb, out int pcbWritten) - { - var pcbWrittenPtr = Marshal.AllocCoTaskMem(4); - try - { - stream.Read(pv, cb, pcbWrittenPtr); - pcbWritten = Marshal.ReadInt32(pcbWrittenPtr); - } - finally - { - Marshal.FreeCoTaskMem(pcbWrittenPtr); - } - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapCodecInfoExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapCodecInfoExtensions.cs deleted file mode 100644 index d411d7fd04..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapCodecInfoExtensions.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapCodecInfoExtensions - { - public static string GetColorManagementVersion(this IWICBitmapCodecInfo bitmapCodecInfo) - { - FetchIntoBuffer fetcher = bitmapCodecInfo.GetColorManagementVersion; - return fetcher.FetchString(); - } - - public static string GetDeviceManufacturer(this IWICBitmapCodecInfo bitmapCodecInfo) - { - FetchIntoBuffer fetcher = bitmapCodecInfo.GetDeviceManufacturer; - return fetcher.FetchString(); - } - - public static string GetDeviceModels(this IWICBitmapCodecInfo bitmapCodecInfo) - { - FetchIntoBuffer fetcher = bitmapCodecInfo.GetDeviceModels; - return fetcher.FetchString(); - } - - public static string[] GetMimeTypes(this IWICBitmapCodecInfo bitmapCodecInfo) - { - FetchIntoBuffer fetcher = bitmapCodecInfo.GetMimeTypes; - return fetcher.FetchString().Split(','); - } - - public static string[] GetFileExtensions(this IWICBitmapCodecInfo bitmapCodecInfo) - { - FetchIntoBuffer fetcher = bitmapCodecInfo.GetFileExtensions; - return fetcher.FetchString().Split(','); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapDecoderExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapDecoderExtensions.cs deleted file mode 100644 index d0ce32611b..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapDecoderExtensions.cs +++ /dev/null @@ -1,34 +0,0 @@ -using System.Collections.Generic; -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapDecoderExtensions - { - public static IWICMetadataBlockReader AsMetadataBlockReader(this IWICBitmapDecoder bitmapDecoder) - { - return bitmapDecoder as IWICMetadataBlockReader; - } - - public static IWICColorContext[] GetColorContexts(this IWICBitmapDecoder bitmapDecoder) - { - int length; - bitmapDecoder.GetColorContexts(0, null, out length); - var colorContexts = new IWICColorContext[length]; - if (length > 0) - { - bitmapDecoder.GetColorContexts(length, colorContexts, out length); - } - return colorContexts; - } - - public static IEnumerable GetFrames(this IWICBitmapDecoder bitmapDecoder) - { - for (int i = 0, n = bitmapDecoder.GetFrameCount(); i < n; ++i) - { - yield return bitmapDecoder.GetFrame(i); - } - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapDecoderInfoExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapDecoderInfoExtensions.cs deleted file mode 100644 index 2b2f37ff26..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapDecoderInfoExtensions.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapDecoderInfoExtensions - { - public static WICBitmapPattern[] GetPatterns(this IWICBitmapDecoderInfo bitmapDecoderInfo) - { - int count; - int size; - bitmapDecoderInfo.GetPatterns(0, IntPtr.Zero, out count, out size); - if (count == 0) - { - return new WICBitmapPattern[0]; - } - using (var buffer = new CoTaskMemPtr(Marshal.AllocCoTaskMem(size))) - { - bitmapDecoderInfo.GetPatterns(size, buffer, out count, out size); - IntPtr at = buffer; - var patterns = new WICBitmapPattern[count]; - for (int i = 0, stride = Marshal.SizeOf(typeof(WICBitmapPatternRaw)); i < count; ++i, at += stride) - { - var raw = (WICBitmapPatternRaw)Marshal.PtrToStructure(at, typeof(WICBitmapPatternRaw)); - int length = raw.Length; - patterns[i] = new WICBitmapPattern() - { - Length = length, - Position = raw.Position, - Pattern = new byte[length], - Mask = new byte[length], - EndOfStream = raw.EndOfStream - }; - Marshal.Copy(raw.Pattern, patterns[i].Pattern, 0, length); - Marshal.Copy(raw.Mask, patterns[i].Mask, 0, length); - } - return patterns; - } - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapEncoderExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapEncoderExtensions.cs deleted file mode 100644 index b0df316ba7..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapEncoderExtensions.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapEncoderExtensions - { - public static IWICMetadataBlockWriter AsMetadataBlockWriter(this IWICBitmapEncoder bitmapEncoder) - { - return bitmapEncoder as IWICMetadataBlockWriter; - } - - public static IWICBitmapFrameEncode CreateNewFrame(this IWICBitmapEncoder bitmapEncoder, IPropertyBag2 ppIEncoderOptions = null) - { - IWICBitmapFrameEncode ppIFrameEncode; - bitmapEncoder.CreateNewFrame(out ppIFrameEncode, ppIEncoderOptions); - return ppIFrameEncode; - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapExtensions.cs deleted file mode 100644 index e98916a0df..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapExtensions.cs +++ /dev/null @@ -1,21 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapExtensions - { - public static IWICBitmapLock Lock(this IWICBitmap bitmap, WICBitmapLockFlags flags, WICRect? prcLock = null) - { - using (var prcLockPtr = CoTaskMemPtr.From(prcLock)) - { - return bitmap.Lock(prcLockPtr, flags); - } - } - - public static void SetResolution(this IWICBitmap bitmap, Resolution resolution) - { - bitmap.SetResolution(resolution.DpiX, resolution.DpiY); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapFrameDecodeExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapFrameDecodeExtensions.cs deleted file mode 100644 index 3504168845..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapFrameDecodeExtensions.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapFrameDecodeExtensions - { - public static IWICMetadataBlockReader AsMetadataBlockReader(this IWICBitmapFrameDecode bitmapFrameDecode) - { - return bitmapFrameDecode as IWICMetadataBlockReader; - } - - public static IWICColorContext[] GetColorContexts(this IWICBitmapFrameDecode bitmapFrameDecode) - { - FetchIntoBuffer fetcher = bitmapFrameDecode.GetColorContexts; - return fetcher.FetchArray(); - } - - public static void Initialize(this IWICBitmapFrameEncode bitmapFrameEncode, IPropertyBag2 pIEncoderOptions = null) - { - bitmapFrameEncode.Initialize(pIEncoderOptions); - } - - public static void WriteSource(this IWICBitmapFrameEncode bitmapFrameEncode, IWICBitmapSource pIBitmapSource, WICRect? prc = null) - { - using (var prcPtr = CoTaskMemPtr.From(prc)) - { - bitmapFrameEncode.WriteSource(pIBitmapSource, prcPtr); - } - } - - public static void WritePixels(this IWICBitmapFrameEncode bitmapFrameEncode, int lineCount, int cbStride, byte[] pbPixels) - { - bitmapFrameEncode.WritePixels(lineCount, cbStride, pbPixels.Length, pbPixels); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapFrameEncodeExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapFrameEncodeExtensions.cs deleted file mode 100644 index 1945fad163..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapFrameEncodeExtensions.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapFrameEncodeExtensions - { - public static IWICMetadataBlockWriter AsMetadataBlockWriter(this IWICBitmapFrameEncode bitmapFrameEncode) - { - return bitmapFrameEncode as IWICMetadataBlockWriter; - } - - public static void Initialize(this IWICBitmapFrameEncode bitmapFrameEncode, IPropertyBag2 pIEncoderOptions = null) - { - bitmapFrameEncode.Initialize(pIEncoderOptions); - } - - public static void SetColorContexts(this IWICBitmapFrameEncode bitmapFrameEncode, IWICColorContext[] colorContexts) - { - bitmapFrameEncode.SetColorContexts(colorContexts.Length, colorContexts); - } - - public static void SetResolution(this IWICBitmapFrameEncode bitmapFrameEncode, Resolution resolution) - { - bitmapFrameEncode.SetResolution(resolution.DpiX, resolution.DpiY); - } - - public static void SetSize(this IWICBitmapFrameEncode bitmapFrameEncode, Size size) - { - bitmapFrameEncode.SetSize(size.Width, size.Height); - } - - public static void WriteSource(this IWICBitmapFrameEncode bitmapFrameEncode, IWICBitmapSource pIBitmapSource, WICRect? prc = null) - { - using (var prcPtr = CoTaskMemPtr.From(prc)) - { - bitmapFrameEncode.WriteSource(pIBitmapSource, prcPtr); - } - } - - public static void WritePixels(this IWICBitmapFrameEncode bitmapFrameEncode, int lineCount, int cbStride, byte[] pbPixels) - { - bitmapFrameEncode.WritePixels(lineCount, cbStride, pbPixels.Length, pbPixels); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapLockExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapLockExtensions.cs deleted file mode 100644 index 433afd9787..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapLockExtensions.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapLockExtensions - { - public static Size GetSize(this IWICBitmapLock bitmapLock) - { - int width, height; - bitmapLock.GetSize(out width, out height); - return new Size(width, height); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapScalerExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapScalerExtensions.cs deleted file mode 100644 index aaed69c46f..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapScalerExtensions.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapScalerExtensions - { - public static void Initialize(this IWICBitmapScaler bitmapScaler, IWICBitmapSource pISource, Size size, WICBitmapInterpolationMode mode) - { - bitmapScaler.Initialize(pISource, size.Width, size.Height, mode); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICBitmapSourceExtensions.cs b/src/modules/peek/WIC/Extensions/IWICBitmapSourceExtensions.cs deleted file mode 100644 index 54e9f57e3f..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICBitmapSourceExtensions.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICBitmapSourceExtensions - { - public static void CopyPixels(this IWICBitmapSource bitmapSource, int cbStride, byte[] pbBuffer, WICRect? prc = null) - { - using (var prcPtr = CoTaskMemPtr.From(prc)) - { - bitmapSource.CopyPixels(prcPtr, cbStride, pbBuffer.Length, pbBuffer); - } - } - - public static Size GetSize(this IWICBitmapSource bitmapSource) - { - int width, height; - bitmapSource.GetSize(out width, out height); - return new Size(width, height); - } - - public static Resolution GetResolution(this IWICBitmapSource bitmapSource) - { - double dpiX, dpiY; - bitmapSource.GetResolution(out dpiX, out dpiY); - return new Resolution(dpiX, dpiY); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICColorContextExtensions.cs b/src/modules/peek/WIC/Extensions/IWICColorContextExtensions.cs deleted file mode 100644 index 1d9b8498ec..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICColorContextExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICColorContextExtensions - { - public static void InitializeFromMemory(this IWICColorContext colorContext, byte[] pbBuffer) - { - colorContext.InitializeFromMemory(pbBuffer, pbBuffer.Length); - } - - public static byte[] GetProfileBytes(this IWICColorContext colorContext) - { - FetchIntoBuffer fetcher = colorContext.GetProfileBytes; - return fetcher.FetchArray(); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICComponentInfoExtensions.cs b/src/modules/peek/WIC/Extensions/IWICComponentInfoExtensions.cs deleted file mode 100644 index 29fe3c50d0..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICComponentInfoExtensions.cs +++ /dev/null @@ -1,32 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICComponentInfoExtensions - { - public static string GetAuthor(this IWICComponentInfo componentInfo) - { - FetchIntoBuffer fetcher = componentInfo.GetAuthor; - return fetcher.FetchString(); - } - - public static string GetFriendlyName(this IWICComponentInfo componentInfo) - { - FetchIntoBuffer fetcher = componentInfo.GetFriendlyName; - return fetcher.FetchString(); - } - - public static string GetVersion(this IWICComponentInfo componentInfo) - { - FetchIntoBuffer fetcher = componentInfo.GetVersion; - return fetcher.FetchString(); - } - - public static string GetSpecVersion(this IWICComponentInfo componentInfo) - { - FetchIntoBuffer fetcher = componentInfo.GetSpecVersion; - return fetcher.FetchString(); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICFormatConverterInfoExtensions.cs b/src/modules/peek/WIC/Extensions/IWICFormatConverterInfoExtensions.cs deleted file mode 100644 index 30581a1d63..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICFormatConverterInfoExtensions.cs +++ /dev/null @@ -1,16 +0,0 @@ -using System; -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICFormatConverterInfoExtensions - { - public static Guid[] GetPixelFormats(this IWICFormatConverterInfo formatConverterInfo) - { - FetchIntoBuffer fetcher = formatConverterInfo.GetPixelFormats; - return fetcher.FetchArray(); - } - - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICImagingFactoryExtensions.cs b/src/modules/peek/WIC/Extensions/IWICImagingFactoryExtensions.cs deleted file mode 100644 index a266a0e7ed..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICImagingFactoryExtensions.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICImagingFactoryExtensions - { - public static IWICBitmap CreateBitmap(this IWICImagingFactory imagingFactory, Size size, Guid pixelFormat, WICBitmapCreateCacheOption option) - { - return imagingFactory.CreateBitmap(size.Width, size.Height, pixelFormat, option); - } - - public static IWICBitmap CreateBitmapFromSourceRect(this IWICImagingFactory imagingFactory, IWICBitmapSource pIBitmapSource, WICRect rect) - { - return imagingFactory.CreateBitmapFromSourceRect(pIBitmapSource, rect.X, rect.Y, rect.Width, rect.Height); - } - - public static IWICBitmap CreateBitmapFromMemory(this IWICImagingFactory imagingFactory, Size size, Guid pixelFormat, int cbStride, byte[] pbBuffer) - { - return imagingFactory.CreateBitmapFromMemory(size.Width, size.Height, pixelFormat, cbStride, pbBuffer.Length, pbBuffer); - } - - public static IWICBitmapDecoder CreateDecoder(this IWICImagingFactory imagingFactory, Guid guidContainerFormat, Guid? pguidVendor = null) - { - using (var pguidVendorPtr = CoTaskMemPtr.From(pguidVendor)) - { - return imagingFactory.CreateDecoder(guidContainerFormat, pguidVendorPtr); - } - } - - public static IWICBitmapDecoder CreateDecoderFromFileHandle(this IWICImagingFactory imagingFactory, IntPtr hFile, WICDecodeOptions metadataOptions, Guid? pguidVendor = null) - { - using (var pguidVendorPtr = CoTaskMemPtr.From(pguidVendor)) - { - return imagingFactory.CreateDecoderFromFileHandle(hFile, pguidVendorPtr, metadataOptions); - } - } - - public static IWICBitmapDecoder CreateDecoderFromFilename(this IWICImagingFactory imagingFactory, string wzFilename, Guid? pguidVendor = null, WICDecodeOptions metadataOptions = WICDecodeOptions.WICDecodeMetadataCacheOnDemand) - { - using (var pguidVendorPtr = CoTaskMemPtr.From(pguidVendor)) - { - return imagingFactory.CreateDecoderFromFilename(wzFilename, pguidVendorPtr, StreamAccessMode.GENERIC_READ, metadataOptions); - } - } - - public static IWICBitmapDecoder CreateDecoderFromStream(this IWICImagingFactory imagingFactory, IStream pIStream, WICDecodeOptions metadataOptions, Guid? pguidVendor = null) - { - using (var pguidVendorPtr = CoTaskMemPtr.From(pguidVendor)) - { - return imagingFactory.CreateDecoderFromStream(pIStream, pguidVendorPtr, metadataOptions); - } - } - - public static IWICBitmapEncoder CreateEncoder(this IWICImagingFactory factory, Guid guidContainerFormat, Guid? pguidVendor = null) - { - using (var pguidVendorPtr = CoTaskMemPtr.From(pguidVendor)) - { - return factory.CreateEncoder(guidContainerFormat, pguidVendorPtr); - } - } - - public static IWICMetadataQueryWriter CreateQueryWriter(this IWICImagingFactory imagingFactory, Guid guidMetadataFormat, Guid? pguidVendor = null) - { - using (var pguidVendorPtr = CoTaskMemPtr.From(pguidVendor)) - { - return imagingFactory.CreateQueryWriter(guidMetadataFormat, pguidVendorPtr); - } - } - - public static IWICMetadataQueryWriter CreateQueryWriterFromReader(this IWICImagingFactory imagingFactory, IWICMetadataQueryReader pIQueryReader, Guid? pguidVendor = null) - { - using (var pguidVendorPtr = CoTaskMemPtr.From(pguidVendor)) - { - return imagingFactory.CreateQueryWriterFromReader(pIQueryReader, pguidVendorPtr); - } - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICMetadataHandlerInfoExtensions.cs b/src/modules/peek/WIC/Extensions/IWICMetadataHandlerInfoExtensions.cs deleted file mode 100644 index b503d2c40a..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICMetadataHandlerInfoExtensions.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICMetadataHandlerInfoExtensions - { - public static Guid[] GetContainerFormats(this IWICMetadataHandlerInfo metadataHandlerInfo) - { - FetchIntoBuffer fetcher = metadataHandlerInfo.GetContainerFormats; - return fetcher.FetchArray(); - } - - public static string GetDeviceManufacturer(this IWICMetadataHandlerInfo metadataHandlerInfo) - { - FetchIntoBuffer fetcher = metadataHandlerInfo.GetDeviceManufacturer; - return fetcher.FetchString(); - } - - public static string GetDeviceModels(this IWICMetadataHandlerInfo metadataHandlerInfo) - { - FetchIntoBuffer fetcher = metadataHandlerInfo.GetDeviceModels; - return fetcher.FetchString(); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICMetadataQueryReaderExtensions.cs b/src/modules/peek/WIC/Extensions/IWICMetadataQueryReaderExtensions.cs deleted file mode 100644 index a8a549087b..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICMetadataQueryReaderExtensions.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.ComponentModel; -using System.Runtime.InteropServices; -using static WIC.PropVariantHelpers; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICMetadataQueryReaderExtensions - { - public static string GetLocation(this IWICMetadataQueryReader metadataQueryReader) - { - FetchIntoBuffer fetcher = metadataQueryReader.GetLocation; - return fetcher.FetchString(); - } - - public static bool TryGetMetadataByName(this IWICMetadataQueryReader metadataQueryReader, string name, out T value) - { - var variant = new PROPVARIANT(); - try - { - metadataQueryReader.GetMetadataByName(name, ref variant); - return TryDecode(ref variant, out value); - } - catch (COMException ex) when (ex.ErrorCode == HResult.WINCODEC_ERR_PROPERTYNOTFOUND) - { - value = default(T); - return false; - } - finally - { - Dispose(ref variant); - } - } - } -} diff --git a/src/modules/peek/WIC/Extensions/IWICPaletteExtensions.cs b/src/modules/peek/WIC/Extensions/IWICPaletteExtensions.cs deleted file mode 100644 index e3b5941ad9..0000000000 --- a/src/modules/peek/WIC/Extensions/IWICPaletteExtensions.cs +++ /dev/null @@ -1,19 +0,0 @@ -using System.ComponentModel; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class IWICPaletteExtensions - { - public static int[] GetColors(this IWICPalette palette) - { - FetchIntoBuffer fetcher = palette.GetColors; - return fetcher.FetchArray(); - } - - public static void InitializeCustom(this IWICPalette palette, int[] pColors) - { - palette.InitializeCustom(pColors, pColors.Length); - } - } -} diff --git a/src/modules/peek/WIC/Extensions/StreamExtensions.cs b/src/modules/peek/WIC/Extensions/StreamExtensions.cs deleted file mode 100644 index 5b8a49727f..0000000000 --- a/src/modules/peek/WIC/Extensions/StreamExtensions.cs +++ /dev/null @@ -1,129 +0,0 @@ -using System; -using System.ComponentModel; -using System.IO; - -using Marshal = System.Runtime.InteropServices.Marshal; - -namespace WIC -{ - [EditorBrowsable(EditorBrowsableState.Advanced)] - public static class StreamExtensions - { - public static IStream AsCOMStream(this Stream stream) - { - return new COMStream(stream); - } - - private sealed class COMStream : IStream - { - public COMStream(Stream underlyingStream) - { - UnderlyingStream = underlyingStream; - } - - private Stream UnderlyingStream { get; } - - public void Read(byte[] pv, int cb, IntPtr pcbRead) - { - int bytesRead = UnderlyingStream.Read(pv, 0, cb); - if (pcbRead != IntPtr.Zero) - { - Marshal.WriteInt32(pcbRead, 0, bytesRead); - } - } - - public void Write(byte[] pv, int cb, IntPtr pcbWritten) - { - var bytesWritten = Math.Min(pv.Length, cb); - UnderlyingStream.Write(pv, 0, bytesWritten); - if (pcbWritten != IntPtr.Zero) - { - Marshal.WriteInt32(pcbWritten, 0, bytesWritten); - } - } - - public void Seek(long dlibMove, STREAM_SEEK dwOrigin, IntPtr plibNewPosition) - { - SeekOrigin seekOrigin; - switch (dwOrigin) - { - case STREAM_SEEK.STREAM_SEEK_SET: - seekOrigin = SeekOrigin.Begin; - break; - case STREAM_SEEK.STREAM_SEEK_CUR: - seekOrigin = SeekOrigin.Current; - break; - case STREAM_SEEK.STREAM_SEEK_END: - seekOrigin = SeekOrigin.End; - break; - default: - throw new ArgumentOutOfRangeException(nameof(dwOrigin)); - } - long newPosition = UnderlyingStream.Seek(dlibMove, seekOrigin); - if (plibNewPosition != IntPtr.Zero) - { - Marshal.WriteInt64(plibNewPosition, 0, newPosition); - } - } - - public void SetSize(long libNewSize) - { - UnderlyingStream.SetLength(libNewSize); - } - - void IStream.CopyTo(IStream pstm, long cb, out long pcbRead, out long pcbWritten) - { - throw new System.NotImplementedException(); - } - - void IStream.Commit(STGC grfCommitFlags) - { - throw new System.NotImplementedException(); - } - - void IStream.Revert() - { - throw new System.NotImplementedException(); - } - - void IStream.LockRegion(long libOffset, long cb, LOCKTYPE dwLockType) - { - throw new System.NotImplementedException(); - } - - void IStream.UnlockRegion(long libOffset, long cb, LOCKTYPE dwLockType) - { - throw new System.NotImplementedException(); - } - - public void Stat(ref STATSTG pstatstg, STATFLAG grfStatFlag) - { - pstatstg = new STATSTG(); - pstatstg.type = STGTY.STGTY_STREAM; - pstatstg.cbSize = UnderlyingStream.Length; - pstatstg.grfMode = 0; - if (UnderlyingStream.CanRead && UnderlyingStream.CanWrite) - { - pstatstg.grfMode |= STGM.STGM_READWRITE; - } - else if (UnderlyingStream.CanRead) - { - pstatstg.grfMode |= STGM.STGM_READ; - } - else if (UnderlyingStream.CanWrite) - { - pstatstg.grfMode |= STGM.STGM_WRITE; - } - else - { - throw new ObjectDisposedException(null); - } - } - - IStream IStream.Clone() - { - throw new System.NotImplementedException(); - } - } - } -} diff --git a/src/modules/peek/WIC/FetchIntoBufferMethod.cs b/src/modules/peek/WIC/FetchIntoBufferMethod.cs deleted file mode 100644 index 236e20ad91..0000000000 --- a/src/modules/peek/WIC/FetchIntoBufferMethod.cs +++ /dev/null @@ -1,37 +0,0 @@ -namespace WIC -{ - internal delegate void FetchIntoBuffer(int size, T[] buffer, out int length); - - internal static class FetchIntoBufferExtensions - { - internal static T[] FetchArray(this FetchIntoBuffer fetcher) - { - int length; - fetcher.Invoke(0, null, out length); - var buffer = new T[length]; - if (length > 0) - { - fetcher.Invoke(length, buffer, out length); - } - return buffer; - } - - internal static string FetchString(this FetchIntoBuffer fetcher) - { - var buffer = fetcher.FetchArray(); - int length = buffer.Length - 1; - if (length > 0) - { - return new string(buffer, 0, length); - } - else if (length == 0) - { - return string.Empty; - } - else - { - return null; - } - } - } -} diff --git a/src/modules/peek/WIC/Interfaces/IEnumString.cs b/src/modules/peek/WIC/Interfaces/IEnumString.cs deleted file mode 100644 index a2dbd14213..0000000000 --- a/src/modules/peek/WIC/Interfaces/IEnumString.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IEnumString)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IEnumString - { - void Next( - [In] int celt, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.LPWStr, SizeParamIndex = 0)] string[] rgelt, - [Out] out int pceltFetched); - - void Skip( - [In] int celt); - - void Reset(); - - IEnumString Clone(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IEnumUnknown.cs b/src/modules/peek/WIC/Interfaces/IEnumUnknown.cs deleted file mode 100644 index a06b2bfff8..0000000000 --- a/src/modules/peek/WIC/Interfaces/IEnumUnknown.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IEnumUnknown)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IEnumUnknown - { - void Next( - [In] int celt, - [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 0)] object[] rgelt, - [Out] out int pceltFetched); - - void Skip( - [In] int celt); - - void Reset(); - - IEnumUnknown Clone(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IErrorLog.cs b/src/modules/peek/WIC/Interfaces/IErrorLog.cs deleted file mode 100644 index 6649c55940..0000000000 --- a/src/modules/peek/WIC/Interfaces/IErrorLog.cs +++ /dev/null @@ -1,15 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IErrorLog)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IErrorLog - { - void AddError( - [In, MarshalAs(UnmanagedType.LPWStr)] string pszPropName, - [In] IntPtr pExcepInfo); // EXCEPINFO* - } -} diff --git a/src/modules/peek/WIC/Interfaces/IPropertyBag2.cs b/src/modules/peek/WIC/Interfaces/IPropertyBag2.cs deleted file mode 100644 index 22bbefe5f3..0000000000 --- a/src/modules/peek/WIC/Interfaces/IPropertyBag2.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IPropertyBag2)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IPropertyBag2 - { - void Read( - [In] int cProperties, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PROPBAG2[] pPropBag, - [In] IErrorLog pErrLog, - [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Struct, SizeParamIndex = 0)] object[] pvarValue, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] int[] phrError - ); - - void Write( - [In] int cProperties, - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PROPBAG2[] pPropBag, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Struct, SizeParamIndex = 0)] object[] pvarValue); - - int CountProperties(); - - void GetPropertyInfo( - [In] int iProperty, - [In] int cProperties, - [Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] PROPBAG2[] pPropBag, - [Out] out int pcProperties); - - void LoadObject( - [In, MarshalAs(UnmanagedType.LPWStr)] string pstrName, - [In] int dwHint, - [In, MarshalAs(UnmanagedType.IUnknown)] object pUnkObject, - [In] IErrorLog pErrLog); - } -} diff --git a/src/modules/peek/WIC/Interfaces/ISequentialStream.cs b/src/modules/peek/WIC/Interfaces/ISequentialStream.cs deleted file mode 100644 index e7badba8b7..0000000000 --- a/src/modules/peek/WIC/Interfaces/ISequentialStream.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.ISequentialStream)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface ISequentialStream - { - void Read( - [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] pv, - [In] int cb, - [Out] IntPtr pcbRead); - - void Write( - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] pv, - [In] int cb, - [Out] IntPtr pcbWritten); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IStream.cs b/src/modules/peek/WIC/Interfaces/IStream.cs deleted file mode 100644 index 29e352345c..0000000000 --- a/src/modules/peek/WIC/Interfaces/IStream.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IStream)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IStream : ISequentialStream - { - #region Members inherited from `ISequentialStream` - - new void Read( - [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] pv, - [In] int cb, - [Out] IntPtr pcbRead); - - new void Write( - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] pv, - [In] int cb, - [Out] IntPtr pcbWritten); - - #endregion - - void Seek( - [In] long dlibMove, - [In] STREAM_SEEK dwOrigin, - [Out] IntPtr plibNewPosition); - - void SetSize( - [In] long libNewSize); - - void CopyTo( - [In] IStream pstm, - [In] long cb, - [Out] out long pcbRead, - [Out] out long pcbWritten); - - void Commit( - [In] STGC grfCommitFlags); - - void Revert(); - - void LockRegion( - [In] long libOffset, - [In] long cb, - [In] LOCKTYPE dwLockType); - - void UnlockRegion( - [In] long libOffset, - [In] long cb, - [In] LOCKTYPE dwLockType); - - void Stat( - [In, Out] ref STATSTG pstatstg, - [In] STATFLAG grfStatFlag); - - IStream Clone(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmap.cs b/src/modules/peek/WIC/Interfaces/IWICBitmap.cs deleted file mode 100644 index f2a405a101..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmap.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmap)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmap : IWICBitmapSource - { - #region Members inherited from `IWICBitmapSource` - - new void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - new Guid GetPixelFormat(); - - new void GetResolution( - [Out] out double pDpiX, - [Out] out double pDpiY); - - new void CopyPalette( - [In] IWICPalette pIPalette); - - new void CopyPixels( - [In] IntPtr prc, // WICRect* - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbBuffer); - - #endregion - - IWICBitmapLock Lock( - [In] IntPtr prcLock, // WICRect* - [In] WICBitmapLockFlags flags); - - void SetPalette( - [In] IWICPalette pIPalette); - - void SetResolution( - [In] double dpiX, - [In] double dpiY); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapClipper.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapClipper.cs deleted file mode 100644 index 5b592e78c5..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapClipper.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapClipper)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapClipper : IWICBitmapSource - { - #region Members inherited from `IWICBitmapSource` - - new void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - new Guid GetPixelFormat(); - - new void GetResolution( - [Out] out double pDpiX, - [Out] out double pDpiY); - - new void CopyPalette( - [In] IWICPalette pIPalette); - - new void CopyPixels( - [In] IntPtr prc, // WICRect* - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbBuffer); - - #endregion - - void Initialize( - [In] IWICBitmapSource pISource, - [In, MarshalAs(UnmanagedType.LPStruct)] WICRect prc); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapCodecInfo.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapCodecInfo.cs deleted file mode 100644 index 118d12c548..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapCodecInfo.cs +++ /dev/null @@ -1,86 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapCodecInfo)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapCodecInfo : IWICComponentInfo - { - #region Members inherited from `IWICComponentInfo` - - new WICComponentType GetComponentType(); - - new Guid GetCLSID(); - - new WICComponentSigning GetSigningStatus(); - - new void GetAuthor( - [In] int cchAuthor, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzAuthor, - [Out] out int pcchActual); - - new Guid GetVendorGUID(); - - new void GetVersion( - [In] int cchVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzVersion, - [Out] out int pcchActual); - - new void GetSpecVersion( - [In] int cchSpecVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzSpecVersion, - [Out] out int pcchActual); - - new void GetFriendlyName( - [In] int cchFriendlyName, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFriendlyName, - [Out] out int pcchActual); - - #endregion - - Guid GetContainerFormat(); - - void GetPixelFormats( - [In] int cFormats, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Guid[] pguidPixelFormats, - [Out] out int pcActual); - - void GetColorManagementVersion( - [In] int cchColorManagementVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzColorManagementVersion, - [Out] out int pcchActual); - - void GetDeviceManufacturer( - [In] int cchDeviceManufacturer, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzDeviceManufacturer, - [Out] out int pcchActual); - - void GetDeviceModels( - [In] int cchDeviceModels, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzDeviceModels, - [Out] out int pcchActual); - - void GetMimeTypes( - [In] int cchMimeTypes, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzMimeTypes, - [Out] out int pcchActual); - - void GetFileExtensions( - [In] int cchFileExtensions, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFileExtensions, - [Out] out int pcchActual); - - bool DoesSupportAnimation(); - - bool DoesSupportChromakey(); - - bool DoesSupportLossless(); - - bool DoesSupportMultiframe(); - - bool MatchesMimeType( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzMimeType); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapDecoder.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapDecoder.cs deleted file mode 100644 index 208ee1be32..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapDecoder.cs +++ /dev/null @@ -1,41 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapDecoder)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapDecoder - { - WICBitmapDecoderCapabilities QueryCapability( - [In] IStream pIStream); - - void Initialize( - [In] IStream pIStream, - [In] WICDecodeOptions cacheOptions); - - Guid GetContainerFormat(); - - IWICBitmapDecoderInfo GetDecoderInfo(); - - void CopyPalette( - [In] IWICPalette pIPalette); - - IWICMetadataQueryReader GetMetadataQueryReader(); - - IWICBitmapSource GetPreview(); - - void GetColorContexts( - [In] int cCount, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 0)] IWICColorContext[] ppIColorContexts, - [Out] out int pcActualCount); - - IWICBitmapSource GetThumbnail(); - - int GetFrameCount(); - - IWICBitmapFrameDecode GetFrame( - [In] int index); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapDecoderInfo.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapDecoderInfo.cs deleted file mode 100644 index f0f169cf73..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapDecoderInfo.cs +++ /dev/null @@ -1,102 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapDecoderInfo)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapDecoderInfo : IWICBitmapCodecInfo - { - #region Members inherited from `IWICBitmapCodecInfo` - - #region Members inherited from `IWICComponentInfo` - - new WICComponentType GetComponentType(); - - new Guid GetCLSID(); - - new WICComponentSigning GetSigningStatus(); - - new void GetAuthor( - [In] int cchAuthor, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzAuthor, - [Out] out int pcchActual); - - new Guid GetVendorGUID(); - - new void GetVersion( - [In] int cchVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzVersion, - [Out] out int pcchActual); - - new void GetSpecVersion( - [In] int cchSpecVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzSpecVersion, - [Out] out int pcchActual); - - new void GetFriendlyName( - [In] int cchFriendlyName, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFriendlyName, - [Out] out int pcchActual); - - #endregion - - new Guid GetContainerFormat(); - - new void GetPixelFormats( - [In] int cFormats, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Guid[] pguidPixelFormats, - [Out] out int pcActual); - - new void GetColorManagementVersion( - [In] int cchColorManagementVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzColorManagementVersion, - [Out] out int pcchActual); - - new void GetDeviceManufacturer( - [In] int cchDeviceManufacturer, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzDeviceManufacturer, - [Out] out int pcchActual); - - new void GetDeviceModels( - [In] int cchDeviceModels, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzDeviceModels, - [Out] out int pcchActual); - - new void GetMimeTypes( - [In] int cchMimeTypes, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzMimeTypes, - [Out] out int pcchActual); - - new void GetFileExtensions( - [In] int cchFileExtensions, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFileExtensions, - [Out] out int pcchActual); - - new bool DoesSupportAnimation(); - - new bool DoesSupportChromakey(); - - new bool DoesSupportLossless(); - - new bool DoesSupportMultiframe(); - - new bool MatchesMimeType( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzMimeType); - - #endregion - - void GetPatterns( - [In] int cbSizePatterns, - [In] IntPtr pPatterns, - [Out] out int pcPatterns, - [Out] out int pcbPatternsActual); - - bool MatchesPattern( - [In] IStream pIStream); - - IWICBitmapDecoder CreateInstance(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapEncoder.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapEncoder.cs deleted file mode 100644 index a7be9b1ff0..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapEncoder.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapEncoder)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapEncoder - { - void Initialize( - [In] IStream pIStream, - [In] WICBitmapEncoderCacheOption cacheOption); - - Guid GetContainerFormat(); - - IWICBitmapEncoderInfo GetEncoderInfo(); - - void SetColorContexts( - [In] int cCount, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 0)] IWICColorContext[] ppIColorContext); - - void SetPalette( - [In] IWICPalette pIPalette); - - void SetThumbnail( - [In] IWICBitmapSource pIThumbnail); - - void SetPreview( - [In] IWICBitmapSource pIPreview); - - void CreateNewFrame( - [Out] out IWICBitmapFrameEncode ppIFrameEncode, - [In, Out] IPropertyBag2 ppIEncoderOptions); - - void Commit(); - - IWICMetadataQueryWriter GetMetadataQueryWriter(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapEncoderInfo.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapEncoderInfo.cs deleted file mode 100644 index dae17dbde6..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapEncoderInfo.cs +++ /dev/null @@ -1,92 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapEncoderInfo)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapEncoderInfo : IWICBitmapCodecInfo - { - #region Members inherited from `IWICBitmapCodecInfo` - - #region Members inherited from `IWICComponentInfo` - - new WICComponentType GetComponentType(); - - new Guid GetCLSID(); - - new WICComponentSigning GetSigningStatus(); - - new void GetAuthor( - [In] int cchAuthor, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzAuthor, - [Out] out int pcchActual); - - new Guid GetVendorGUID(); - - new void GetVersion( - [In] int cchVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzVersion, - [Out] out int pcchActual); - - new void GetSpecVersion( - [In] int cchSpecVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzSpecVersion, - [Out] out int pcchActual); - - new void GetFriendlyName( - [In] int cchFriendlyName, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFriendlyName, - [Out] out int pcchActual); - - #endregion - - new Guid GetContainerFormat(); - - new void GetPixelFormats( - [In] int cFormats, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Guid[] pguidPixelFormats, - [Out] out int pcActual); - - new void GetColorManagementVersion( - [In] int cchColorManagementVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzColorManagementVersion, - [Out] out int pcchActual); - - new void GetDeviceManufacturer( - [In] int cchDeviceManufacturer, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzDeviceManufacturer, - [Out] out int pcchActual); - - new void GetDeviceModels( - [In] int cchDeviceModels, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzDeviceModels, - [Out] out int pcchActual); - - new void GetMimeTypes( - [In] int cchMimeTypes, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzMimeTypes, - [Out] out int pcchActual); - - new void GetFileExtensions( - [In] int cchFileExtensions, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFileExtensions, - [Out] out int pcchActual); - - new bool DoesSupportAnimation(); - - new bool DoesSupportChromakey(); - - new bool DoesSupportLossless(); - - new bool DoesSupportMultiframe(); - - new bool MatchesMimeType( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzMimeType); - - #endregion - - IWICBitmapEncoder CreateInstance(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapFlipRotator.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapFlipRotator.cs deleted file mode 100644 index 69ee777dac..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapFlipRotator.cs +++ /dev/null @@ -1,38 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapFlipRotator)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapFlipRotator : IWICBitmapSource - { - #region Members inherited from `IWICBitmapSource` - - new void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - new Guid GetPixelFormat(); - - new void GetResolution( - [Out] out double pDpiX, - [Out] out double pDpiY); - - new void CopyPalette( - [In] IWICPalette pIPalette); - - new void CopyPixels( - [In] IntPtr prc, // WICRect* - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbBuffer); - - #endregion - - void Initialize( - [In] IWICBitmapSource pISource, - [In] WICBitmapTransformOptions options); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapFrameDecode.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapFrameDecode.cs deleted file mode 100644 index 0a7e4f3896..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapFrameDecode.cs +++ /dev/null @@ -1,43 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapFrameDecode)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapFrameDecode : IWICBitmapSource - { - #region Members inherited from `IWICBitmapSource` - - new void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - new Guid GetPixelFormat(); - - new void GetResolution( - [Out] out double pDpiX, - [Out] out double pDpiY); - - new void CopyPalette( - [In] IWICPalette pIPalette); - - new void CopyPixels( - [In] IntPtr prc, // WICRect* - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbBuffer); - - #endregion - - IWICMetadataQueryReader GetMetadataQueryReader(); - - void GetColorContexts( - [In] int cCount, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 0)] IWICColorContext[] ppIColorContexts, - [Out] out int pcActualCount); - - IWICBitmapSource GetThumbnail(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapFrameEncode.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapFrameEncode.cs deleted file mode 100644 index c2d74e096b..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapFrameEncode.cs +++ /dev/null @@ -1,49 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapFrameEncode)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapFrameEncode - { - void Initialize( - [In] IPropertyBag2 pIEncoderOptions); - - void SetSize( - [In] int uiWidth, - [In] int uiHeight); - - void SetResolution( - [In] double dpiX, - [In] double dpiY); - - void SetPixelFormat( - [In, Out] ref Guid pPixelFormat); - - void SetColorContexts( - [In] int cCount, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.Interface, SizeParamIndex = 0)] IWICColorContext[] ppIColorContext); - - void SetPalette( - [In] IWICPalette pIPalette); - - void SetThumbnail( - [In] IWICBitmapSource pIThumbnail); - - void WritePixels( - [In] int lineCount, - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbPixels); - - void WriteSource( - [In] IWICBitmapSource pIBitmapSource, - [In] IntPtr prc); - - void Commit(); - - IWICMetadataQueryWriter GetMetadataQueryWriter(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapLock.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapLock.cs deleted file mode 100644 index 3815e53fcb..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapLock.cs +++ /dev/null @@ -1,22 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapLock)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapLock - { - void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - int GetStride(); - - IntPtr GetDataPointer( // byte* - [Out] out int pcbBufferSize); - - Guid GetPixelFormat(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapScaler.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapScaler.cs deleted file mode 100644 index fe7e496e9c..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapScaler.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapScaler)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapScaler : IWICBitmapSource - { - #region Members inherited from `IWICBitmapSource` - - new void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - new Guid GetPixelFormat(); - - new void GetResolution( - [Out] out double pDpiX, - [Out] out double pDpiY); - - new void CopyPalette( - [In] IWICPalette pIPalette); - - new void CopyPixels( - [In] IntPtr prc, // WICRect* - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbBuffer); - - #endregion - - void Initialize( - [In] IWICBitmapSource pISource, - [In] int uiWidth, - [In] int uiHeight, - [In] WICBitmapInterpolationMode mode); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICBitmapSource.cs b/src/modules/peek/WIC/Interfaces/IWICBitmapSource.cs deleted file mode 100644 index 96947d1651..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICBitmapSource.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICBitmapSource)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICBitmapSource - { - void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - Guid GetPixelFormat(); - - void GetResolution( - [Out] out double pDpiX, - [Out] out double pDpiY); - - void CopyPalette( - [In] IWICPalette pIPalette); - - void CopyPixels( - [In] IntPtr prc, // WICRect* - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbBuffer); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICColorContext.cs b/src/modules/peek/WIC/Interfaces/IWICColorContext.cs deleted file mode 100644 index c0c0a736fd..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICColorContext.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICColorContext)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICColorContext - { - void InitializeFromFilename( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzFilename); - - void InitializeFromMemory( - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] pbBuffer, - [In] int cbBufferSize); - - void InitializeFromExifColorSpace( - [In] ExifColorSpace value); - - WICColorContextType GetType(); - - void GetProfileBytes( - [In] int cbBuffer, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 0)] byte[] pbBuffer, - [Out] out int pcbActual); - - ExifColorSpace GetExifColorSpace(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICColorTransform.cs b/src/modules/peek/WIC/Interfaces/IWICColorTransform.cs deleted file mode 100644 index 3312436a3c..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICColorTransform.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICColorTransform)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICColorTransform : IWICBitmapSource - { - #region Members inherited from `IWICBitmapSource` - - new void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - new Guid GetPixelFormat(); - - new void GetResolution( - [Out] out double pDpiX, - [Out] out double pDpiY); - - new void CopyPalette( - [In] IWICPalette pIPalette); - - new void CopyPixels( - [In] IntPtr prc, // WICRect* - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbBuffer); - - #endregion - - void Initialize( - [In] IWICBitmapSource pIBitmapSource, - [In] IWICColorContext pIContextSource, - [In] IWICColorContext pIContextDest, - [In, MarshalAs(UnmanagedType.LPStruct)] Guid pixelFmtDest); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICComponentFactory.cs b/src/modules/peek/WIC/Interfaces/IWICComponentFactory.cs deleted file mode 100644 index 4a5391bebe..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICComponentFactory.cs +++ /dev/null @@ -1,140 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICComponentFactory)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICComponentFactory : IWICImagingFactory - { - #region Members inherited from `IWICImagingFactory` - - new IWICBitmapDecoder CreateDecoderFromFilename( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzFilename, - [In] IntPtr pguidVendor, - [In] StreamAccessMode dwDesiredAccess, - [In] WICDecodeOptions metadataOptions); - - new IWICBitmapDecoder CreateDecoderFromStream( - [In] IStream pIStream, - [In] IntPtr pguidVendor, - [In] WICDecodeOptions metadataOptions); - - new IWICBitmapDecoder CreateDecoderFromFileHandle( - [In] IntPtr hFile, - [In] IntPtr pguidVendor, - [In] WICDecodeOptions metadataOptions); - - new IWICComponentInfo CreateComponentInfo( - [In] Guid clsidComponent); - - new IWICBitmapDecoder CreateDecoder( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidContainerFormat, - [In] IntPtr pguidVendor); - - new IWICBitmapEncoder CreateEncoder( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidContainerFormat, - [In] IntPtr pguidVendor); - - new IWICPalette CreatePalette(); - - new IWICFormatConverter CreateFormatConverter(); - - new IWICBitmapScaler CreateBitmapScaler(); - - new IWICBitmapClipper CreateBitmapClipper(); - - new IWICBitmapFlipRotator CreateBitmapFlipRotator(); - - new IWICStream CreateStream(); - - new IWICColorContext CreateColorContext(); - - new IWICColorTransform CreateColorTransformer(); - - new IWICBitmap CreateBitmap( - [In] int uiWidth, - [In] int uiHeight, - [In, MarshalAs(UnmanagedType.LPStruct)] Guid pixelFormat, - [In] WICBitmapCreateCacheOption option); - - new IWICBitmap CreateBitmapFromSource( - [In] IWICBitmapSource pIBitmapSource, - [In] WICBitmapCreateCacheOption option); - - new IWICBitmap CreateBitmapFromSourceRect( - [In] IWICBitmapSource pIBitmapSource, - [In] int x, - [In] int y, - [In] int width, - [In] int height); - - new IWICBitmap CreateBitmapFromMemory( - [In] int uiWidth, - [In] int uiHeight, - [In, MarshalAs(UnmanagedType.LPStruct)] Guid pixelFormat, - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 4)] byte[] pbBuffer); - - new IWICBitmap CreateBitmapFromHBITMAP( - [In] IntPtr hBitmap, - [In] IntPtr hPalette, - [In] WICBitmapAlphaChannelOption options); - - new IWICBitmap CreateBitmapFromHICON( - [In] IntPtr hIcon); - - new IEnumUnknown CreateComponentEnumerator( - [In] WICComponentType componentTypes, - [In] WICComponentEnumerateOptions options); - - new IWICFastMetadataEncoder CreateFastMetadataEncoderFromDecoder( - [In] IWICBitmapDecoder pIDecoder); - - new IWICFastMetadataEncoder CreateFastMetadataEncoderFromFrameDecode( - [In] IWICBitmapFrameDecode pIFrameDecoder); - - new IWICMetadataQueryWriter CreateQueryWriter( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidMetadataFormat, - [In] IntPtr pguidVendor); - - new IWICMetadataQueryWriter CreateQueryWriterFromReader( - [In] IWICMetadataQueryReader pIQueryReader, - [In] IntPtr pguidVendor); - - #endregion - - IWICMetadataReader CreateMetadataReader( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidContainerFormat, - [In] IntPtr pguidVendor, - [In] MetadataCreationAndPersistOptions dwOptions, - [In] IStream pIStream); - - IWICMetadataReader CreateMetadataReaderFromContainer( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidContainerFormat, - [In] IntPtr pguidVendor, - [In] MetadataCreationAndPersistOptions dwOptions, - [In] IStream pIStream); - - IWICMetadataWriter CreateMetadataWriter( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidContainerFormat, - [In] IntPtr pguidVendor, - [In] WICMetadataCreationOptions dwMetadataOptions); - - IWICMetadataWriter CreateMetadataWriterFromReader( - [In] IWICMetadataReader pIReader, - [In] IntPtr pguidVendor); - - IWICMetadataQueryReader CreateQueryReaderFromBlockReader( - [In] IWICMetadataBlockReader pIBlockReader); - - IWICMetadataQueryWriter CreateQueryWriterFromBlockWriter( - [In] IWICMetadataBlockWriter pIBlockWriter); - - IPropertyBag2 CreateEncoderPropertyBag( - [In, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 1)] PROPBAG2[] ppropOptions, - [In] int cCount); - }; -} diff --git a/src/modules/peek/WIC/Interfaces/IWICComponentInfo.cs b/src/modules/peek/WIC/Interfaces/IWICComponentInfo.cs deleted file mode 100644 index c0e298c148..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICComponentInfo.cs +++ /dev/null @@ -1,39 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICComponentInfo)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICComponentInfo - { - WICComponentType GetComponentType(); - - Guid GetCLSID(); - - WICComponentSigning GetSigningStatus(); - - void GetAuthor( - [In] int cchAuthor, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzAuthor, - [Out] out int pcchActual); - - Guid GetVendorGUID(); - - void GetVersion( - [In] int cchVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzVersion, - [Out] out int pcchActual); - - void GetSpecVersion( - [In] int cchSpecVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzSpecVersion, - [Out] out int pcchActual); - - void GetFriendlyName( - [In] int cchFriendlyName, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFriendlyName, - [Out] out int pcchActual); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICEnumMetadataItem.cs b/src/modules/peek/WIC/Interfaces/IWICEnumMetadataItem.cs deleted file mode 100644 index 0691fb76c0..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICEnumMetadataItem.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICEnumMetadataItem)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICEnumMetadataItem - { - void Next( - [In] int celt, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PROPVARIANT[] rgeltSchema, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PROPVARIANT[] rgeltId, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] PROPVARIANT[] rgeltValue, - [Out] out int pceltFetched); - - void Skip( - [In] int celt); - - void Reset(); - - IWICEnumMetadataItem Clone(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICFastMetadataEncoder.cs b/src/modules/peek/WIC/Interfaces/IWICFastMetadataEncoder.cs deleted file mode 100644 index bc79ce6a9d..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICFastMetadataEncoder.cs +++ /dev/null @@ -1,14 +0,0 @@ -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICFastMetadataEncoder)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICFastMetadataEncoder - { - void Commit(); - - IWICMetadataQueryWriter GetMetadataQueryWriter(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICFormatConverter.cs b/src/modules/peek/WIC/Interfaces/IWICFormatConverter.cs deleted file mode 100644 index 387e0431b2..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICFormatConverter.cs +++ /dev/null @@ -1,46 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICFormatConverter)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICFormatConverter : IWICBitmapSource - { - #region Members inherited from `IWICBitmapSource` - - new void GetSize( - [Out] out int puiWidth, - [Out] out int puiHeight); - - new Guid GetPixelFormat(); - - new void GetResolution( - [Out] out double pDpiX, - [Out] out double pDpiY); - - new void CopyPalette( - [In] IWICPalette pIPalette); - - new void CopyPixels( - [In] IntPtr prc, // WICRect* - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 2)] byte[] pbBuffer); - - #endregion - - void Initialize( - [In] IWICBitmapSource pISource, - [In, MarshalAs(UnmanagedType.LPStruct)] Guid dstFormat, - [In] WICBitmapDitherType dither, - [In] IWICPalette pIPalette, - [In] double alphaThresholdPercent, - [In] WICBitmapPaletteType paletteTranslate); - - bool CanConvert( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid srcPixelFormat, - [In, MarshalAs(UnmanagedType.LPStruct)] Guid dstPixelFormat); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICFormatConverterInfo.cs b/src/modules/peek/WIC/Interfaces/IWICFormatConverterInfo.cs deleted file mode 100644 index db5caee896..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICFormatConverterInfo.cs +++ /dev/null @@ -1,50 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICFormatConverterInfo)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICFormatConverterInfo : IWICComponentInfo - { - #region Members inherited from `IWICComponentInfo` - - new WICComponentType GetComponentType(); - - new Guid GetCLSID(); - - new WICComponentSigning GetSigningStatus(); - - new void GetAuthor( - [In] int cchAuthor, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzAuthor, - [Out] out int pcchActual); - - new Guid GetVendorGUID(); - - new void GetVersion( - [In] int cchVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzVersion, - [Out] out int pcchActual); - - new void GetSpecVersion( - [In] int cchSpecVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzSpecVersion, - [Out] out int pcchActual); - - new void GetFriendlyName( - [In] int cchFriendlyName, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFriendlyName, - [Out] out int pcchActual); - - #endregion - - void GetPixelFormats( - [In] int cFormats, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Guid[] pPixelFormatGUIDs, - [Out] out int pcActual); - - IWICFormatConverter CreateInstance(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICImagingFactory.cs b/src/modules/peek/WIC/Interfaces/IWICImagingFactory.cs deleted file mode 100644 index f64149d03e..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICImagingFactory.cs +++ /dev/null @@ -1,105 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICImagingFactory)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICImagingFactory - { - IWICBitmapDecoder CreateDecoderFromFilename( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzFilename, - [In] IntPtr pguidVendor, - [In] StreamAccessMode dwDesiredAccess, - [In] WICDecodeOptions metadataOptions); - - IWICBitmapDecoder CreateDecoderFromStream( - [In] IStream pIStream, - [In] IntPtr pguidVendor, - [In] WICDecodeOptions metadataOptions); - - IWICBitmapDecoder CreateDecoderFromFileHandle( - [In] IntPtr hFile, - [In] IntPtr pguidVendor, - [In] WICDecodeOptions metadataOptions); - - IWICComponentInfo CreateComponentInfo( - [In] Guid clsidComponent); - - IWICBitmapDecoder CreateDecoder( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidContainerFormat, - [In] IntPtr pguidVendor); - - IWICBitmapEncoder CreateEncoder( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidContainerFormat, - [In] IntPtr pguidVendor); - - IWICPalette CreatePalette(); - - IWICFormatConverter CreateFormatConverter(); - - IWICBitmapScaler CreateBitmapScaler(); - - IWICBitmapClipper CreateBitmapClipper(); - - IWICBitmapFlipRotator CreateBitmapFlipRotator(); - - IWICStream CreateStream(); - - IWICColorContext CreateColorContext(); - - IWICColorTransform CreateColorTransformer(); - - IWICBitmap CreateBitmap( - [In] int uiWidth, - [In] int uiHeight, - [In, MarshalAs(UnmanagedType.LPStruct)] Guid pixelFormat, - [In] WICBitmapCreateCacheOption option); - - IWICBitmap CreateBitmapFromSource( - [In] IWICBitmapSource pIBitmapSource, - [In] WICBitmapCreateCacheOption option); - - IWICBitmap CreateBitmapFromSourceRect( - [In] IWICBitmapSource pIBitmapSource, - [In] int x, - [In] int y, - [In] int width, - [In] int height); - - IWICBitmap CreateBitmapFromMemory( - [In] int uiWidth, - [In] int uiHeight, - [In, MarshalAs(UnmanagedType.LPStruct)] Guid pixelFormat, - [In] int cbStride, - [In] int cbBufferSize, - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 4)] byte[] pbBuffer); - - IWICBitmap CreateBitmapFromHBITMAP( - [In] IntPtr hBitmap, - [In] IntPtr hPalette, - [In] WICBitmapAlphaChannelOption options); - - IWICBitmap CreateBitmapFromHICON( - [In] IntPtr hIcon); - - IEnumUnknown CreateComponentEnumerator( - [In] WICComponentType componentTypes, - [In] WICComponentEnumerateOptions options); - - IWICFastMetadataEncoder CreateFastMetadataEncoderFromDecoder( - [In] IWICBitmapDecoder pIDecoder); - - IWICFastMetadataEncoder CreateFastMetadataEncoderFromFrameDecode( - [In] IWICBitmapFrameDecode pIFrameDecoder); - - IWICMetadataQueryWriter CreateQueryWriter( - [In, MarshalAs(UnmanagedType.LPStruct)] Guid guidMetadataFormat, - [In] IntPtr pguidVendor); - - IWICMetadataQueryWriter CreateQueryWriterFromReader( - [In] IWICMetadataQueryReader pIQueryReader, - [In] IntPtr pguidVendor); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICMetadataBlockReader.cs b/src/modules/peek/WIC/Interfaces/IWICMetadataBlockReader.cs deleted file mode 100644 index 6259b5ef3e..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICMetadataBlockReader.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICMetadataBlockReader)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICMetadataBlockReader - { - Guid GetContainerFormat(); - - int GetCount(); - - IWICMetadataReader GetReaderByIndex( - [In] int nIndex); - - IEnumUnknown GetEnumerator(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICMetadataBlockWriter.cs b/src/modules/peek/WIC/Interfaces/IWICMetadataBlockWriter.cs deleted file mode 100644 index f4beeff383..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICMetadataBlockWriter.cs +++ /dev/null @@ -1,40 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICMetadataBlockWriter)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICMetadataBlockWriter : IWICMetadataBlockReader - { - #region Members inherited from `IWICMetadataBlockReader` - - new Guid GetContainerFormat(); - - new int GetCount(); - - new IWICMetadataReader GetReaderByIndex( - [In] int nIndex); - - new IEnumUnknown GetEnumerator(); - - #endregion - - void InitializeFromBlockReader( - [In] IWICMetadataBlockReader pIMDBlockReader); - - IWICMetadataWriter GetWriterByIndex( - [In] int nIndex); - - void AddWriter( - [In] IWICMetadataWriter pIMetadataWriter); - - void SetWriterByIndex( - [In] int nIndex, - [In] IWICMetadataWriter pIMetadataWriter); - - void RemoveWriterByIndex( - [In] int nIndex); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICMetadataHandlerInfo.cs b/src/modules/peek/WIC/Interfaces/IWICMetadataHandlerInfo.cs deleted file mode 100644 index b40ff222c1..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICMetadataHandlerInfo.cs +++ /dev/null @@ -1,66 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICMetadataHandlerInfo)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICMetadataHandlerInfo : IWICComponentInfo - { - #region Members inherited from `IWICComponentInfo` - - new WICComponentType GetComponentType(); - - new Guid GetCLSID(); - - new WICComponentSigning GetSigningStatus(); - - new void GetAuthor( - [In] int cchAuthor, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzAuthor, - [Out] out int pcchActual); - - new Guid GetVendorGUID(); - - new void GetVersion( - [In] int cchVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzVersion, - [Out] out int pcchActual); - - new void GetSpecVersion( - [In] int cchSpecVersion, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzSpecVersion, - [Out] out int pcchActual); - - new void GetFriendlyName( - [In] int cchFriendlyName, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzFriendlyName, - [Out] out int pcchActual); - - #endregion - - Guid GetMetadataFormat(); - - void GetContainerFormats( - [In] int cContainerFormats, - [In, Out, MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 0)] Guid[] pguidContainerFormats, - [Out] out int pcchActual); - - void GetDeviceManufacturer( - [In] int cchDeviceManufacturer, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzDeviceManufacturer, - [Out] out int pcchActual); - - void GetDeviceModels( - [In] int cchDeviceModels, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzDeviceModels, - [Out] out int pcchActual); - - bool DoesRequireFullStream(); - - bool DoesSupportPadding(); - - bool DoesRequireFixedSize(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICMetadataQueryReader.cs b/src/modules/peek/WIC/Interfaces/IWICMetadataQueryReader.cs deleted file mode 100644 index d3f2af96c2..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICMetadataQueryReader.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICMetadataQueryReader)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICMetadataQueryReader - { - Guid GetContainerFormat(); - - void GetLocation( - [In] int cchMaxLength, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzNamespace, - [Out] out int pcchActualLength); - - void GetMetadataByName( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzName, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarValue); - - IEnumString GetEnumerator(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICMetadataQueryWriter.cs b/src/modules/peek/WIC/Interfaces/IWICMetadataQueryWriter.cs deleted file mode 100644 index 30eb3021c1..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICMetadataQueryWriter.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICMetadataQueryWriter)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICMetadataQueryWriter : IWICMetadataQueryReader - { - #region Members inherited from `IWICMetadataQueryReader` - - new Guid GetContainerFormat(); - - new void GetLocation( - [In] int cchMaxLength, - [In, Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U2, SizeParamIndex = 0)] char[] wzNamespace, - [Out] out int pcchActualLength); - - new void GetMetadataByName( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzName, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarValue); - - new IEnumString GetEnumerator(); - - #endregion - - void SetMetadataByName( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzName, - [In, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarValue); - - void RemoveMetadataByName( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzName); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICMetadataReader.cs b/src/modules/peek/WIC/Interfaces/IWICMetadataReader.cs deleted file mode 100644 index 473b7f5edc..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICMetadataReader.cs +++ /dev/null @@ -1,30 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICMetadataReader)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICMetadataReader - { - Guid GetMetadataFormat(); - - IWICMetadataHandlerInfo GetMetadataHandlerInfo(); - - int GetCount(); - - void GetValueByIndex( - [In] int nIndex, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarSchema, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarId, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarValue); - - void GetValue( - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarSchema, - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarId, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarValue); - - IWICEnumMetadataItem GetEnumerator(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICMetadataWriter.cs b/src/modules/peek/WIC/Interfaces/IWICMetadataWriter.cs deleted file mode 100644 index 23ffdee614..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICMetadataWriter.cs +++ /dev/null @@ -1,52 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICMetadataWriter)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICMetadataWriter : IWICMetadataReader - { - #region Members inherited from `IWICMetadataReader` - - new Guid GetMetadataFormat(); - - new IWICMetadataHandlerInfo GetMetadataHandlerInfo(); - - new int GetCount(); - - new void GetValueByIndex( - [In] int nIndex, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarSchema, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarId, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarValue); - - new void GetValue( - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarSchema, - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarId, - [In, Out, MarshalAs(UnmanagedType.Struct)] ref PROPVARIANT pvarValue); - - new IWICEnumMetadataItem GetEnumerator(); - - #endregion - - void SetValue( - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarSchema, - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarId, - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarValue); - - void SetValueByIndex( - [In] int nIndex, - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarSchema, - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarId, - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarValue); - - void RemoveValue( - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarSchema, - [In, MarshalAs(UnmanagedType.Struct)] PROPVARIANT pvarId); - - void RemoveValueByIndex( - [In] int nIndex); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICPalette.cs b/src/modules/peek/WIC/Interfaces/IWICPalette.cs deleted file mode 100644 index 4970ebbfb5..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICPalette.cs +++ /dev/null @@ -1,42 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICPalette)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICPalette - { - void InitializePredefined( - [In] WICBitmapPaletteType ePaletteType, - [In] bool fAddTransparentColor); - - void InitializeCustom( - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U4, SizeParamIndex = 1)] int[] pColors, - [In] int cCount); - - void InitializeFromBitmap( - [In] IWICBitmapSource pISurface, - [In] int cCount, - [In] bool fAddTransparentColor); - - void InitializeFromPalette( - [In] IWICPalette pIPalette); - - WICBitmapPaletteType GetType(); - - int GetColorCount(); - - void GetColors( - [In] int cCount, - [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U4, SizeParamIndex = 0)] int[] pColors, - [Out] out int pcActualColors); - - bool IsBlackWhite(); - - bool IsGrayscale(); - - bool HasAlpha(); - } -} diff --git a/src/modules/peek/WIC/Interfaces/IWICStream.cs b/src/modules/peek/WIC/Interfaces/IWICStream.cs deleted file mode 100644 index 093eed57f3..0000000000 --- a/src/modules/peek/WIC/Interfaces/IWICStream.cs +++ /dev/null @@ -1,80 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [ComImport] - [Guid(IID.IWICStream)] - [InterfaceType(ComInterfaceType.InterfaceIsIUnknown)] - public interface IWICStream : IStream - { - #region Members inherited from `IStream` - - #region Members inherited from `ISequentialStream` - - new void Read( - [Out, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] pv, - [In] int cb, - [Out] IntPtr pcbRead); - - new void Write( - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] pv, - [In] int cb, - [Out] IntPtr pcbWritten); - - #endregion - - new void Seek( - [In] long dlibMove, - [In] STREAM_SEEK dwOrigin, - [Out] IntPtr plibNewPosition); - - new void SetSize( - [In] long libNewSize); - - new void CopyTo( - [In] IStream pstm, - [In] long cb, - [Out] out long pcbRead, - [Out] out long pcbWritten); - - new void Commit( - [In] STGC grfCommitFlags); - - new void Revert(); - - new void LockRegion( - [In] long libOffset, - [In] long cb, - [In] LOCKTYPE dwLockType); - - new void UnlockRegion( - [In] long libOffset, - [In] long cb, - [In] LOCKTYPE dwLockType); - - new void Stat( - [In, Out] ref STATSTG pstatstg, - [In] STATFLAG grfStatFlag); - - new IStream Clone(); - - #endregion - - void InitializeFromIStream( - [In] IStream pIStream); - - void InitializeFromFilename( - [In, MarshalAs(UnmanagedType.LPWStr)] string wzFileName, - [In] StreamAccessMode dwDesiredAccess); - - void InitializeFromMemory( - [In, MarshalAs(UnmanagedType.LPArray, ArraySubType = UnmanagedType.U1, SizeParamIndex = 1)] byte[] pbBuffer, - [In] int cbBufferSize); - - void InitializeFromIStreamRegion( - [In] IStream pIStream, - [In] long ulOffset, - [In] long ulMaxSize); - } -} diff --git a/src/modules/peek/WIC/PropVariantHelpers.cs b/src/modules/peek/WIC/PropVariantHelpers.cs deleted file mode 100644 index 2b2e755307..0000000000 --- a/src/modules/peek/WIC/PropVariantHelpers.cs +++ /dev/null @@ -1,252 +0,0 @@ -using System; -using System.Collections.Generic; -using System.Runtime.InteropServices; - -namespace WIC -{ - internal static class PropVariantHelpers - { - static PropVariantHelpers() - { - Func getComObject = variant => - { - return Marshal.GetObjectForIUnknown(variant.Value.Ptr); - }; - - decoders = new Dictionary>() - { - [VARTYPE.VT_BOOL] = variant => variant.Value.UI2 == 0 ? false : true, - [VARTYPE.VT_UI1] = variant => variant.Value.UI1, - [VARTYPE.VT_UI2] = variant => variant.Value.UI2, - [VARTYPE.VT_UI4] = variant => variant.Value.UI4, - [VARTYPE.VT_UI8] = variant => variant.Value.UI8, - [VARTYPE.VT_I1] = variant => variant.Value.I1, - [VARTYPE.VT_I2] = variant => variant.Value.I2, - [VARTYPE.VT_I4] = variant => variant.Value.I4, - [VARTYPE.VT_I8] = variant => variant.Value.I8, - [VARTYPE.VT_LPSTR] = variant => Marshal.PtrToStringAnsi(variant.Value.Ptr), - [VARTYPE.VT_LPWSTR] = variant => Marshal.PtrToStringUni(variant.Value.Ptr), - [VARTYPE.VT_BSTR] = variant => Marshal.PtrToStringBSTR(variant.Value.Ptr), - [VARTYPE.VT_R4] = variant => variant.Value.R4, - [VARTYPE.VT_R8] = variant => variant.Value.R8, - [VARTYPE.VT_UNKNOWN] = variant => getComObject, - [VARTYPE.VT_STREAM] = variant => getComObject, - [VARTYPE.VT_STORAGE] = variant => getComObject, - [VARTYPE.VT_VECTOR] = DecodeVector, - }; - - Action disposePtr = variant => - { - Marshal.FreeCoTaskMem(variant.Value.Ptr); - }; - Action disposeBSTR = variant => - { - Marshal.FreeBSTR(variant.Value.Ptr); - }; - Action disposeComObject = variant => - { - Marshal.Release(variant.Value.Ptr); - }; - - disposers = new Dictionary>() - { - [VARTYPE.VT_LPSTR] = disposePtr, - [VARTYPE.VT_LPWSTR] = disposePtr, - [VARTYPE.VT_BSTR] = disposeBSTR, - [VARTYPE.VT_UNKNOWN] = disposeComObject, - [VARTYPE.VT_STREAM] = disposeComObject, - [VARTYPE.VT_STORAGE] = disposeComObject, - [VARTYPE.VT_VECTOR] = DisposeVector, - }; - } - - private static Dictionary> decoders; - private static Dictionary> disposers; - - public static bool TryDecode(ref PROPVARIANT variant, out T value) - { - const VARTYPE flagMask = VARTYPE.VT_ARRAY | VARTYPE.VT_VECTOR | VARTYPE.VT_BYREF; - bool hasFlag = (variant.Type & flagMask) != (VARTYPE)0; - Func decoder; - if (decoders.TryGetValue(variant.Type, out decoder) - || (hasFlag && decoders.TryGetValue(variant.Type & flagMask, out decoder))) - { - value = (T)decoder.Invoke(variant); - return true; - } - else - { - value = default(T); - return false; - } - } - - private static object DecodeVector(PROPVARIANT variant) - { - Type elementType; - int elementSize; - Func elementDecoder; - - switch (variant.Type & ~VARTYPE.VT_VECTOR) - { - case VARTYPE.VT_I1: - elementType = typeof(sbyte); - elementDecoder = ptr => (object)(sbyte)Marshal.ReadByte(ptr); - elementSize = 1; - break; - - case VARTYPE.VT_I2: - elementType = typeof(short); - elementDecoder = ptr => (object)Marshal.ReadInt16(ptr); - elementSize = 2; - break; - - case VARTYPE.VT_I4: - elementType = typeof(int); - elementDecoder = ptr => (object)Marshal.ReadInt32(ptr); - elementSize = 4; - break; - - case VARTYPE.VT_I8: - elementType = typeof(long); - elementDecoder = ptr => (object)Marshal.ReadInt64(ptr); - elementSize = 8; - break; - - case VARTYPE.VT_UI1: - elementType = typeof(byte); - elementDecoder = ptr => (object)Marshal.ReadByte(ptr); - elementSize = 1; - break; - - case VARTYPE.VT_UI2: - elementType = typeof(ushort); - elementDecoder = ptr => (object)(ushort)Marshal.ReadInt16(ptr); - elementSize = 2; - break; - - case VARTYPE.VT_UI4: - elementType = typeof(uint); - elementDecoder = ptr => (object)(uint)Marshal.ReadInt32(ptr); - elementSize = 4; - break; - - case VARTYPE.VT_UI8: - elementType = typeof(ulong); - elementDecoder = ptr => (object)(ulong)Marshal.ReadInt64(ptr); - elementSize = 8; - break; - - case VARTYPE.VT_LPSTR: - elementType = typeof(string); - elementDecoder = Marshal.PtrToStringAnsi; - elementSize = IntPtr.Size; - break; - - case VARTYPE.VT_LPWSTR: - elementType = typeof(string); - elementDecoder = Marshal.PtrToStringUni; - elementSize = IntPtr.Size; - break; - - case VARTYPE.VT_UNKNOWN: - case VARTYPE.VT_STREAM: - case VARTYPE.VT_STORAGE: - elementType = typeof(object); - elementDecoder = Marshal.GetObjectForIUnknown; - elementSize = IntPtr.Size; - break; - - default: - #warning `PropVariantHelpers.DecodeVector` does not yet know how to handle some `PROPVARIANT` types. - throw new System.NotImplementedException(); - } - - int length = variant.Value.Vector.Length; - var vector = Array.CreateInstance(elementType, length); - IntPtr elementPtr = variant.Value.Vector.Ptr; - for (int i = 0; i < length; ++i) - { - vector.SetValue(elementDecoder.Invoke(elementPtr), i); - elementPtr += elementSize; - } - - return vector; - } - - public static void Dispose(ref PROPVARIANT variant) - { - const VARTYPE flagMask = VARTYPE.VT_ARRAY | VARTYPE.VT_VECTOR | VARTYPE.VT_BYREF; - bool hasFlag = (variant.Type & flagMask) != (VARTYPE)0; - Action disposer; - if (disposers.TryGetValue(variant.Type, out disposer) - || (hasFlag && disposers.TryGetValue(variant.Type & flagMask, out disposer))) - { - disposer.Invoke(variant); - } - variant = new PROPVARIANT(); - } - - private static void DisposeVector(PROPVARIANT variant) - { - Action elementDisposer; - int elementSize; - - switch (variant.Type & ~VARTYPE.VT_VECTOR) - { - case VARTYPE.VT_BOOL: - case VARTYPE.VT_I1: - case VARTYPE.VT_I2: - case VARTYPE.VT_I4: - case VARTYPE.VT_I8: - case VARTYPE.VT_UI1: - case VARTYPE.VT_UI2: - case VARTYPE.VT_UI4: - case VARTYPE.VT_UI8: - case VARTYPE.VT_R4: - case VARTYPE.VT_R8: - elementDisposer = null; - elementSize = IntPtr.Size; - break; - - case VARTYPE.VT_BSTR: - elementDisposer = Marshal.FreeBSTR; - elementSize = IntPtr.Size; - break; - - case VARTYPE.VT_LPSTR: - case VARTYPE.VT_LPWSTR: - elementDisposer = Marshal.FreeCoTaskMem; - elementSize = IntPtr.Size; - break; - - case VARTYPE.VT_UNKNOWN: - case VARTYPE.VT_STREAM: - case VARTYPE.VT_STORAGE: - elementDisposer = ptr => { int ignored = Marshal.Release(ptr); }; - elementSize = IntPtr.Size; - break; - - default: - #warning `PropVariantHelpers.DisposeVector` does not yet know how to handle some `PROPVARIANT` types. - throw new System.NotImplementedException(); - } - - IntPtr vectorPtr = variant.Value.Vector.Ptr; - - // if necessary, dispose each of the vector's elements: - if (elementDisposer != null) - { - IntPtr elementPtr = vectorPtr; - for (int i = 0, n = variant.Value.Vector.Length; i < n; ++i) - { - elementDisposer.Invoke(elementPtr); - elementPtr += elementSize; - } - } - - // finally, dispose the vector array itself: - Marshal.FreeCoTaskMem(vectorPtr); - } - } -} diff --git a/src/modules/peek/WIC/Structures/PROPBAG2.cs b/src/modules/peek/WIC/Structures/PROPBAG2.cs deleted file mode 100644 index a133057399..0000000000 --- a/src/modules/peek/WIC/Structures/PROPBAG2.cs +++ /dev/null @@ -1,27 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [StructLayout(LayoutKind.Sequential)] - public struct PROPBAG2 - { - public PROPBAG2_Type dwType; - public VARTYPE vt; - public short cfType; - public int dwHint; - public IntPtr pstrName; - public Guid clsid; - } - - public enum PROPBAG2_Type : int - { - PROPBAG2_TYPE_UNDEFINED = 0, - PROPBAG2_TYPE_DATA = 1, - PROPBAG2_TYPE_URL = 2, - PROPBAG2_TYPE_OBJECT = 3, - PROPBAG2_TYPE_STREAM = 4, - PROPBAG2_TYPE_STORAGE = 5, - PROPBAG2_TYPE_MONIKER = 6 - } -} diff --git a/src/modules/peek/WIC/Structures/PROPVARIANT.cs b/src/modules/peek/WIC/Structures/PROPVARIANT.cs deleted file mode 100644 index d8875a3fe6..0000000000 --- a/src/modules/peek/WIC/Structures/PROPVARIANT.cs +++ /dev/null @@ -1,79 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - [StructLayout(LayoutKind.Sequential, Pack = 8)] - public struct PROPVARIANT - { - public VARTYPE Type; - public PROPVARIANT_Value Value; - } - - [StructLayout(LayoutKind.Explicit)] - public struct PROPVARIANT_Value - { - [FieldOffset(0)] - public sbyte I1; - - [FieldOffset(0)] - public byte UI1; - - [FieldOffset(0)] - public short I2; - - [FieldOffset(0)] - public ushort UI2; - - [FieldOffset(0)] - public int I4; - - [FieldOffset(0)] - public uint UI4; - - [FieldOffset(0)] - public long I8; - - [FieldOffset(0)] - public ulong UI8; - - [FieldOffset(0)] - public PROPVARIANT_SplitI8 SplitI8; - - [FieldOffset(0)] - public PROPVARIANT_SplitUI8 SplitUI8; - - [FieldOffset(0)] - public float R4; - - [FieldOffset(0)] - public double R8; - - [FieldOffset(0)] - public IntPtr Ptr; - - [FieldOffset(0)] - public PROPVARIANT_Vector Vector; - } - - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct PROPVARIANT_SplitI8 - { - public int A; - public int B; - } - - [StructLayout(LayoutKind.Sequential, Pack = 4)] - public struct PROPVARIANT_SplitUI8 - { - public uint A; - public uint B; - } - - [StructLayout(LayoutKind.Sequential)] - public struct PROPVARIANT_Vector - { - public int Length; - public IntPtr Ptr; - } -} diff --git a/src/modules/peek/WIC/Structures/Resolution.cs b/src/modules/peek/WIC/Structures/Resolution.cs deleted file mode 100644 index 0e8cde088d..0000000000 --- a/src/modules/peek/WIC/Structures/Resolution.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace WIC -{ - public struct Resolution - { - public Resolution(double dpiX, double dpiY) - { - DpiX = dpiX; - DpiY = dpiY; - } - - public double DpiX { get; } - public double DpiY { get; } - } -} diff --git a/src/modules/peek/WIC/Structures/STATSTG.cs b/src/modules/peek/WIC/Structures/STATSTG.cs deleted file mode 100644 index e6896d227d..0000000000 --- a/src/modules/peek/WIC/Structures/STATSTG.cs +++ /dev/null @@ -1,23 +0,0 @@ -using System; -using System.ComponentModel; -using System.Runtime.InteropServices; - -namespace WIC -{ - [StructLayout(LayoutKind.Sequential)] - [EditorBrowsable(EditorBrowsableState.Advanced)] - public struct STATSTG - { - [MarshalAs(UnmanagedType.LPWStr)] - public string pwcsName; - public STGTY type; - public long cbSize; - public long mtime; - public long ctime; - public long atime; - public STGM grfMode; - public LOCKTYPE grfLocksSupported; - public Guid clsid; - public int grfStateBits; - } -} diff --git a/src/modules/peek/WIC/Structures/Size.cs b/src/modules/peek/WIC/Structures/Size.cs deleted file mode 100644 index 796b452de0..0000000000 --- a/src/modules/peek/WIC/Structures/Size.cs +++ /dev/null @@ -1,14 +0,0 @@ -namespace WIC -{ - public struct Size - { - public Size(int width, int height) - { - Width = width; - Height = height; - } - - public int Width { get; } - public int Height { get; } - } -} diff --git a/src/modules/peek/WIC/Structures/VARTYPE.cs b/src/modules/peek/WIC/Structures/VARTYPE.cs deleted file mode 100644 index 866d6bd13b..0000000000 --- a/src/modules/peek/WIC/Structures/VARTYPE.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; - -namespace WIC -{ - [Flags] - public enum VARTYPE : short - { - VT_EMPTY = 0, - VT_NULL = 1, - VT_I2 = 2, - VT_I4 = 3, - VT_R4 = 4, - VT_R8 = 5, - VT_CY = 6, - VT_DATE = 7, - VT_BSTR = 8, - VT_DISPATCH = 9, - VT_ERROR = 10, - VT_BOOL = 11, - VT_VARIANT = 12, - VT_UNKNOWN = 13, - VT_DECIMAL = 14, - VT_I1 = 16, - VT_UI1 = 17, - VT_UI2 = 18, - VT_UI4 = 19, - VT_I8 = 20, - VT_UI8 = 21, - VT_INT = 22, - VT_UINT = 23, - VT_VOID = 24, - VT_HRESULT = 25, - VT_PTR = 26, - VT_SAFEARRAY = 27, - VT_CARRAY = 28, - VT_USERDEFINED = 29, - VT_LPSTR = 30, - VT_LPWSTR = 31, - VT_RECORD = 36, - VT_INT_PTR = 37, - VT_UINT_PTR = 38, - VT_FILETIME = 64, - VT_BLOB = 65, - VT_STREAM = 66, - VT_STORAGE = 67, - VT_STREAMED_OBJECT = 68, - VT_STORED_OBJECT = 69, - VT_BLOB_OBJECT = 70, - VT_CF = 71, - VT_CLSID = 72, - VT_VERSIONED_STREAM = 73, - VT_BSTR_BLOB = 0xfff, - - VT_VECTOR = 0x1000, - VT_ARRAY = 0x2000, - VT_BYREF = 0x4000, - VT_RESERVED = unchecked((short)0x8000U), - - VT_ILLEGAL = unchecked((short)0xffffU), - } -} diff --git a/src/modules/peek/WIC/Structures/WICBitmapPattern.cs b/src/modules/peek/WIC/Structures/WICBitmapPattern.cs deleted file mode 100644 index c30b0af02c..0000000000 --- a/src/modules/peek/WIC/Structures/WICBitmapPattern.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System; -using System.Runtime.InteropServices; - -namespace WIC -{ - public sealed class WICBitmapPattern - { - public long Position; - public int Length; - public byte[] Pattern; - public byte[] Mask; - public bool EndOfStream; - } - - [StructLayout(LayoutKind.Sequential)] - internal sealed class WICBitmapPatternRaw - { - public long Position; - public int Length; - public IntPtr Pattern; - public IntPtr Mask; - public bool EndOfStream; - } -} diff --git a/src/modules/peek/WIC/Structures/WICRect.cs b/src/modules/peek/WIC/Structures/WICRect.cs deleted file mode 100644 index 249ca8474b..0000000000 --- a/src/modules/peek/WIC/Structures/WICRect.cs +++ /dev/null @@ -1,13 +0,0 @@ -using System.Runtime.InteropServices; - -namespace WIC -{ - [StructLayout(LayoutKind.Sequential, Pack = 1, Size = 16)] - public struct WICRect - { - public int X; - public int Y; - public int Width; - public int Height; - } -} diff --git a/src/modules/peek/WIC/WIC.csproj b/src/modules/peek/WIC/WIC.csproj deleted file mode 100644 index 817265f1e9..0000000000 --- a/src/modules/peek/WIC/WIC.csproj +++ /dev/null @@ -1,10 +0,0 @@ - - - - net7.0-windows10.0.19041.0 - 10.0.19041.0 - win10-x86;win10-x64;win10-arm64 - enable - false - -