DevIL_manual (1265195), страница 4

Файл №1265195 DevIL_manual (Задания) 4 страницаDevIL_manual (1265195) страница 42021-08-18СтудИзба
Просмтор этого файла доступен только зарегистрированным пользователям. Но у нас супер быстрая регистрация: достаточно только электронной почты!

Текст из файла (страница 4)

See [language #defines], page 23 for a list of possible values.Be aware that if the Unicode version of DevIL is not being used, some translations willnot display properly. An example is Arabic, which uses characters outside of the standardASCII character set.Chapter 7: Image Manipulation137 Image ManipulationILU (Image Library Utilities) contains functions to manipulate any type of image in a varietyof ways. Some functions filter images, while others perform a wider variety of operations,such as scaling an image.

This section will give a comparison of the utility functions againstthe below figure.Original, unmodified image7.1 AlienifyingiluAlienify is a filter I created purely by accident, when I was attempting to write colourmatrix code. The effect iluAlienify gives to an image is a green and purple tint. Onimages with humans in them, iluAlienify generally makes the people look green, hence thefabricated term “alienify”.

iluAlienify does not accept any parameters. The figure belowillustrates this effect on the DevIL logo.“Alienified” image7.2 BlurringILU has two blurring functions iluBlurAverage and iluBlurGaussian. Blurring canbe used for a simple motion blur effect or something as sophisticated as concealing theidentity of a person in an image.

Both of these functions use a convolution filter andmultiple iterations to blur an image. Gaussian blurs look more natural than averagingblurs, because the center pixel in the convolution filter “weighs” more. For an in-depthdescription of convolution filters, see the excellent Elementary Digital Filtering article athttp://www.gamedev.net/reference/programming/features/edf/.iluBlurAverage and iluBlurGaussian are functionally equivalent. Both functions accept a single parameter. Call the desired function with the number of iterations of blurringyou wish to be performed on the image. Increase the number of iterations to increase theblurriness of an image.Average blurred with 10 iterations appliedChapter 7: Image Manipulation14Gaussian blurred with 10 iterations applied7.3 ContrastILU can apply more colour contrast to your image by brightening the lights and darkeningthe darks via iluContrast.

This effect can make a dull image livelier and “stand out”more.iluContrast accepts a single parameter describing the desired amount of contrast tomodify the image by. A value of 1.0 does not affect the image. Values above 1.0 to 1.7increase the amount of contrast in the image, with 1.7 increasing the contrast the most.Values from 0.0 to 1.0 decrease the amount of contrast in the image. Values outside of the0.0 to 1.7 range will give undefined results. -0.5 to 0.0 will actually create a negative of theimage and increase the contrast.Contrast of 0.1Contrast of 1.77.4 EqualizationSometimes it may be useful to equalize an image that is, bring the extreme colour valuesto a median point.

iluEqualize darkens the bright colours and lightens the dark colours,reducing the contrast in an image or “equalizing” it. The below figure shows the results ofapplying iluEqualize to the DevIL image.Equalized image7.5 Gamma CorrectioniluGammaCorrect applies gamma correction to an image using an exponential curve. Thesingle parameter iluGammaCorrect accepts is the gamma correction factor you wish to use.A gamma correction factor of 1.0 leaves the image unmodified. Values in the range 0.0 1.0 darken the image. 0.0 leaves a totally black image.

Anything above 1.0 brightens theimage, but values too large may saturate the image.Chapter 7: Image Manipulation15Result of gamma correction of 0.5Result of gamma correction of 2.07.6 NegativityiluNegative is a very basic function that inverts every pixel’s colour in an image. Forexample, pure white becomes pure black, and vice-versa. The resulting colour of a pixel canbe determined by this formula: new colour = ~old colour (where the tilde is the negationof the set of bits).

iluNegative does not accept any parameters and is reversible by callingit again.iluNegative example7.7 NoiseILU can add “random” noise to any image to make it appear noisy. The function,iluNoisify, simply uses the standard libc rand function after initializing it with a seedto srand. If your program depends on a different seed to rand, reset it after callingiluNoisify. The seed ILU uses is the standard time(NULL) call.

Of course, the noiseadded to the image is not totally random, since no such thing exists, but there should beno repeating, except in extremely large images.iluNoisify accepts a single parameter the tolerance to use. This parameter is aclamped (float) value that should be in the range 0.0f - 1.0f. Lower values indicate a lowertolerance, while higher values indicate the opposite. The tolerance indicates just how muchof a mono intensity that iluNoisify is allowed to apply to each pixel.

A “random” monointensity is applied to each pixel so that you will not end up with totally new colours, justthe same colours with a different luminance value. Colours change by both negative andpositive values, so some pixels may be darker, some may be lighter, and others will remainthe same.Result of iluNoisify with a0.50 toleranceResult of iluNoisify with a1.0 toleranceChapter 7: Image Manipulation167.8 PixelizationiluPixelize creates pixelized images by averaging the colour values of blocks of pixels.The single parameter passed to iluPixelize determines the size of these square blocks.The result is a pixelized image.Call iluPixelize with values greater than 1 to pixelize the image. The larger the values,the larger the pixel blocks will be. A value of 1 will leave the image unchanged.

Values lessthan 1 generate an error.Pixelization of 5 pixels across7.9 SharpeningSharpening sharply defines the outlines in an image. iluSharpen performs this sharpeningeffect on an image. iluSharpen accepts two parameters: the sharpening factor and thenumber of iterations to perform the sharpening effect.The sharpening factor must be in the range of 0.0 - 2.5. A value of 1.0 for the sharpeningfactor will have no effect on the image.

Values in the range 1.0 - 2.5 will sharpen the image,with 2.5 having the most pronounced sharpening effect. Values from 0.0 to 1.0 do a typeof reverse sharpening, blurring the image. Values outside of the 0.0 - 2.5 range produceundefined results.The number of iterations to perform will usually be 1, but to achieve more sharpening,increase the number of iterations. This parameter is similar to the Iterations parameter ofthe two blurring functions. The time it takes to run this function is directly proportionalto the number of iterations desired.Sharpening of 2.5Chapter 8: Resizing Images178 Resizing Images8.1 Basic ScalingTo resize images, use the iluScale function:ILboolean iluScale(ILuint Width, ILuint Height, ILuint Depth);The three parameters are relatively explanatory. Any image can be resized to a newwidth, height and depth, provided that you have enough memory to hold the new image.The new dimensions do not have to be the same as the original in any way.

Aspect ratios ofthe image do not even have to be the same. The currently bound image is replaced entirelyby the new scaled image.If you specify a dimension greater than the original dimension, the image enlarges inthat direction. Alternately, if you specify a dimension smaller than the original dimension,the image shrinks in that direction.Original imageEnlarged imageShrunk image8.2 Advanced ScalingILU also allows you to specify which method you want to use to resize images. As you cansee in the middle figure above, the enlarged image is very pixelized.

The shrunk image isalso blocky. This is because a nearest filter was applied to the image in figure 5.1 to producefigures 5.2 and 5.3.ILU allows you to use different filters to produce better scaling results viailuImageParameter:• Nearest filter - ILU_NEAREST• Linear filter - ILU_LINEAR• Bilinear filter - ILU_BILINEAR• Box filter - ILU_SCALE_BOX• Triangle filter - ILU_SCALE_TRIANGLE• Bell filter - ILU_SCALE_BELL• B Spline filter - ILU_SCALE_BSPLINE• Lanczos filter - ILU_SCALE_LANCZOS3• Mitchell filter - ILU_SCALE_MITCHELLJust use the ILU_FILTER define as PName in iluImageParameter with the appropriatefilter define as Param.ILvoid iluImageParameter(ILenum PName, ILenum Param);Chapter 8: Resizing Images188.3 Filter ComparisonsThe first three filters (nearest, linear and bilinear) require an increasing amount of time toresize an image, with nearest being the quickest and bilinear being the slowest of the three.All the filters after bilinear are considered the advanced scaling functions and require muchmore time to complete, but they generally produce much nicer results.When minimizing an image, bilinear filtering should be sufficient, since it uses a fourpixel averaging scheme to create every destination pixel.

Minimized images do not generallyhave to use higher sampling schemes to achieve a reasonable image.Enlarging an image, though, depends quite heavily on how good the sampling schemeis. ILU provides several filtering functions to let you choose which one best fits your needs:speed versus image quality. Below is a comparison of the different types of filters whenenlarging an image.Nearest filterLinear filterBilinear filterBox filterTriangle filterBell filterB spline filterLanczos filterMitchell filterChapter 9: Sub-Images199 Sub-Images9.1 MipmapsMipmaps in DevIL are successive half-dimensioned power-of-2 images. The dimensions donot have to be powers of 2 if you generate them manually, but DevIL’s mipmap generationfacilities assume power-of-2 images.All mipmap levels down to 1x19.1.1 Mipmap CreationYou generate mipmaps for any image using iluBuildMipmaps.

Характеристики

Тип файла
PDF-файл
Размер
664,41 Kb
Материал
Тип материала
Высшее учебное заведение

Список файлов учебной работы

Задания
DevIL
include
IL
devil_cpp_wrapper.hpp
il.h
ilu.h
ilu_region.h
ilut.h
ilut_config.h
lib
libIL.a
libIL.la
libILU.a
libILU.la
libILUT.a
libILUT.la
DevIL-master
DevIL
org.eclipse.cdt.make.core.ScannerConfigBuilder.launch
org.eclipse.cdt.make.core.makeBuilder.launch
.cvsignore
org.eclipse.wst.sse.core.prefs
org.eclipse.wst.validation.prefs
src-ILUT
include
Makefile.am
ilut_allegro.h
ilut_internal.h
ilut_opengl.h
ilut_states.h
msvc8
resources
IL Logo.ico
ILUT.rc
ILUT Unicode.rc
ILUT Unicode.vcproj
ILUT.dsp
ILUT.rc
ILUT.vcproj
ilut.def
resource.h
msvc9
resources
IL Logo.ico
ILUT.rc
main.cpp
makefile.
QuantumOperation
definitions.h
header.h
helpers.cpp
kernel.cu
main.cpp
makefile.
Свежие статьи
Популярно сейчас
Почему делать на заказ в разы дороже, чем купить готовую учебную работу на СтудИзбе? Наши учебные работы продаются каждый год, тогда как большинство заказов выполняются с нуля. Найдите подходящий учебный материал на СтудИзбе!
Ответы на популярные вопросы
Да! Наши авторы собирают и выкладывают те работы, которые сдаются в Вашем учебном заведении ежегодно и уже проверены преподавателями.
Да! У нас любой человек может выложить любую учебную работу и зарабатывать на её продажах! Но каждый учебный материал публикуется только после тщательной проверки администрацией.
Вернём деньги! А если быть более точными, то автору даётся немного времени на исправление, а если не исправит или выйдет время, то вернём деньги в полном объёме!
Да! На равне с готовыми студенческими работами у нас продаются услуги. Цены на услуги видны сразу, то есть Вам нужно только указать параметры и сразу можно оплачивать.
Отзывы студентов
Ставлю 10/10
Все нравится, очень удобный сайт, помогает в учебе. Кроме этого, можно заработать самому, выставляя готовые учебные материалы на продажу здесь. Рейтинги и отзывы на преподавателей очень помогают сориентироваться в начале нового семестра. Спасибо за такую функцию. Ставлю максимальную оценку.
Лучшая платформа для успешной сдачи сессии
Познакомился со СтудИзбой благодаря своему другу, очень нравится интерфейс, количество доступных файлов, цена, в общем, все прекрасно. Даже сам продаю какие-то свои работы.
Студизба ван лав ❤
Очень офигенный сайт для студентов. Много полезных учебных материалов. Пользуюсь студизбой с октября 2021 года. Серьёзных нареканий нет. Хотелось бы, что бы ввели подписочную модель и сделали материалы дешевле 300 рублей в рамках подписки бесплатными.
Отличный сайт
Лично меня всё устраивает - и покупка, и продажа; и цены, и возможность предпросмотра куска файла, и обилие бесплатных файлов (в подборках по авторам, читай, ВУЗам и факультетам). Есть определённые баги, но всё решаемо, да и администраторы реагируют в течение суток.
Маленький отзыв о большом помощнике!
Студизба спасает в те моменты, когда сроки горят, а работ накопилось достаточно. Довольно удобный сайт с простой навигацией и огромным количеством материалов.
Студ. Изба как крупнейший сборник работ для студентов
Тут дофига бывает всего полезного. Печально, что бывают предметы по которым даже одного бесплатного решения нет, но это скорее вопрос к студентам. В остальном всё здорово.
Спасательный островок
Если уже не успеваешь разобраться или застрял на каком-то задание поможет тебе быстро и недорого решить твою проблему.
Всё и так отлично
Всё очень удобно. Особенно круто, что есть система бонусов и можно выводить остатки денег. Очень много качественных бесплатных файлов.
Отзыв о системе "Студизба"
Отличная платформа для распространения работ, востребованных студентами. Хорошо налаженная и качественная работа сайта, огромная база заданий и аудитория.
Отличный помощник
Отличный сайт с кучей полезных файлов, позволяющий найти много методичек / учебников / отзывов о вузах и преподователях.
Отлично помогает студентам в любой момент для решения трудных и незамедлительных задач
Хотелось бы больше конкретной информации о преподавателях. А так в принципе хороший сайт, всегда им пользуюсь и ни разу не было желания прекратить. Хороший сайт для помощи студентам, удобный и приятный интерфейс. Из недостатков можно выделить только отсутствия небольшого количества файлов.
Спасибо за шикарный сайт
Великолепный сайт на котором студент за не большие деньги может найти помощь с дз, проектами курсовыми, лабораторными, а также узнать отзывы на преподавателей и бесплатно скачать пособия.
Популярные преподаватели
Добавляйте материалы
и зарабатывайте!
Продажи идут автоматически
6392
Авторов
на СтудИзбе
307
Средний доход
с одного платного файла
Обучение Подробнее