Skip to content

Commit f660461

Browse files
committed
documentation patch
1 parent da948c8 commit f660461

File tree

3 files changed

+65
-97
lines changed

3 files changed

+65
-97
lines changed

modules/highgui/include/opencv2/highgui.hpp

Lines changed: 60 additions & 94 deletions
Original file line numberDiff line numberDiff line change
@@ -172,21 +172,23 @@ namespace cv
172172
//! @addtogroup highgui
173173
//! @{
174174

175-
// Flags for namedWindow
176-
enum { WINDOW_NORMAL = 0x00000000, // the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size
177-
WINDOW_AUTOSIZE = 0x00000001, // the user cannot resize the window, the size is constrainted by the image displayed
178-
WINDOW_OPENGL = 0x00001000, // window with opengl support
179-
180-
WINDOW_FULLSCREEN = 1, // change the window to fullscreen
181-
WINDOW_FREERATIO = 0x00000100, // the image expends as much as it can (no ratio constraint)
182-
WINDOW_KEEPRATIO = 0x00000000 // the ratio of the image is respected
175+
//! Flags for cv::namedWindow
176+
enum WindowFlags {
177+
WINDOW_NORMAL = 0x00000000, //!< the user can resize the window (no constraint) / also use to switch a fullscreen window to a normal size
178+
WINDOW_AUTOSIZE = 0x00000001, //!< the user cannot resize the window, the size is constrainted by the image displayed
179+
WINDOW_OPENGL = 0x00001000, //!< window with opengl support
180+
181+
WINDOW_FULLSCREEN = 1, //!< change the window to fullscreen
182+
WINDOW_FREERATIO = 0x00000100, //!< the image expends as much as it can (no ratio constraint)
183+
WINDOW_KEEPRATIO = 0x00000000 //!< the ratio of the image is respected
183184
};
184185

185-
// Flags for set / getWindowProperty
186-
enum { WND_PROP_FULLSCREEN = 0, // fullscreen property (can be WINDOW_NORMAL or WINDOW_FULLSCREEN)
187-
WND_PROP_AUTOSIZE = 1, // autosize property (can be WINDOW_NORMAL or WINDOW_AUTOSIZE)
188-
WND_PROP_ASPECT_RATIO = 2, // window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO);
189-
WND_PROP_OPENGL = 3 // opengl support
186+
//! Flags for cv::setWindowProperty / cv::getWindowProperty
187+
enum WindowPropertyFlags {
188+
WND_PROP_FULLSCREEN = 0, //!< fullscreen property (can be WINDOW_NORMAL or WINDOW_FULLSCREEN)
189+
WND_PROP_AUTOSIZE = 1, //!< autosize property (can be WINDOW_NORMAL or WINDOW_AUTOSIZE)
190+
WND_PROP_ASPECT_RATIO = 2, //!< window's aspect ration (can be set to WINDOW_FREERATIO or WINDOW_KEEPRATIO);
191+
WND_PROP_OPENGL = 3 //!< opengl support
190192
};
191193

192194
enum { EVENT_MOUSEMOVE = 0,
@@ -211,24 +213,27 @@ enum { EVENT_FLAG_LBUTTON = 1,
211213
EVENT_FLAG_ALTKEY = 32
212214
};
213215

214-
// Qt font
215-
enum { QT_FONT_LIGHT = 25, //QFont::Light,
216-
QT_FONT_NORMAL = 50, //QFont::Normal,
217-
QT_FONT_DEMIBOLD = 63, //QFont::DemiBold,
218-
QT_FONT_BOLD = 75, //QFont::Bold,
219-
QT_FONT_BLACK = 87 //QFont::Black
216+
//! Qt font weight
217+
enum QtFontWeights {
218+
QT_FONT_LIGHT = 25, //!< QFont::Light ( Weight of 25 )
219+
QT_FONT_NORMAL = 50, //!< QFont::Normal ( Weight of 50 )
220+
QT_FONT_DEMIBOLD = 63, //!< QFont::DemiBold ( Weight of 63 )
221+
QT_FONT_BOLD = 75, //!< QFont::Bold ( Weight of 75 )
222+
QT_FONT_BLACK = 87 //!< QFont::Black ( Weight of 87 )
220223
};
221224

222-
// Qt font style
223-
enum { QT_STYLE_NORMAL = 0, //QFont::StyleNormal,
224-
QT_STYLE_ITALIC = 1, //QFont::StyleItalic,
225-
QT_STYLE_OBLIQUE = 2 //QFont::StyleOblique
225+
//! Qt font style
226+
enum QtFontStyles {
227+
QT_STYLE_NORMAL = 0, //!< QFont::StyleNormal
228+
QT_STYLE_ITALIC = 1, //!< QFont::StyleItalic
229+
QT_STYLE_OBLIQUE = 2 //!< QFont::StyleOblique
226230
};
227231

228-
// Qt "button" type
229-
enum { QT_PUSH_BUTTON = 0,
230-
QT_CHECKBOX = 1,
231-
QT_RADIOBOX = 2
232+
//! Qt "button" type
233+
enum QtButtonTypes {
234+
QT_PUSH_BUTTON = 0, //!< Push button
235+
QT_CHECKBOX = 1, //!< Checkbox button
236+
QT_RADIOBOX = 2 //!< Radiobox button
232237
};
233238

234239

@@ -240,32 +245,28 @@ typedef void (*ButtonCallback)(int state, void* userdata);
240245
/** @brief Creates a window.
241246
242247
@param winname Name of the window in the window caption that may be used as a window identifier.
243-
@param flags Flags of the window. The supported flags are:
244-
> - **WINDOW_NORMAL** If this is set, the user can resize the window (no constraint).
245-
> - **WINDOW_AUTOSIZE** If this is set, the window size is automatically adjusted to fit the
246-
> displayed image (see imshow ), and you cannot change the window size manually.
247-
> - **WINDOW_OPENGL** If this is set, the window will be created with OpenGL support.
248+
@param flags Flags of the window. The supported flags are: (cv::WindowFlags)
248249
249250
The function namedWindow creates a window that can be used as a placeholder for images and
250251
trackbars. Created windows are referred to by their names.
251252
252253
If a window with the same name already exists, the function does nothing.
253254
254-
You can call destroyWindow or destroyAllWindows to close the window and de-allocate any associated
255+
You can call cv::destroyWindow or cv::destroyAllWindows to close the window and de-allocate any associated
255256
memory usage. For a simple program, you do not really have to call these functions because all the
256257
resources and windows of the application are closed automatically by the operating system upon exit.
257258
258259
@note
259260
260261
Qt backend supports additional flags:
261-
- **CV_WINDOW_NORMAL or CV_WINDOW_AUTOSIZE:** CV_WINDOW_NORMAL enables you to resize the
262-
window, whereas CV_WINDOW_AUTOSIZE adjusts automatically the window size to fit the
262+
- **WINDOW_NORMAL or WINDOW_AUTOSIZE:** WINDOW_NORMAL enables you to resize the
263+
window, whereas WINDOW_AUTOSIZE adjusts automatically the window size to fit the
263264
displayed image (see imshow ), and you cannot change the window size manually.
264-
- **CV_WINDOW_FREERATIO or CV_WINDOW_KEEPRATIO:** CV_WINDOW_FREERATIO adjusts the image
265-
with no respect to its ratio, whereas CV_WINDOW_KEEPRATIO keeps the image ratio.
265+
- **WINDOW_FREERATIO or WINDOW_KEEPRATIO:** WINDOW_FREERATIO adjusts the image
266+
with no respect to its ratio, whereas WINDOW_KEEPRATIO keeps the image ratio.
266267
- **CV_GUI_NORMAL or CV_GUI_EXPANDED:** CV_GUI_NORMAL is the old way to draw the window
267268
without statusbar and toolbar, whereas CV_GUI_EXPANDED is a new enhanced GUI.
268-
By default, flags == CV_WINDOW_AUTOSIZE | CV_WINDOW_KEEPRATIO | CV_GUI_EXPANDED
269+
By default, flags == WINDOW_AUTOSIZE | WINDOW_KEEPRATIO | CV_GUI_EXPANDED
269270
*/
270271
CV_EXPORTS_W void namedWindow(const String& winname, int flags = WINDOW_AUTOSIZE);
271272

@@ -314,7 +315,7 @@ CV_EXPORTS_W int waitKey(int delay = 0);
314315
@param mat Image to be shown.
315316
316317
The function imshow displays an image in the specified window. If the window was created with the
317-
CV_WINDOW_AUTOSIZE flag, the image is shown with its original size, however it is still limited by the screen resolution.
318+
WINDOW_AUTOSIZE flag, the image is shown with its original size, however it is still limited by the screen resolution.
318319
Otherwise, the image is scaled to fit the window. The function may scale the image, depending on its depth:
319320
320321
- If the image is 8-bit unsigned, it is displayed as is.
@@ -326,20 +327,22 @@ Otherwise, the image is scaled to fit the window. The function may scale the ima
326327
If window was created with OpenGL support, imshow also support ogl::Buffer , ogl::Texture2D and
327328
cuda::GpuMat as input.
328329
329-
If the window was not created before this function, it is assumed creating a window with CV_WINDOW_AUTOSIZE.
330+
If the window was not created before this function, it is assumed creating a window with WINDOW_AUTOSIZE.
330331
331332
If you need to show an image that is bigger than the screen resolution, you will need to call namedWindow("", WINDOW_NORMAL) before the imshow.
332333
333-
@note This function should be followed by waitKey function which displays the image for specified
334-
milliseconds. Otherwise, it won't display the image. For example, waitKey(0) will display the window
335-
infinitely until any keypress (it is suitable for image display). waitKey(25) will display a frame
334+
@note This function should be followed by cv::waitKey function which displays the image for specified
335+
milliseconds. Otherwise, it won't display the image. For example, cv::waitKey(0) will display the window
336+
infinitely until any keypress (it is suitable for image display). cv::waitKey(25) will display a frame
336337
for 25 ms, after which display will be automatically closed. (If you put it in a loop to read
337338
videos, it will display the video frame-by-frame)
338339
339340
@note
340341
341342
[Windows Backend Only] Pressing Ctrl+C will copy the image to the clipboard.
342343
344+
[Windows Backend Only] Pressing Ctrl+S will show a dialog to save the image.
345+
343346
*/
344347
CV_EXPORTS_W void imshow(const String& winname, InputArray mat);
345348

@@ -352,7 +355,7 @@ CV_EXPORTS_W void imshow(const String& winname, InputArray mat);
352355
@note
353356
354357
- The specified window size is for the image area. Toolbars are not counted.
355-
- Only windows created without CV_WINDOW_AUTOSIZE flag can be resized.
358+
- Only windows created without WINDOW_AUTOSIZE flag can be resized.
356359
*/
357360
CV_EXPORTS_W void resizeWindow(const String& winname, int width, int height);
358361

@@ -367,21 +370,8 @@ CV_EXPORTS_W void moveWindow(const String& winname, int x, int y);
367370
/** @brief Changes parameters of a window dynamically.
368371
369372
@param winname Name of the window.
370-
@param prop_id Window property to edit. The following operation flags are available:
371-
- **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( CV_WINDOW_NORMAL or
372-
CV_WINDOW_FULLSCREEN ).
373-
- **CV_WND_PROP_AUTOSIZE** Change if the window is resizable (CV_WINDOW_NORMAL or
374-
CV_WINDOW_AUTOSIZE ).
375-
- **CV_WND_PROP_ASPECTRATIO** Change if the aspect ratio of the image is preserved (
376-
CV_WINDOW_FREERATIO or CV_WINDOW_KEEPRATIO ).
377-
@param prop_value New value of the window property. The following operation flags are available:
378-
- **CV_WINDOW_NORMAL** Change the window to normal size or make the window resizable.
379-
- **CV_WINDOW_AUTOSIZE** Constrain the size by the displayed image. The window is not
380-
resizable.
381-
- **CV_WINDOW_FULLSCREEN** Change the window to fullscreen.
382-
- **CV_WINDOW_FREERATIO** Make the window resizable without any ratio constraints.
383-
- **CV_WINDOW_KEEPRATIO** Make the window resizable, but preserve the proportions of the
384-
displayed image.
373+
@param prop_id Window property to edit. The supported operation flags are: (cv::WindowPropertyFlags)
374+
@param prop_value New value of the window property. The supported flags are: (cv::WindowFlags)
385375
386376
The function setWindowProperty enables changing properties of a window.
387377
*/
@@ -394,13 +384,7 @@ CV_EXPORTS_W void setWindowTitle(const String& winname, const String& title);
394384
/** @brief Provides parameters of a window.
395385
396386
@param winname Name of the window.
397-
@param prop_id Window property to retrieve. The following operation flags are available:
398-
- **CV_WND_PROP_FULLSCREEN** Change if the window is fullscreen ( CV_WINDOW_NORMAL or
399-
CV_WINDOW_FULLSCREEN ).
400-
- **CV_WND_PROP_AUTOSIZE** Change if the window is resizable (CV_WINDOW_NORMAL or
401-
CV_WINDOW_AUTOSIZE ).
402-
- **CV_WND_PROP_ASPECTRATIO** Change if the aspect ratio of the image is preserved
403-
(CV_WINDOW_FREERATIO or CV_WINDOW_KEEPRATIO ).
387+
@param prop_id Window property to retrieve. The following operation flags are available: (cv::WindowPropertyFlags)
404388
405389
See setWindowProperty to know the meaning of the returned values.
406390
@@ -466,10 +450,6 @@ control panel.
466450
467451
Clicking the label of each trackbar enables editing the trackbar values manually.
468452
469-
@note
470-
471-
- An example of using the trackbar functionality can be found at
472-
opencv_source_code/samples/cpp/connected_components.cpp
473453
*/
474454
CV_EXPORTS int createTrackbar(const String& trackbarname, const String& winname,
475455
int* value, int count,
@@ -609,25 +589,15 @@ struct QtFont
609589
font is set to a system-dependent default value. Generally, this is 12 points.
610590
@param color Color of the font in BGRA where A = 255 is fully transparent. Use the macro CV _ RGB
611591
for simplicity.
612-
@param weight Font weight. The following operation flags are available:
613-
- **CV_FONT_LIGHT** Weight of 25
614-
- **CV_FONT_NORMAL** Weight of 50
615-
- **CV_FONT_DEMIBOLD** Weight of 63
616-
- **CV_FONT_BOLD** Weight of 75
617-
- **CV_FONT_BLACK** Weight of 87
618-
619-
You can also specify a positive integer for better control.
620-
@param style Font style. The following operation flags are available:
621-
- **CV_STYLE_NORMAL** Normal font
622-
- **CV_STYLE_ITALIC** Italic font
623-
- **CV_STYLE_OBLIQUE** Oblique font
592+
@param weight Font weight. Available operation flags are : (cv::QtFontWeights) You can also specify a positive integer for better control.
593+
@param style Font style. The following operation flags are available: (cv::QtFontStyles)
624594
@param spacing Spacing between characters. It can be negative or positive.
625595
626-
The function fontQt creates a CvFont object. This CvFont is not compatible with putText .
596+
The function fontQt creates a QtFont object. This QtFont is not compatible with putText .
627597
628598
A basic usage of this function is the following: :
629599
@code
630-
CvFont font = fontQt(''Times'');
600+
QtFont font = fontQt(''Times'');
631601
addText( img1, ``Hello World !'', Point(50,50), font);
632602
@endcode
633603
*/
@@ -642,7 +612,7 @@ CV_EXPORTS QtFont fontQt(const String& nameFont, int pointSize = -1,
642612
@param org Point(x,y) where the text should start on an image.
643613
@param font Font to use to draw a text.
644614
645-
The function addText draws *text* on an image *img* using a specific font *font* (see example fontQt
615+
The function addText draws *text* on an image *img* using a specific font *font* (see example cv::fontQt
646616
)
647617
*/
648618
CV_EXPORTS void addText( const Mat& img, const String& text, Point org, const QtFont& font);
@@ -669,7 +639,7 @@ CV_EXPORTS void displayOverlay(const String& winname, const String& text, int de
669639
the previous text timed out, the timer is restarted and the text is updated. If this value is
670640
zero, the text never disappears.
671641
672-
The function displayOverlay displays useful information/tips on top of the window for a certain
642+
The function displayStatusBar displays useful information/tips on top of the window for a certain
673643
amount of time *delayms* . This information is displayed on the window statusbar (the window must be
674644
created with the CV_GUI_EXPANDED flags).
675645
*/
@@ -705,11 +675,7 @@ CV_EXPORTS void stopLoop();
705675
This function should be prototyped as void Foo(int state,\*void); . *state* is the current state
706676
of the button. It could be -1 for a push button, 0 or 1 for a check/radio box button.
707677
@param userdata Pointer passed to the callback function.
708-
@param type Optional type of the button.
709-
- **CV_PUSH_BUTTON** Push button
710-
- **CV_CHECKBOX** Checkbox button
711-
- **CV_RADIOBOX** Radiobox button. The radiobox on the same buttonbar (same line) are
712-
exclusive, that is only one can be selected at a time.
678+
@param type Optional type of the button. Available types are: (cv::QtButtonTypes)
713679
@param initial_button_state Default state of the button. Use for checkbox and radiobox. Its
714680
value could be 0 or 1. *(Optional)*
715681
@@ -720,10 +686,10 @@ control panel before, or if the last element attached to the control panel was a
720686
See below various examples of the createButton function call: :
721687
@code
722688
createButton(NULL,callbackButton);//create a push button "button 0", that will call callbackButton.
723-
createButton("button2",callbackButton,NULL,CV_CHECKBOX,0);
689+
createButton("button2",callbackButton,NULL,QT_CHECKBOX,0);
724690
createButton("button3",callbackButton,&value);
725-
createButton("button5",callbackButton1,NULL,CV_RADIOBOX);
726-
createButton("button6",callbackButton2,NULL,CV_PUSH_BUTTON,1);
691+
createButton("button5",callbackButton1,NULL,QT_RADIOBOX);
692+
createButton("button6",callbackButton2,NULL,QT_PUSH_BUTTON,1);
727693
@endcode
728694
*/
729695
CV_EXPORTS int createButton( const String& bar_name, ButtonCallback on_change,

modules/imgcodecs/include/opencv2/imgcodecs.hpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ returns an empty matrix ( Mat::data==NULL ). Currently, the following file forma
110110
- JPEG 2000 files - \*.jp2 (see the *Notes* section)
111111
- Portable Network Graphics - \*.png (see the *Notes* section)
112112
- WebP - \*.webp (see the *Notes* section)
113-
- Portable image format - \*.pbm, \*.pgm, \*.ppm (always supported)
113+
- Portable image format - \*.pbm, \*.pgm, \*.ppm \*.pxm, \*.pnm (always supported)
114114
- Sun rasters - \*.sr, \*.ras (always supported)
115115
- TIFF files - \*.tiff, \*.tif (see the *Notes* section)
116+
- OpenEXR Image files - \*.exr (see the *Notes* section)
117+
- Radiance HDR - \*.hdr, \*.pic (always supported)
116118
117119
@note
118120

modules/imgproc/include/opencv2/imgproc.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1968,8 +1968,8 @@ If you want to decimate the image by factor of 2 in each direction, you can call
19681968
// specify fx and fy and let the function compute the destination image size.
19691969
resize(src, dst, Size(), 0.5, 0.5, interpolation);
19701970
@endcode
1971-
To shrink an image, it will generally look best with CV_INTER_AREA interpolation, whereas to
1972-
enlarge an image, it will generally look best with CV_INTER_CUBIC (slow) or CV_INTER_LINEAR
1971+
To shrink an image, it will generally look best with cv::INTER_AREA interpolation, whereas to
1972+
enlarge an image, it will generally look best with cv::INTER_CUBIC (slow) or cv::INTER_LINEAR
19731973
(faster but still looks OK).
19741974
19751975
@param src input image.

0 commit comments

Comments
 (0)