€•J'Œsphinx.addnodes”Œdocument”“”)”}”(Œ rawsource”Œ”Œchildren”]”(Œ translations”Œ LanguagesNode”“”)”}”(hhh]”(hŒ pending_xref”“”)”}”(hhh]”Œdocutils.nodes”ŒText”“”ŒChinese (Simplified)”…””}”Œparent”hsbaŒ attributes”}”(Œids”]”Œclasses”]”Œnames”]”Œdupnames”]”Œbackrefs”]”Œ refdomain”Œstd”Œreftype”Œdoc”Œ reftarget”ŒB/translations/zh_CN/userspace-api/media/v4l/selection-api-examples”Œmodname”NŒ classname”NŒ refexplicit”ˆuŒtagname”hhh ubh)”}”(hhh]”hŒChinese (Traditional)”…””}”hh2sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒB/translations/zh_TW/userspace-api/media/v4l/selection-api-examples”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒItalian”…””}”hhFsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒB/translations/it_IT/userspace-api/media/v4l/selection-api-examples”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒJapanese”…””}”hhZsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒB/translations/ja_JP/userspace-api/media/v4l/selection-api-examples”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒKorean”…””}”hhnsbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒB/translations/ko_KR/userspace-api/media/v4l/selection-api-examples”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒPortuguese (Brazilian)”…””}”hh‚sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒB/translations/pt_BR/userspace-api/media/v4l/selection-api-examples”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubh)”}”(hhh]”hŒSpanish”…””}”hh–sbah}”(h]”h ]”h"]”h$]”h&]”Œ refdomain”h)Œreftype”h+Œ reftarget”ŒB/translations/sp_SP/userspace-api/media/v4l/selection-api-examples”Œmodname”NŒ classname”NŒ refexplicit”ˆuh1hhh ubeh}”(h]”h ]”h"]”h$]”h&]”Œcurrent_language”ŒEnglish”uh1h hhŒ _document”hŒsource”NŒline”NubhŒcomment”“”)”}”(hŒ8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later”h]”hŒ8SPDX-License-Identifier: GFDL-1.1-no-invariants-or-later”…””}”hh·sbah}”(h]”h ]”h"]”h$]”h&]”Œ xml:space”Œpreserve”uh1hµhhh²hh³Œ\/var/lib/git/docbuild/linux/Documentation/userspace-api/media/v4l/selection-api-examples.rst”h´KubhŒsection”“”)”}”(hhh]”(hŒtitle”“”)”}”(hŒExamples”h]”hŒExamples”…””}”(hhÏh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhhÊh²hh³hÇh´KubhŒ paragraph”“”)”}”(hŒ­(A video capture device is assumed; change ``V4L2_BUF_TYPE_VIDEO_CAPTURE`` for other devices; change target to ``V4L2_SEL_TGT_COMPOSE_*`` family to configure composing area)”h]”(hŒ+(A video capture device is assumed; change ”…””}”(hhßh²hh³Nh´NubhŒliteral”“”)”}”(hŒ``V4L2_BUF_TYPE_VIDEO_CAPTURE``”h]”hŒV4L2_BUF_TYPE_VIDEO_CAPTURE”…””}”(hhéh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçhhßubhŒ% for other devices; change target to ”…””}”(hhßh²hh³Nh´Nubhè)”}”(hŒ``V4L2_SEL_TGT_COMPOSE_*``”h]”hŒV4L2_SEL_TGT_COMPOSE_*”…””}”(hhûh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçhhßubhŒ$ family to configure composing area)”…””}”(hhßh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´KhhÊh²hubhÉ)”}”(hhh]”(hÎ)”}”(hŒ*Example: Resetting the cropping parameters”h]”hŒ*Example: Resetting the cropping parameters”…””}”(hjh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjh²hh³hÇh´K ubhŒ literal_block”“”)”}”(hXstruct v4l2_selection sel = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, .target = V4L2_SEL_TGT_CROP_DEFAULT, }; ret = ioctl(fd, VIDIOC_G_SELECTION, &sel); if (ret) exit(-1); sel.target = V4L2_SEL_TGT_CROP; ret = ioctl(fd, VIDIOC_S_SELECTION, &sel); if (ret) exit(-1);”h]”hXstruct v4l2_selection sel = { .type = V4L2_BUF_TYPE_VIDEO_CAPTURE, .target = V4L2_SEL_TGT_CROP_DEFAULT, }; ret = ioctl(fd, VIDIOC_G_SELECTION, &sel); if (ret) exit(-1); sel.target = V4L2_SEL_TGT_CROP; ret = ioctl(fd, VIDIOC_S_SELECTION, &sel); if (ret) exit(-1);”…””}”hj&sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆŒforce”‰Œlanguage”Œc”Œhighlight_args”}”uh1j$h³hÇh´Khjh²hubhÞ)”}”(hŒfSetting a composing area on output of size of *at most* half of limit placed at a center of a display.”h]”(hŒ.Setting a composing area on output of size of ”…””}”(hj9h²hh³Nh´NubhŒemphasis”“”)”}”(hŒ *at most*”h]”hŒat most”…””}”(hjCh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1jAhj9ubhŒ/ half of limit placed at a center of a display.”…””}”(hj9h²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´Khjh²hubeh}”(h]”Œ)example-resetting-the-cropping-parameters”ah ]”h"]”Œ*example: resetting the cropping parameters”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K ubhÉ)”}”(hhh]”(hÎ)”}”(hŒExample: Simple downscaling”h]”hŒExample: Simple downscaling”…””}”(hjfh²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhjch²hh³hÇh´K!ubj%)”}”(hXìstruct v4l2_selection sel = { .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, .target = V4L2_SEL_TGT_COMPOSE_BOUNDS, }; struct v4l2_rect r; ret = ioctl(fd, VIDIOC_G_SELECTION, &sel); if (ret) exit(-1); /* setting smaller compose rectangle */ r.width = sel.r.width / 2; r.height = sel.r.height / 2; r.left = sel.r.width / 4; r.top = sel.r.height / 4; sel.r = r; sel.target = V4L2_SEL_TGT_COMPOSE; sel.flags = V4L2_SEL_FLAG_LE; ret = ioctl(fd, VIDIOC_S_SELECTION, &sel); if (ret) exit(-1);”h]”hXìstruct v4l2_selection sel = { .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, .target = V4L2_SEL_TGT_COMPOSE_BOUNDS, }; struct v4l2_rect r; ret = ioctl(fd, VIDIOC_G_SELECTION, &sel); if (ret) exit(-1); /* setting smaller compose rectangle */ r.width = sel.r.width / 2; r.height = sel.r.height / 2; r.left = sel.r.width / 4; r.top = sel.r.height / 4; sel.r = r; sel.target = V4L2_SEL_TGT_COMPOSE; sel.flags = V4L2_SEL_FLAG_LE; ret = ioctl(fd, VIDIOC_S_SELECTION, &sel); if (ret) exit(-1);”…””}”hjtsbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj4‰j5j6j7}”uh1j$h³hÇh´K#hjch²hubhÞ)”}”(hŒYA video output device is assumed; change ``V4L2_BUF_TYPE_VIDEO_OUTPUT`` for other devices”h]”(hŒ)A video output device is assumed; change ”…””}”(hjƒh²hh³Nh´Nubhè)”}”(hŒ``V4L2_BUF_TYPE_VIDEO_OUTPUT``”h]”hŒV4L2_BUF_TYPE_VIDEO_OUTPUT”…””}”(hj‹h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hçhjƒubhŒ for other devices”…””}”(hjƒh²hh³Nh´Nubeh}”(h]”h ]”h"]”h$]”h&]”uh1hÝh³hÇh´K:hjch²hubeh}”(h]”Œexample-simple-downscaling”ah ]”h"]”Œexample: simple downscaling”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K!ubhÉ)”}”(hhh]”(hÎ)”}”(hŒ%Example: Querying for scaling factors”h]”hŒ%Example: Querying for scaling factors”…””}”(hj®h²hh³Nh´Nubah}”(h]”h ]”h"]”h$]”h&]”uh1hÍhj«h²hh³hÇh´K>ubj%)”}”(hXstruct v4l2_selection compose = { .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, .target = V4L2_SEL_TGT_COMPOSE, }; struct v4l2_selection crop = { .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, .target = V4L2_SEL_TGT_CROP, }; double hscale, vscale; ret = ioctl(fd, VIDIOC_G_SELECTION, &compose); if (ret) exit(-1); ret = ioctl(fd, VIDIOC_G_SELECTION, &crop); if (ret) exit(-1); /* computing scaling factors */ hscale = (double)compose.r.width / crop.r.width; vscale = (double)compose.r.height / crop.r.height;”h]”hXstruct v4l2_selection compose = { .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, .target = V4L2_SEL_TGT_COMPOSE, }; struct v4l2_selection crop = { .type = V4L2_BUF_TYPE_VIDEO_OUTPUT, .target = V4L2_SEL_TGT_CROP, }; double hscale, vscale; ret = ioctl(fd, VIDIOC_G_SELECTION, &compose); if (ret) exit(-1); ret = ioctl(fd, VIDIOC_G_SELECTION, &crop); if (ret) exit(-1); /* computing scaling factors */ hscale = (double)compose.r.width / crop.r.width; vscale = (double)compose.r.height / crop.r.height;”…””}”hj¼sbah}”(h]”h ]”h"]”h$]”h&]”hÅhÆj4‰j5j6j7}”uh1j$h³hÇh´K@hj«h²hubeh}”(h]”Œ$example-querying-for-scaling-factors”ah ]”h"]”Œ%example: querying for scaling factors”ah$]”h&]”uh1hÈhhÊh²hh³hÇh´K>ubeh}”(h]”Œexamples”ah ]”h"]”Œexamples”ah$]”h&]”uh1hÈhhh²hh³hÇh´Kubeh}”(h]”h ]”h"]”h$]”h&]”Œsource”hÇuh1hŒcurrent_source”NŒ current_line”NŒsettings”Œdocutils.frontend”ŒValues”“”)”}”(hÍNŒ generator”NŒ datestamp”NŒ source_link”NŒ source_url”NŒ toc_backlinks”Œentry”Œfootnote_backlinks”KŒ sectnum_xform”KŒstrip_comments”NŒstrip_elements_with_classes”NŒ strip_classes”NŒ report_level”KŒ halt_level”KŒexit_status_level”KŒdebug”NŒwarning_stream”NŒ traceback”ˆŒinput_encoding”Œ utf-8-sig”Œinput_encoding_error_handler”Œstrict”Œoutput_encoding”Œutf-8”Œoutput_encoding_error_handler”jþŒerror_encoding”Œutf-8”Œerror_encoding_error_handler”Œbackslashreplace”Œ language_code”Œen”Œrecord_dependencies”NŒconfig”NŒ id_prefix”hŒauto_id_prefix”Œid”Œ dump_settings”NŒdump_internals”NŒdump_transforms”NŒdump_pseudo_xml”NŒexpose_internals”NŒstrict_visitor”NŒ_disable_config”NŒ_source”hÇŒ _destination”NŒ _config_files”]”Œ7/var/lib/git/docbuild/linux/Documentation/docutils.conf”aŒfile_insertion_enabled”ˆŒ raw_enabled”KŒline_length_limit”M'Œpep_references”NŒ pep_base_url”Œhttps://peps.python.org/”Œpep_file_url_template”Œpep-%04d”Œrfc_references”NŒ rfc_base_url”Œ&https://datatracker.ietf.org/doc/html/”Œ tab_width”KŒtrim_footnote_reference_space”‰Œsyntax_highlight”Œlong”Œ smart_quotes”ˆŒsmartquotes_locales”]”Œcharacter_level_inline_markup”‰Œdoctitle_xform”‰Œ docinfo_xform”KŒsectsubtitle_xform”‰Œ image_loading”Œlink”Œembed_stylesheet”‰Œcloak_email_addresses”ˆŒsection_self_link”‰Œenv”NubŒreporter”NŒindirect_targets”]”Œsubstitution_defs”}”Œsubstitution_names”}”Œrefnames”}”Œrefids”}”Œnameids”}”(jØjÕj`j]j¨j¥jÐjÍuŒ nametypes”}”(j؉j`‰j¨‰jЉuh}”(jÕhÊj]jj¥jcjÍj«uŒ footnote_refs”}”Œ citation_refs”}”Œ autofootnotes”]”Œautofootnote_refs”]”Œsymbol_footnotes”]”Œsymbol_footnote_refs”]”Œ footnotes”]”Œ citations”]”Œautofootnote_start”KŒsymbol_footnote_start”KŒ id_counter”Œ collections”ŒCounter”“”}”…”R”Œparse_messages”]”Œtransform_messages”]”Œ transformer”NŒ include_log”]”Œ decoration”Nh²hub.